• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP Gdn_Theme类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: smarty_function_link

/**
 * Takes a route and prepends the web root (expects "/controller/action/params" as $Path).
 *
 * @param array The parameters passed into the function.
 * The parameters that can be passed to this function are as follows.
 * - <b>path</b>: The relative path for the url. There are some special paths that can be used to return "intelligent" links:
 *    - <b>signinout</b>: This will return a signin/signout url that will toggle depending on whether or not the user is already signed in. When this path is given the text is automaticall set.
 * - <b>withdomain</b>: Whether or not to add the domain to the url.
 * - <b>text</b>: Html text to be put inside an anchor. If this value is set then an html <a></a> is returned rather than just a url.
 * - <b>id, class, etc.</b>: When an anchor is generated then any other attributes are passed through and will be written in the resulting tag.
 * @param Smarty The smarty object rendering the template.
 * @return The url.
 */
function smarty_function_link($Params, &$Smarty)
{
    $Path = GetValue('path', $Params, '', TRUE);
    $Text = GetValue('text', $Params, '', TRUE);
    $NoTag = GetValue('notag', $Params, FALSE, TRUE);
    $CustomFormat = GetValue('format', $Params, FALSE, TRUE);
    if (!$Text && $Path != 'signinout' && $Path != 'signin') {
        $NoTag = TRUE;
    }
    if ($CustomFormat) {
        $Format = $CustomFormat;
    } else {
        if ($NoTag) {
            $Format = '%url';
        } else {
            $Format = '<a href="%url" class="%class">%text</a>';
        }
    }
    $Options = array();
    if (isset($Params['withdomain'])) {
        $Options['WithDomain'] = $Params['withdomain'];
    }
    if (isset($Params['class'])) {
        $Options['class'] = $Params['class'];
    }
    if (isset($Params['tk'])) {
        $Options['TK'] = $Params['tk'];
    }
    if (isset($Params['target'])) {
        $Options['Target'] = $Params['target'];
    }
    $Result = Gdn_Theme::Link($Path, $Text, $Format, $Options);
    return $Result;
}
开发者ID:karanjitsingh,项目名称:iecse-forum,代码行数:47,代码来源:function.link.php


示例2: initialize

 /**
  * Runs before every call to this controller.
  */
 public function initialize()
 {
     parent::initialize();
     Gdn_Theme::section('Dashboard');
     set_time_limit(0);
     // Is this even doing anything?
 }
开发者ID:sitexa,项目名称:vanilla,代码行数:10,代码来源:class.utilitycontroller.php


示例3: smarty_function_signin_link

/**
 */
function smarty_function_signin_link($Params, &$Smarty)
{
    if (!Gdn::Session()->IsValid()) {
        $Wrap = GetValue('wrap', $Params, 'li');
        return Gdn_Theme::Link('signinout', GetValue('text', $Params, ''), GetValue('format', $Params, Wrap('<a href="%url" rel="nofollow" class="%class">%text</a>', $Wrap)), $Params);
    }
}
开发者ID:karanjitsingh,项目名称:iecse-forum,代码行数:9,代码来源:function.signin_link.php


示例4: smarty_function_nomobile_link

/**
 *
 *
 * @param array $Params
 * @param object $Smarty
 * @return string
 */
function smarty_function_nomobile_link($Params, &$Smarty)
{
    $Path = val('path', $Params, '', true);
    $Text = val('text', $Params, '', true);
    $Wrap = val('wrap', $Params, 'li');
    return Gdn_Theme::link('profile/nomobile', val('text', $Params, t("Full Site")), val('format', $Params, wrap('<a href="%url" class="%class">%text</a>', $Wrap)));
}
开发者ID:sitexa,项目名称:vanilla,代码行数:14,代码来源:function.nomobile_link.php


示例5: smarty_function_category_link

/**
 */
function smarty_function_category_link($Params, &$Smarty)
{
    $Path = GetValue('path', $Params, '', TRUE);
    $Text = GetValue('text', $Params, '', TRUE);
    $Wrap = GetValue('wrap', $Params, 'li');
    return Gdn_Theme::Link('category', GetValue('text', $Params, ''), GetValue('format', $Params, Wrap('<a href="%url" class="%class">%text</a>', $Wrap)));
}
开发者ID:edward-tsai,项目名称:vanilla4china,代码行数:9,代码来源:function.category_link.php


