当前位置: 首页>>代码示例>>PHP>>正文


PHP Icon类代码示例

本文整理汇总了PHP中Icon的典型用法代码示例。如果您正苦于以下问题:PHP Icon类的具体用法?PHP Icon怎么用?PHP Icon使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了Icon类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: compare

 /**
  * @param Icon $a
  * @param Icon $b
  * @param int $min_size
  * @param int $max_size
  * @return int
  */
 private function compare($a, $b, $min_size, $max_size)
 {
     if ($a->isInRange($min_size, $max_size) == $b->isInRange($min_size, $max_size)) {
         return 0;
     }
     return $a->isInRange($min_size, $max_size) < $b->isInRange($min_size, $max_size) ? -1 : 1;
 }
开发者ID:rockschtar,项目名称:simple-icon-scraper,代码行数:14,代码来源:class-sort-helper.php

示例2: Icon

 public function Icon($cache = true)
 {
     require_once $this->App()->config("paths")['backend']['Icon'];
     require_once $this->App()->config("paths")['backend']['CacheWrapper'];
     $Icon = new Icon(function ($iconId) {
         return $this->getIcon($iconId);
     });
     $Icon->setMissingIcon($this->App()->config("defaults")['icon']['missing']);
     if ($cache) {
         return new CacheWrapper($this->App()->config("paths")['cache'], $Icon);
     } else {
         return $Icon;
     }
 }
开发者ID:xmx1024,项目名称:AchieveCraft,代码行数:14,代码来源:AchieveCraft.class.php

示例3: getPortalTemplate

 function getPortalTemplate()
 {
     $dispatcher = new StudipDispatcher();
     $controller = new NewsController($dispatcher);
     $response = $controller->relay('news/display/studip');
     $template = $GLOBALS['template_factory']->open('shared/string');
     $template->content = $response->body;
     if (StudipNews::CountUnread() > 0) {
         $navigation = new Navigation('', PluginEngine::getLink($this, array(), 'read_all'));
         $navigation->setImage(Icon::create('refresh', 'clickable', ["title" => _('Alle als gelesen markieren')]));
         $icons[] = $navigation;
     }
     if (get_config('NEWS_RSS_EXPORT_ENABLE')) {
         if ($rss_id = StudipNews::GetRssIdFromRangeId('studip')) {
             $navigation = new Navigation('', 'rss.php', array('id' => $rss_id));
             $navigation->setImage(Icon::create('rss', 'clickable', ["title" => _('RSS-Feed')]));
             $icons[] = $navigation;
         }
     }
     if ($GLOBALS['perm']->have_perm('root')) {
         $navigation = new Navigation('', 'dispatch.php/news/edit_news/new/studip');
         $navigation->setImage(Icon::create('add', 'clickable', ["title" => _('Ankündigungen bearbeiten')]), ["rel" => 'get_dialog']);
         $icons[] = $navigation;
         if (get_config('NEWS_RSS_EXPORT_ENABLE')) {
             $navigation = new Navigation('', 'dispatch.php/news/rss_config/studip');
             $navigation->setImage(Icon::create('rss+add', 'clickable', ["title" => _('RSS-Feed konfigurieren')]), ["data-dialog" => 'size=auto']);
             $icons[] = $navigation;
         }
     }
     $template->icons = $icons;
     return $template;
 }
开发者ID:ratbird,项目名称:hope,代码行数:32,代码来源:NewsWidget.php

示例4: __construct

 public function __construct($content = '', $icon = false)
 {
     parent::__construct($content);
     if ($icon) {
         $this->setIcon(is_string($icon) ? Icon::create2($icon) : $icon);
     }
 }
开发者ID:ratbird,项目名称:hope,代码行数:7,代码来源:InfoboxElement.php

