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


PHP Gdn_Controller::permission方法代码示例

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


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

示例1: settingsController_vanillicon_create

 /**
  * The settings page for vanillicon.
  *
  * @param Gdn_Controller $sender
  */
 public function settingsController_vanillicon_create($sender)
 {
     $sender->permission('Garden.Settings.Manage');
     $cf = new ConfigurationModule($sender);
     $items = array('v1' => 'Vanillicon 1', 'v2' => 'Vanillicon 2');
     $cf->initialize(array('Plugins.Vanillicon.Type' => array('LabelCode' => 'Vanillicon Set', 'Control' => 'radiolist', 'Description' => 'Which vanillicon set do you want to use?', 'Items' => $items, 'Options' => array('display' => 'after'), 'Default' => 'v1')));
     $sender->setData('Title', sprintf(t('%s Settings'), 'Vanillicon'));
     $cf->renderAll();
 }
开发者ID:vanilla,项目名称:vanilla,代码行数:14,代码来源:class.vanillicon.plugin.php

示例2: controller_delete

 /**
  * Delete a Tag
  *
  * @param Gdn_Controller $Sender
  */
 public function controller_delete($Sender)
 {
     $Sender->permission('Garden.Settings.Manage');
     $TagID = val(1, $Sender->RequestArgs);
     $TagModel = new TagModel();
     $Tag = $TagModel->getID($TagID, DATASET_TYPE_ARRAY);
     if ($Sender->Form->authenticatedPostBack()) {
         // Delete tag & tag relations.
         $SQL = Gdn::sql();
         $SQL->delete('TagDiscussion', array('TagID' => $TagID));
         $SQL->delete('Tag', array('TagID' => $TagID));
         $Sender->informMessage(formatString(t('<b>{Name}</b> deleted.'), $Tag));
         $Sender->jsonTarget("#Tag_{$Tag['TagID']}", null, 'Remove');
     }
     $Sender->setData('Title', t('Delete Tag'));
     $Sender->render('delete', '', 'plugins/Tagging');
 }
开发者ID:caidongyun,项目名称:vanilla,代码行数:22,代码来源:class.tagging.plugin.php

示例3: settingsController_vanillicon_create

 /**
  * The settings page for vanillicon.
  *
  * @param Gdn_Controller $sender
  */
 public function settingsController_vanillicon_create($sender)
 {
     $sender->permission('Garden.Settings.Manage');
     $cf = new ConfigurationModule($sender);
     $items = array('v1' => 'Vanillicon 1', 'v2' => 'Vanillicon 2 (beta)');
     $cachePath = self::getCachePath();
     $writable = is_writable($cachePath);
     $txtNotWritable = '<p style="color: #c00;">' . T('<b>Warning:</b> the cache directory is not writable. If you want to use the cache mechanism, you have to enable write permissions for') . '</p><code>' . $cachePath . '</code><br><br><br>';
     $txtProxyActive = '<p style="color: #090;">' . T('<b>Congratulations: The privacy of your users is respected!</b> All requests to vanillicon.com are made by your server and not by your users.') . '</p><br>';
     $cf->initialize(array('Plugins.Vanillicon.Type' => array('LabelCode' => 'Vanillicon Proxy', 'Control' => 'radiolist', 'Description' => $txtProxyActive . ($writable ? '' : $txtNotWritable) . ' ' . T('Which vanillicon set do you want to use?'), 'Items' => $items, 'Options' => array('list' => true, 'listclass' => 'icon-list', 'display' => 'after'), 'Default' => 'v1')));
     $sender->addSideMenu();
     $sender->setData('Title', sprintf(t('%s Settings'), 'Vanillicon'));
     $cf->renderAll();
 }
开发者ID:korelstar,项目名称:vanilla-proxyvanillicon,代码行数:19,代码来源:class.proxyvanillicon.plugin.php


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