示例6: smarty_function_module

/**
 * @copyright Copyright 2008, 2009 Vanilla Forums Inc.
 * @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2
 */
function smarty_function_module($Params, &$Smarty)
{
    $Name = GetValue('name', $Params);
    unset($Params['name']);
    $Result = Gdn_Theme::Module($Name, $Params);
    return $Result;
}
开发者ID:edward-tsai,项目名称:vanilla4china,代码行数:11,代码来源:function.module.php


示例7: smarty_function_nomobile_link

/**
 */
function smarty_function_nomobile_link($Params, &$Smarty)
{
    $Path = GetValue('path', $Params, '', TRUE);
    $Text = GetValue('text', $Params, '', TRUE);
    $Wrap = GetValue('wrap', $Params, 'li');
    return Gdn_Theme::Link('profile/nomobile', GetValue('text', $Params, T("Full Site")), GetValue('format', $Params, Wrap('<a href="%url" class="%class">%text</a>', $Wrap)));
}
开发者ID:edward-tsai,项目名称:vanilla4china,代码行数:9,代码来源:function.nomobile_link.php


示例8: smarty_function_dashboard_link

/**
 *
 *
 * @param array $Params
 * @param object $Smarty
 * @return string
 */
function smarty_function_dashboard_link($Params, &$Smarty)
{
    $Path = val('path', $Params, '', true);
    $Text = val('text', $Params, '', true);
    $Wrap = val('wrap', $Params, 'li');
    return Gdn_Theme::link('dashboard', val('text', $Params, ''), val('format', $Params, wrap('<a href="%url" class="%class">%text</a>', $Wrap)));
}
开发者ID:korelstar,项目名称:vanilla,代码行数:14,代码来源:function.dashboard_link.php


示例9: smarty_function_breadcrumbs

/**
 * Render a breadcrumb trail for the user based on the page they are on.
 */
function smarty_function_breadcrumbs($Params, &$Smarty)
{
    $Breadcrumbs = $Smarty->Controller->Data('Breadcrumbs');
    if (is_array($Breadcrumbs)) {
        return Gdn_Theme::Breadcrumbs($Breadcrumbs);
    }
}
开发者ID:seedbank,项目名称:old-repo,代码行数:10,代码来源:function.breadcrumbs.php


示例10: smarty_function_custom_menu

/**
 * A placeholder for future menu items.
 *
 * @param array $Params The parameters passed into the function.
 * @param Smarty $Smarty The smarty object rendering the template.
 * @return string
 */
function smarty_function_custom_menu($Params, &$Smarty)
{
    $Controller = $Smarty->Controller;
    if (is_object($Menu = val('Menu', $Controller))) {
        $Format = val('format', $Params, wrap('<a href="%url" class="%class">%text</a>', val('wrap', $Params, 'li')));
        $Result = '';
        foreach ($Menu->Items as $Group) {
            foreach ($Group as $Item) {
                // Make sure the item is a custom item.
                if (valr('Attributes.Standard', $Item)) {
                    continue;
                }
                // Make sure the user has permission for the item.
                if ($Permission = val('Permission', $Item)) {
                    if (!Gdn::session()->checkPermission($Permission)) {
                        continue;
                    }
                }
                if (($Url = val('Url', $Item)) && ($Text = val('Text', $Item))) {
                    $Attributes = val('Attributes', $Item);
                    $Result .= Gdn_Theme::link($Url, $Text, $Format, $Attributes) . "\r\n";
                }
            }
        }
        return $Result;
    }
    return '';
}
开发者ID:caidongyun,项目名称:vanilla,代码行数:35,代码来源:function.custom_menu.php


示例11: initialize

 /**
  * Runs before every call to this controller.
  */
 public function initialize()
 {
     parent::initialize();
     Gdn_Theme::section('Dashboard');
     $this->Model = new DBAModel();
     $this->Form = new Gdn_Form();
     $this->addJsFile('dba.js');
 }
开发者ID:vanilla,项目名称:vanilla,代码行数:11,代码来源:class.dbacontroller.php


