# buttonizer-multifunctional-button/1.0.5/classes/admin/IconManager.php

Buttonizer – Floating Menus, Sticky Buttons, &amp; Popup Builder, version 1.0.5. 58 lines.

- Page: https://pluginprobe.com/plugins/buttonizer-multifunctional-button/1.0.5/code/classes/admin/IconManager.php
- Raw: https://pluginprobe.com/plugins/buttonizer-multifunctional-button/1.0.5/raw/classes/admin/IconManager.php
- Modified: 2017-09-01T12:26:28+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/buttonizer-multifunctional-button/1.0.5/code/classes/admin/IconManager.php#L10-L20`.

```php
<?php

/*
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.

Copyright 2017 Buttonizer
*/
namespace Buttonizer\Admin;

# No script kiddies
defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
class IconManager
{
    private  $aFontAwesome = array() ;
    public function __construct( $aFontAwesome )
    {
        $this->aFontAwesome = $aFontAwesome;
    }
    
    public function generator( $aData )
    {
        if ( !isset( $aData['image'] ) || !isset( $aData['icon'] ) || !isset( $aData['image_fieldname'] ) || !isset( $aData['icon_fieldname'] ) ) {
            return 'Invalid.';
        }
        $p = $this->generator_start( $aData );
        return $p;
    }
    
    private function generator_start( $aData )
    {
        $p = '<div class="icon-or-image" data-type="' . (( $aData['image'] != '' ? 'image' : 'icon' )) . '">
        <div class="icon-placeholder" ' . (( $aData['image'] != '' ? 'style="display: none;"' : '' )) . '>
            <div class="placeholder-choose">
                or <span class="buttonizer-click-to-pro" style="color: #0073aa; text-decoration: underline; cursor: pointer;">upload image (PRO ONLY)</span>
            </div>';
        $p .= '<select name="' . $aData['icon_fieldname'] . '" id="' . $fieldName . '" style="font-family: \'FontAwesome\', \'Helvetica\';" class="fa-chooser">';
        $p .= '<option value="+">+</option>';
        foreach ( $this->aFontAwesome as $key => $row ) {
            $p .= '<option value="' . $key . '" ' . (( $aData['icon'] == $key ? 'selected="selected"' : '' )) . '>' . $row . ' ' . $key . '</option>';
        }
        $p .= '</select>';
        $p .= '</div>';
        return $p;
    }

}
```