示例5: getInput

 /**
  * Get the input corresponding to the field
  *
  * @return FormInput the input instance
  */
 public function getInput()
 {
     if (!is_array($this->search)) {
         $this->search = array('type' => 'text');
     }
     switch ($this->search['type']) {
         case 'select':
             $input = new SelectInput(array('options' => $this->search['options'], 'invitation' => isset($this->search['invitation']) ? $this->search['invitation'] : null, 'emptyValue' => isset($this->search['emptyValue']) ? $this->search['emptyValue'] : null, 'attributes' => array('e-value' => 'search', 'e-class' => "search ? 'alert-info not-empty' : 'empty'")));
             break;
         case 'checkbox':
             $input = new CheckboxInput(array('attributes' => array('e-value' => 'search')));
             break;
         case 'date':
             $input = new DatetimeInput(array('id' => uniqid(), 'after' => Icon::make(array('icon' => 'times-circle', 'class' => 'clean-search', 'e-click' => 'function(){ search = null; }', 'e-show' => 'search')), 'attributes' => array('e-value' => 'search', 'e-class' => "search ? 'alert-info not-empty' : 'empty'")));
             break;
         case 'text':
         default:
             $input = new TextInput(array('after' => Icon::make(array('icon' => 'times-circle', 'class' => 'clean-search', 'e-click' => 'function(){ search = null; }', 'e-show' => 'search')), 'attributes' => array('e-input' => 'search', 'e-class' => "search ? 'alert-info not-empty' : 'empty'")));
             break;
     }
     $input->attributes['data-field'] = $this->name;
     $input->class = ' list-search-input';
     $input->value = $this->searchValue;
     return $input;
 }
开发者ID:elvyrra,项目名称:hawk,代码行数:30,代码来源:ItemListField.php

示例6: __construct

 public function __construct()
 {
     parent::__construct();
     $nav = new Navigation(_("Downloads"), PluginEngine::getURL($this, array(), "downloadarea/overview"));
     $nav->setImage(Icon::create("download", "navigation"));
     Navigation::addItem("/downloader", $nav);
 }
开发者ID:studip,项目名称:StudipDownloader,代码行数:7,代码来源:StudipDownloader.php

示例7: head

function head($headline, $red = False)
{
    $class = '';
    if ($red) {
        $class = '_red';
    }
    ?>
<div align="center">
<table class="default" width="70%">
    <tbody>
        <tr>
            <td class="table_header_bold<?php 
    echo $class;
    ?>
" colspan=3 align="left">
                <?php 
    echo Icon::create('mail', 'info_alt')->asImg(['class' => 'text-top']);
    ?>
                <b>&nbsp;<?php 
    echo $headline;
    ?>
</b>
            </td>
        </tr>
        <tr>
            <td style="padding: 1.5em;">
<?php 
}
开发者ID:ratbird,项目名称:hope,代码行数:28,代码来源:activate_email.php

示例8: __construct

 public function __construct()
 {
     parent::__construct();
     if ($GLOBALS['perm']->have_perm("root")) {
         $processes = FleximportProcess::findBySQL("1=1 ORDER BY name ASC");
         $navigation = new Navigation($this->getDisplayName());
         $navigation->setURL(PluginEngine::getURL($this, array(), 'import/overview' . (count($processes) ? "/" . $processes[0]['process_id'] : "")));
         Navigation::addItem('/start/fleximport', $navigation);
         Navigation::addItem('/fleximport', $navigation);
         if (count($processes)) {
             foreach ($processes as $process) {
                 $navigation = new Navigation($process['name'], PluginEngine::getURL($this, array(), 'import/overview/' . $process->getId()));
                 Navigation::addItem('/fleximport/process_' . $process->getId(), $navigation);
             }
         } else {
             $navigation = new Navigation(_("Import"), PluginEngine::getURL($this, array(), 'import/overview'));
             Navigation::addItem('/fleximport/overview', $navigation);
         }
         $navigation = new Navigation(_("Konfiguration"), PluginEngine::getURL($this, array(), 'config/overview'));
         Navigation::addItem('/fleximport/config', $navigation);
         if (FleximportConfig::get("DISPLAY_AT_HEADER")) {
             if (is_numeric(FleximportConfig::get("DISPLAY_AT_HEADER"))) {
                 Navigation::getItem('/fleximport')->setImage(version_compare($GLOBALS['SOFTWARE_VERSION'], "3.4", ">=") ? Icon::create("install", "navigation") : Assets::image_path("icons/lightblue/install.svg"));
             } else {
                 Navigation::getItem('/fleximport')->setImage(version_compare($GLOBALS['SOFTWARE_VERSION'], "3.4", ">=") ? Icon::create(FleximportConfig::get("DISPLAY_AT_HEADER"), "navigation") : FleximportConfig::get("DISPLAY_AT_HEADER"));
             }
         }
     }
 }