示例12: initialize

 /**
  * Set menu path. Automatically run on every use.
  *
  * @since 2.0.0
  * @access public
  */
 public function initialize()
 {
     parent::initialize();
     Gdn_Theme::section('Dashboard');
     if ($this->Menu) {
         $this->Menu->highlightRoute('/dashboard/settings');
     }
 }
开发者ID:caidongyun,项目名称:vanilla,代码行数:14,代码来源:class.routescontroller.php


示例13: smarty_function_breadcrumbs

/**
 * Render a breadcrumb trail for the user based on the page they are on.
 */
function smarty_function_breadcrumbs($Params, &$Smarty)
{
    $Breadcrumbs = $Smarty->Controller->Data('Breadcrumbs');
    if (!is_array($Breadcrumbs)) {
        $Breadcrumbs = array();
    }
    return Gdn_Theme::Breadcrumbs($Breadcrumbs, GetValue('homelink', $Params, TRUE));
}
开发者ID:elpum,项目名称:TgaForumBundle,代码行数:11,代码来源:function.breadcrumbs.php


示例14: PluginController_FileUpload_Create

 public function PluginController_FileUpload_Create($Sender)
 {
     $Sender->Title('FileUpload');
     $Sender->AddSideMenu('plugin/fileupload');
     Gdn_Theme::Section('Dashboard');
     $Sender->Form = new Gdn_Form();
     $this->EnableSlicing($Sender);
     $this->Dispatch($Sender, $Sender->RequestArgs);
 }
开发者ID:SatiricMan,项目名称:addons,代码行数:9,代码来源:class.fileupload.plugin.php


示例15: Initialize

 public function Initialize()
 {
     parent::Initialize();
     Gdn_Theme::Section('Dashboard');
     $this->Model = new DBAModel();
     $this->Form = new Gdn_Form();
     $this->Form->InputPrefix = '';
     $this->AddJsFile('dba.js');
 }
开发者ID:3marproof,项目名称:vanilla,代码行数:9,代码来源:class.dbacontroller.php


示例16: smarty_function_breadcrumbs

/**
 * Render a breadcrumb trail for the user based on the page they are on.
 *
 * @param array $Params
 * @param object $Smarty
 * @return string
 */
function smarty_function_breadcrumbs($Params, &$Smarty)
{
    $Breadcrumbs = $Smarty->Controller->data('Breadcrumbs');
    if (!is_array($Breadcrumbs)) {
        $Breadcrumbs = array();
    }
    $Options = arrayTranslate($Params, array('homeurl' => 'HomeUrl', 'hidelast' => 'HideLast'));
    return Gdn_Theme::breadcrumbs($Breadcrumbs, val('homelink', $Params, true), $Options);
}
开发者ID:bodogbo,项目名称:vanilla,代码行数:16,代码来源:function.breadcrumbs.php


示例17: index

 /**
  * Default search functionality.
  *
  * @since 2.0.0
  * @access public
  * @param int $Page Page number.
  */
 public function index($Page = '')
 {
     $this->addJsFile('search.js');
     $this->title(t('Search'));
     saveToConfig('Garden.Format.EmbedSize', '160x90', false);
     Gdn_Theme::section('SearchResults');
     list($Offset, $Limit) = offsetLimit($Page, c('Garden.Search.PerPage', 20));
     $this->setData('_Limit', $Limit);
     $Search = $this->Form->getFormValue('Search');
     $Mode = $this->Form->getFormValue('Mode');
     if ($Mode) {
         $this->SearchModel->ForceSearchMode = $Mode;
     }
     try {
         $ResultSet = $this->SearchModel->Search($Search, $Offset, $Limit);
     } catch (Gdn_UserException $Ex) {
         $this->Form->addError($Ex);
         $ResultSet = array();
     } catch (Exception $Ex) {
         LogException($Ex);
         $this->Form->addError($Ex);
         $ResultSet = array();
     }
     Gdn::userModel()->joinUsers($ResultSet, array('UserID'));
     // Fix up the summaries.
     $SearchTerms = explode(' ', Gdn_Format::text($Search));
     foreach ($ResultSet as &$Row) {
         $Row['Summary'] = SearchExcerpt(Gdn_Format::plainText($Row['Summary'], $Row['Format']), $SearchTerms);
         $Row['Summary'] = Emoji::instance()->translateToHtml($Row['Summary']);
         $Row['Format'] = 'Html';
     }
     $this->setData('SearchResults', $ResultSet, true);
     $this->setData('SearchTerm', Gdn_Format::text($Search), true);
     if ($ResultSet) {
         $NumResults = count($ResultSet);
     } else {
         $NumResults = 0;
     }
     if ($NumResults == $Offset + $Limit) {
         $NumResults++;
     }
     // Build a pager
     $PagerFactory = new Gdn_PagerFactory();
     $this->Pager = $PagerFactory->GetPager('MorePager', $this);
     $this->Pager->MoreCode = 'More Results';
     $this->Pager->LessCode = 'Previous Results';
     $this->Pager->ClientID = 'Pager';
     $this->Pager->configure($Offset, $Limit, $NumResults, 'dashboard/search/%1$s/%2$s/?Search=' . Gdn_Format::url($Search));
     //		if ($this->_DeliveryType != DELIVERY_TYPE_ALL) {
     //         $this->setJson('LessRow', $this->Pager->toString('less'));
     //         $this->setJson('MoreRow', $this->Pager->toString('more'));
     //         $this->View = 'results';
     //      }
     $this->canonicalUrl(url('search', true));
     $this->render();
 }
