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


PHP GWF_HTML::selected方法代码示例

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


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

示例1: singleB

 private static function singleB(GWF_ForumBoard $board, &$back, $level, $selected)
 {
     $rep = '+' . str_repeat('=', $level * 2);
     $back .= sprintf('<option value="%s"%s>%s</option>', $board->getID(), GWF_HTML::selected($selected === $board->getID()), $rep . $board->display('board_title'));
     $childs = $board->getChilds();
     if (count($childs) > 0) {
         foreach ($childs as $child) {
             self::singleB($child, $back, $level + 1, $selected);
         }
     }
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:11,代码来源:GWF_ForumBoardSelect.php

示例2: getSelect

 public static function getSelect(Module_PM $module, GWF_User $user, $selected = '0', $name = 'folders')
 {
     $folders = self::getFolders($user->getID());
     $back = sprintf('<select name="%s">', $name);
     $back .= sprintf('<option value="0"%s>%s</option>', GWF_HTML::selected($selected === '0'), $module->lang('sel_folder'));
     foreach ($folders as $folder) {
         $fid = $folder->getVar('pmf_id');
         $back .= sprintf('<option value="%s"%s>%s</option>', $fid, GWF_HTML::selected($selected === $fid), $folder->display('pmf_name'));
     }
     $back .= '</select>';
     return $back;
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:12,代码来源:GWF_PMFolder.php

示例3: getStatusSelect

 private function getStatusSelect(WC_Site $site, $name = 'site_status')
 {
     $back = sprintf('<select name="%s">', $name);
     foreach (WC_Site::$STATES as $state) {
         $sel = GWF_HTML::selected($site->getStatus() === $state);
         $back .= sprintf('<option value="%s"%s>%s</option>', $state, $sel, $this->module->lang('site_state_' . $state));
     }
     return $back . '</select>';
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:9,代码来源:SiteEdit.php

示例4: getMergeSelect

 public function getMergeSelect($name)
 {
     $bid = $this->getBoardID();
     if (false === ($threads = $this->selectObjects('*', "thread_bid={$bid}", "thread_firstdate"))) {
         return '';
     }
     $back = sprintf('<select name="%s">', $name);
     foreach ($threads as $t) {
         $id = $t->getID();
         $back .= sprintf('<option value="%d"%s>%s</option>', $id, GWF_HTML::selected($this->getID() === $id), $t->display('thread_title'));
     }
     $back .= '</select>';
     return $back;
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:14,代码来源:GWF_ForumThread.php

示例5: getTypeSelectB

 public static function getTypeSelectB(Module_News $module, $key, $value = 0)
 {
     $key = GWF_HTML::display($key);
     $value = (int) $value;
     $back = sprintf('<select name="%s">' . PHP_EOL, $key);
     $sel = GWF_HTML::selected($value === 0);
     $back .= sprintf('<option value="%d"%s>%s</option>' . PHP_EOL, 0, $sel, $module->lang('type_none'));
     $sel = GWF_HTML::selected($value === self::WANT_TEXT);
     $back .= sprintf('<option value="%d"%s>%s</option>' . PHP_EOL, self::WANT_TEXT, $sel, $module->lang('type_text'));
     $sel = GWF_HTML::selected($value === self::WANT_HTML);
     $back .= sprintf('<option value="%d"%s>%s</option>' . PHP_EOL, self::WANT_HTML, $sel, $module->lang('type_html'));
     $back .= '</select>' . PHP_EOL;
     return $back;
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:14,代码来源:GWF_Newsletter.php

示例6: getRangeInput

 private static function getRangeInput($key, $selected, $min, $max)
 {
     $back = sprintf('<select name="%s">', $key);
     $selected = (int) $selected;
     while ($min <= $max) {
         $sel = GWF_HTML::selected($selected === $min);
         $back .= sprintf('<option value="%02d"%s>%d</option>', $min, $sel, $min);
         $min++;
     }
     $back .= '</select>';
     return $back;
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:12,代码来源:GWF_DateSelect.php

示例7: getSubscrSelect

 public function getSubscrSelect(Module_Forum $module, $name = 'subscr')
 {
     $back = sprintf('<select name="%s">', $name);
     $val = $this->getVar('fopt_subscr');
     foreach (self::$SUBSCR_MODES as $opt) {
         $sel = GWF_HTML::selected($opt === $val);
         $back .= sprintf('<option value="%s"%s>%s</option>', $opt, $sel, $module->lang('subscr_' . $opt));
     }
     $back .= '</select>';
     return $back;
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:11,代码来源:GWF_ForumOptions.php


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