开发者ID:Krassmus,项目名称:Fleximport,代码行数:29,代码来源:Fleximport.class.php

示例9: afterStoreCallback

 public function afterStoreCallback()
 {
     if ($this->isDirty()) {
         //add notification to writer of review
         if (!$this->review['host_id'] && $this->review['user_id'] !== $this['user_id']) {
             PersonalNotifications::add($this->review['user_id'], URLHelper::getURL("plugins.php/lernmarktplatz/market/discussion/" . $this['review_id'] . "#comment_" . $this->getId()), sprintf(_("%s hat einen Kommentar zu Ihrem Review geschrieben."), $this['host_id'] ? LernmarktplatzUser::find($this['user_id'])->name : get_fullname($this['user_id'])), "comment_" . $this->getId(), Icon::create("support", "clickable"));
         }
         //add notification to all users of this servers who discussed this review but are neither the new
         //commentor nor the writer of the review
         $statement = DBManager::get()->prepare("\n                SELECT user_id\n                FROM lernmarktplatz_comments\n                WHERE review_id = :review_id\n                    AND host_id IS NULL\n                GROUP BY user_id\n            ");
         $statement->execute(array('review_id' => $this->review->getId()));
         foreach ($statement->fetchAll(PDO::FETCH_COLUMN, 0) as $user_id) {
             if (!in_array($user_id, array($this->review['user_id'], $this['user_id']))) {
                 PersonalNotifications::add($user_id, URLHelper::getURL("plugins.php/lernmarktplatz/market/discussion/" . $this['review_id'] . "#comment_" . $this->getId()), sprintf(_("%s hat auch einen Kommentar geschrieben."), $this['host_id'] ? LernmarktplatzUser::find($this['user_id'])->name : get_fullname($this['user_id'])), "comment_" . $this->getId(), Icon::create("support", "clickable"));
             }
         }
         //only push if the comment is from this server and the material-server is different
         if (!$this['host_id']) {
             $myHost = LernmarktplatzHost::thisOne();
             $data = array();
             $data['host'] = array('name' => $myHost['name'], 'url' => $myHost['url'], 'public_key' => $myHost['public_key']);
             $data['data'] = $this->toArray();
             $data['data']['foreign_comment_id'] = $data['data']['comment_id'];
             unset($data['data']['comment_id']);
             unset($data['data']['id']);
             unset($data['data']['user_id']);
             unset($data['data']['host_id']);
             $user_description_datafield = DataField::find(get_config("LERNMARKTPLATZ_USER_DESCRIPTION_DATAFIELD")) ?: DataField::findOneBySQL("name = ?", array(get_config("LERNMARKTPLATZ_USER_DESCRIPTION_DATAFIELD")));
             if ($user_description_datafield) {
                 $datafield_entry = DatafieldEntryModel::findOneBySQL("range_id = ? AND datafield_id = ?", array($this['user_id'], $user_description_datafield->getId()));
             }
             $data['user'] = array('user_id' => $this['user_id'], 'name' => get_fullname($this['user_id']), 'avatar' => Avatar::getAvatar($this['user_id'])->getURL(Avatar::NORMAL), 'description' => $datafield_entry ? $datafield_entry['content'] : null);
             $statement = DBManager::get()->prepare("\n                    SELECT host_id\n                    FROM lernmarktplatz_comments\n                    WHERE review_id = :review_id\n                        AND host_id IS NOT NULL\n                    GROUP BY host_id\n                ");
             $statement->execute(array('review_id' => $this->review->getId()));
             $hosts = $statement->fetchAll(PDO::FETCH_COLUMN, 0);
             if ($this->review['host_id'] && !in_array($this->review['host_id'], $hosts)) {
                 $hosts[] = $this->review['host_id'];
             }
             if ($this->review->material['host_id'] && !in_array($this->review->material['host_id'], $hosts)) {
                 $hosts[] = $this->review->material['host_id'];
             }
             foreach ($hosts as $host_id) {
                 $remote = new LernmarktplatzHost($host_id);
                 if (!$remote->isMe()) {
                     $review_id = $this->review['foreign_review_id'] ?: $this->review->getId();
                     if ($this->review['foreign_review_id']) {
                         if ($this->review->host_id === $remote->getId()) {
                             $host_hash = null;
                         } else {
                             $host_hash = md5($this->review->host['public_key']);
                         }
                     } else {
                         $host_hash = md5($myHost['public_key']);
                     }
                     $remote->pushDataToEndpoint("add_comment/" . $review_id . "/" . $host_hash, $data);
                 }
             }
         }
     }
 }