开发者ID:karanjitsingh,项目名称:iecse-forum,代码行数:63,代码来源:class.searchcontroller.php


示例18: smarty_function_forum_root_link

/**
 * Takes a route and prepends the web root (expects "/controller/action/params" as $Path).
 *
 * @param array The parameters passed into the function.
 * The parameters that can be passed to this function are as follows.
 * - <b>path</b>: The relative path for the url. There are some special paths that can be used to return "intelligent" links:
 *    - <b>signinout</b>: This will return a signin/signout url that will toggle depending on whether or not the user is already signed in. When this path is given the text is automaticall set.
 * - <b>withdomain</b>: Whether or not to add the domain to the url.
 * - <b>text</b>: Html text to be put inside an anchor. If this value is set then an html <a></a> is returned rather than just a url.
 * - <b>id, class, etc.></b>: When an anchor is generated then any other attributes are passed through and will be written in the resulting tag.
 * @param Smarty The smarty object rendering the template.
 * @return The url.
 */
function smarty_function_forum_root_link($Params, &$Smarty)
{
    $Text = GetValue('text', $Params, '', TRUE);
    $Format = GetValue('format', $Params, '<li><a href="%url" class="%class">%text</a></li>');
    $Options = array();
    if (isset($Params['class'])) {
        $Options['class'] = $Params['class'];
    }
    $Result = Gdn_Theme::Link('forumroot', $Text, $Format, $Options);
    return $Result;
}
开发者ID:edward-tsai,项目名称:vanilla4china,代码行数:24,代码来源:function.forum_root_link.php


示例19: Initialize

 /**
  * Make this look like a dashboard page and add the resources
  *
  * @since 1.0
  * @access public
  */
 public function Initialize()
 {
     parent::Initialize();
     $this->Application = 'Yaga';
     Gdn_Theme::Section('Dashboard');
     if ($this->Menu) {
         $this->Menu->HighlightRoute('/rank');
     }
     $this->AddJsFile('jquery-ui-1.10.0.custom.min.js');
     $this->AddJsFile('admin.ranks.js');
 }
开发者ID:hxii,项目名称:Application-Yaga,代码行数:17,代码来源:class.rankcontroller.php


示例20: Initialize

 /**
  * Make this look like a dashboard page and add the resources
  *
  * @since 1.0
  * @access public
  */
 public function Initialize()
 {
     parent::Initialize();
     $this->Application = 'Yaga';
     Gdn_Theme::Section('Dashboard');
     if ($this->Menu) {
         $this->Menu->HighlightRoute('/badge');
     }
     $this->AddJsFile('admin.badges.js');
     $this->AddCssFile('badges.css');
 }
开发者ID:hxii,项目名称:Application-Yaga,代码行数:17,代码来源:class.badgecontroller.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP Gdn_Upload类代码示例发布时间:2022-05-23
下一篇:
PHP Gdn_Pluggable类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap