public function admin_index_icons()
 {
     $activeIcon = $this->RequestHandler->getNamed('icon');
     App::uses('FontAwesome/FontAwesome', 'Vendor');
     $FontAwesome = new FontAwesome();
     $icons = $FontAwesome->getData();
     $this->set(compact('icons', 'activeIcon'));
 }
Example #2
0
 public static function get_instance()
 {
     if (!self::has_instance()) {
         self::$instance = new FontAwesome();
     }
     return self::$instance;
 }
Example #3
0
    public function testCdnLinkOutput()
    {
        $this->expectOutputString('<link href="//netdna.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css" rel="stylesheet">');

        echo FontAwesome::css();
    }
Example #4
0
    /**
     * @param array $option
     * @param array $attributes
     * @return string
     */
    public function iconsManagerOld(array $option, array $attributes)
    {
        App::uses('FontAwesome/FontAwesome', 'Vendor');
        $FontAwesome = new FontAwesome();
        $iconsData = $FontAwesome->getData();
        $id = 'gumm-filterable-content-' . uniqid();
        $outputHtml = '<div id="' . $id . '" class="gumm-filterable-content">';
        $outputHtml .= $this->hidden($option, array_merge($attributes, array('class' => 'icon-value', 'value' => $this->value)));
        $outputHtml .= '<div class="input-wrap wrap-text filter-input-wrap"><label for="filter-' . $option['id'] . '">' . __('Filter', 'gummfw') . '</label>';
        $outputHtml .= '<input id="filter' . $option['id'] . '" type="text" class="filter-input" /></div>';
        $outputHtml .= '<div class="gumm-filtarable-content-container">';
        $counter = 0;
        foreach ($iconsData as $groupId => $groupData) {
            $outputHtml .= '<h5>' . $groupData['title'] . '</h5>';
            $chunks = array_chunk($groupData['icons'], ceil(count($groupData['icons']) / 4));
            foreach ($chunks as $chunk) {
                $outputHtml .= '<ul style="float: left; width: 25%;">';
                foreach ($chunk as $iconClass) {
                    $iconName = str_replace('icon-', '', $iconClass);
                    $liClass = '';
                    if ($iconClass == $this->value) {
                        $liClass = 'selected';
                    }
                    $outputHtml .= '<li class="' . $liClass . '"><i data-icon-name="' . $iconName . '" class="' . $iconClass . '"></i><span>' . Inflector::humanize(Inflector::slug($iconClass, '_')) . '</span>';
                    $outputHtml .= '</li>';
                    $counter++;
                }
                $outputHtml .= '</ul>';
            }
            $outputHtml .= '<div class="clear"></div>';
        }
        $outputHtml .= '</div>';
        $outputHtml .= '</div>';
        $this->scriptBlockStart();
        ?>
        $('#<?php 
        echo $id;
        ?>
').gummFilterableContent();
<?php 
        $this->scriptBlockEnd();
        return $outputHtml;
    }