开发者ID:Krassmus,项目名称:LehrMarktplatz,代码行数:60,代码来源:LernmarktplatzComment.php

示例10: afterStoreCallback

 public function afterStoreCallback()
 {
     if (!$this->material['host_id'] && $this->material['user_id'] !== $GLOBALS['user']->id) {
         PersonalNotifications::add($this->material['user_id'], URLHelper::getURL("plugins.php/lernmarktplatz/market/details/" . $this->material->getId() . "#review_" . $this->getId()), $this->isNew() ? sprintf(_("%s hat ein Review zu '%s' geschrieben."), $this['host_id'] ? LernmarktplatzUser::find($this['user_id'])->name : get_fullname($this['user_id']), $this->material['name']) : sprintf(_("%s hat ein Review zu '%s' verändert."), $this['host_id'] ? LernmarktplatzUser::find($this['user_id'])->name : get_fullname($this['user_id']), $this->material['name']), "review_" . $this->getId(), Icon::create("support", "clickable"));
     }
     //only push if the comment is from this server and the material-server is different
     if ($this->material['host_id'] && !$this['host_id'] && $this->isDirty()) {
         $remote = new LernmarktplatzHost($this->material['host_id']);
         $myHost = LernmarktplatzHost::thisOne();
         $data = array();
         $data['host'] = array('name' => $myHost['name'], 'url' => $myHost['url'], 'public_key' => $myHost['public_key']);
         $data['data'] = $this->toArray();
         $data['data']['foreign_review_id'] = $data['data']['review_id'];
         unset($data['data']['review_id']);
         unset($data['data']['id']);
         unset($data['data']['user_id']);
         unset($data['data']['host_id']);
         $user_description_datafield = DataField::find(get_config("LERNMARKTPLATZ_USER_DESCRIPTION_DATAFIELD")) ?: DataField::findOneBySQL("name = ?", array(get_config("LERNMARKTPLATZ_USER_DESCRIPTION_DATAFIELD")));
         if ($user_description_datafield) {
             $datafield_entry = DatafieldEntryModel::findOneBySQL("range_id = ? AND datafield_id = ?", array($this['user_id'], $user_description_datafield->getId()));
         }
         $data['user'] = array('user_id' => $this['user_id'], 'name' => get_fullname($this['user_id']), 'avatar' => Avatar::getAvatar($this['user_id'])->getURL(Avatar::NORMAL), 'description' => $datafield_entry ? $datafield_entry['content'] : null);
         if (!$remote->isMe()) {
             $remote->pushDataToEndpoint("add_review/" . $this->material['foreign_material_id'], $data);
         }
     }
 }
开发者ID:Krassmus,项目名称:LehrMarktplatz,代码行数:27,代码来源:LernmarktplatzReview.php

示例11: __construct

 public function __construct()
 {
     parent::__construct();
     $top = new Navigation($this->getDisplayTitle(), PluginEngine::getURL($this, array('view' => 'tiles'), "presenting/overview"));
     $top->setImage(Icon::create($this->getPluginURL() . "/assets/topicon.svg"));
     $overview = new Navigation($this->getDisplayTitle(), PluginEngine::getURL($this, array(), "presenting/overview"));
     $top->addSubNavigation("presenting", $overview);
     $overview->addSubNavigation("overview", new AutoNavigation(_('Übersicht'), PluginEngine::getURL($this, array(), "presenting/overview")));
     $overview->addSubNavigation("all", new AutoNavigation(_('Alle Plugins'), PluginEngine::getURL($this, array(), "presenting/all")));
     $overview->addSubNavigation("tools", new AutoNavigation(_('Tools'), PluginEngine::getURL($this, array(), "tools/sidebar_graphics_generator")));
     if ($GLOBALS['perm']->have_perm("autor")) {
         $top->addSubNavigation("myplugins", new Navigation(_("Meine Plugins"), PluginEngine::getURL($this, array(), "myplugins/overview")));
     }
     if ($GLOBALS['perm']->have_perm("user")) {
         $last_visit = UserConfig::get($GLOBALS['user']->id)->getValue("last_pluginmarket_visit");
         if ($last_visit) {
             $badge_number = MarketPlugin::countBySql("publiclyvisible = 1 AND approved = 1 AND published > ?", array($last_visit));
             if ($badge_number > 0) {
                 $top->setBadgeNumber($badge_number);
             }
         }
     }
     if ($GLOBALS['perm']->have_perm("root")) {
         $approving = new Navigation(_("Qualitätssicherung"), PluginEngine::getURL($this, array(), "approving/overview"));
         $top->addSubNavigation("approving", $approving);
     }
     Navigation::addItem("/pluginmarket", $top);
     $loginlink = new Navigation($this->getDisplayTitle(), PluginEngine::getURL($this, array(), "presenting/overview"));
     $loginlink->setDescription(_("Laden Sie hier Plugins für Ihr Stud.IP herunter"));
     Navigation::addItem("/login/pluginmarket", $loginlink);
     NotificationCenter::addObserver($this, "triggerFollowingStudips", "PluginReleaseDidUpdateCode");
 }
开发者ID:studip,项目名称:PluginMarket,代码行数:32,代码来源:PluginMarket.class.php

示例12: getTabNavigation

 function getTabNavigation($course_id)
 {
     $object_type = get_object_type($course_id, array('sem', 'inst'));
     if ($object_type === 'sem') {
         $course = Course::find($course_id);
         $sem_class = $GLOBALS['SEM_CLASS'][$GLOBALS['SEM_TYPE'][$course->status]['class']] ?: SemClass::getDefaultSemClass();
     } else {
         $institute = Institute::find($course_id);
         $sem_class = SemClass::getDefaultInstituteClass($institute->type);
     }
     $navigation = new Navigation(_('Übersicht'));
     $navigation->setImage(Icon::create('seminar', 'info_alt'));
     $navigation->setActiveImage(Icon::create('seminar', 'info'));
     if ($object_type !== 'sem') {
         $navigation->addSubNavigation('info', new Navigation(_('Kurzinfo'), 'dispatch.php/institute/overview'));
         $navigation->addSubNavigation('courses', new Navigation(_('Veranstaltungen'), 'show_bereich.php?level=s&id=' . $course_id));
         $navigation->addSubNavigation('schedule', new Navigation(_('Veranstaltungs-Stundenplan'), 'dispatch.php/calendar/instschedule?cid=' . $course_id));
         if ($GLOBALS['perm']->have_studip_perm('admin', $course_id)) {
             $navigation->addSubNavigation('admin', new Navigation(_('Administration der Einrichtung'), 'dispatch.php/institute/basicdata/index?new_inst=TRUE'));
         }
     } else {
         $navigation->addSubNavigation('info', new Navigation(_('Kurzinfo'), 'dispatch.php/course/overview'));
         if (!$sem_class['studygroup_mode']) {
             $navigation->addSubNavigation('details', new Navigation(_('Details'), 'dispatch.php/course/details/'));
         }
         if (!$course->admission_binding && in_array($GLOBALS['perm']->get_studip_perm($course_id), array('user', 'autor'))) {
             $navigation->addSubNavigation('leave', new Navigation(_('Austragen aus der Veranstaltung'), 'dispatch.php/my_courses/decline/' . $course_id . '?cmd=suppose_to_kill'));
         }
     }
     return array('main' => $navigation);
 }
开发者ID:ratbird,项目名称:hope,代码行数:31,代码来源:CoreOverview.class.php

示例13: index_action

 /**
  * show the administration page for mass-editing forum-entries
  */
 function index_action()
 {
     ForumPerm::check('admin', $this->getId());
     $nav = Navigation::getItem('course/forum2');
     $nav->setImage(Icon::create('forum', 'info'));
     Navigation::activateItem('course/forum2/admin');
     $list = ForumEntry::getList('flat', $this->getId());
     // sort by cat
     $new_list = array();
     // iterate over all categories and add the belonging areas to them
     foreach ($categories = ForumCat::getListWithAreas($this->getId(), false) as $category) {
         if ($category['topic_id']) {
             $new_list[$category['category_id']][$category['topic_id']] = $list['list'][$category['topic_id']];
             unset($list['list'][$category['topic_id']]);
         } else {
             if (ForumPerm::has('add_area', $this->seminar_id)) {
                 $new_list[$category['category_id']] = array();
             }
         }
         $this->categories[$category['category_id']] = $category['entry_name'];
     }
     if (!empty($list['list'])) {
         // append the remaining entries to the standard category
         $new_list[$this->getId()] = array_merge((array) $new_list[$this->getId()], $list['list']);
     }
     $this->list = $new_list;
 }
开发者ID:ratbird,项目名称:hope,代码行数:30,代码来源:admin.php

示例14: initItem

 public function initItem()
 {
     global $user, $neux;
     parent::initItem();
     $my_messaging_settings = UserConfig::get($user->id)->MESSAGING_SETTINGS;
     $lastVisitedTimestamp = isset($my_messaging_settings['last_box_visit']) ? (int) $my_messaging_settings['last_box_visit'] : 0;
     $query = "SELECT SUM(mkdate > :time AND readed = 0) AS num_new,\n                         SUM(readed = 0) AS num_unread,\n                         SUM(readed = 1) AS num_read\n                  FROM message_user\n                  WHERE snd_rec = 'rec' AND user_id = :user_id AND deleted = 0";
     $statement = DBManager::get()->prepare($query);
     $statement->bindValue(':time', $lastVisitedTimestamp);
     $statement->bindValue(':user_id', $GLOBALS['user']->id);
     $statement->execute();
     list($neux, $neum, $altm) = $statement->fetch(PDO::FETCH_NUM);
     $this->setBadgeNumber($neum);
     if ($neux > 0) {
         $tip = sprintf(ngettext('Sie haben %d neue ungelesene Nachricht', 'Sie haben %d neue ungelesene Nachrichten', $neux), $neux);
     } else {
         if ($neum > 1) {
             $tip = sprintf(ngettext('Sie haben %d ungelesene Nachricht', 'Sie haben %d ungelesene Nachrichten', $neum), $neum);
         } else {
             if ($altm > 1) {
                 $tip = sprintf(ngettext('Sie haben %d alte empfangene Nachricht', 'Sie haben %d alte empfangene Nachrichten', $altm), $altm);
             } else {
                 $tip = _('Sie haben keine alten empfangenen Nachrichten');
             }
         }
     }
     $this->setImage(Icon::create('mail', 'navigation', ["title" => $tip]));
 }
开发者ID:ratbird,项目名称:hope,代码行数:28,代码来源:MessagingNavigation.php

示例15: getTabNavigation

 function getTabNavigation($course_id)
 {
     $navigation = new Navigation(_('Teilnehmende'), "dispatch.php/course/studygroup/members/" . $course_id);
     $navigation->setImage(Icon::create('persons', 'info_alt'));
     $navigation->setActiveImage(Icon::create('persons', 'info'));
     return array('members' => $navigation);
 }
开发者ID:ratbird,项目名称:hope,代码行数:7,代码来源:CoreStudygroupParticipants.class.php


注:本文中的Icon类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。