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


PHP Gdn_Module::toString方法代码示例

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


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

示例1: toString

 public function toString()
 {
     if (is_object($this->Data) && $this->Data->numRows() > 0) {
         return parent::toString();
     }
     return '';
 }
开发者ID:caidongyun,项目名称:vanilla,代码行数:7,代码来源:class.inthisconversationmodule.php

示例2: toString

 /**
  * Render the module.
  *
  * @return string HTML.
  */
 public function toString()
 {
     // Verify any participants exist before outputting anything.
     if (count($this->data('Participants'))) {
         return parent::toString();
     }
     return '';
 }
开发者ID:R-J,项目名称:vanilla,代码行数:13,代码来源:class.inthisconversationmodule.php

示例3: toString

 public function toString()
 {
     if (!Gdn::session()->isValid()) {
         return '';
     }
     if (!$this->data('Conversations')) {
         $this->getData();
     }
     return parent::toString();
 }
开发者ID:austins,项目名称:vanilla,代码行数:10,代码来源:class.inboxmodule.php

示例4: toString

 /**
  * Render the module.
  *
  * @return string Rendered HTML.
  */
 public function toString()
 {
     // Simplify our permission logic
     $ConversationExists = is_object($this->Conversation) && $this->Conversation->ConversationID > 0;
     $CanAddUsers = $this->AddUserAllowed && checkPermission('Conversations.Conversations.Add');
     if ($ConversationExists && $CanAddUsers) {
         return parent::toString();
     }
     return '';
 }
开发者ID:caidongyun,项目名称:vanilla,代码行数:15,代码来源:class.addpeoplemodule.php

示例5: toString

 public function toString()
 {
     if (!Gdn::session()->checkPermission('Garden.Activity.View')) {
         return '';
     }
     if (stringIsNullOrEmpty($this->ActivityModuleTitle)) {
         $this->ActivityModuleTitle = t('Recent Activity');
     }
     if (!$this->ActivityData) {
         $this->getData();
     }
     $Data = $this->ActivityData;
     if (is_object($Data) && $Data->numRows() > 0) {
         return parent::toString();
     }
     return '';
 }
开发者ID:R-J,项目名称:vanilla,代码行数:17,代码来源:class.recentactivitymodule.php

示例6: toString

 /**
  * Render the module.
  *
  * @return string
  */
 public function toString()
 {
     // Set CategoryID if we have one.
     if ($this->CategoryID === null) {
         $this->CategoryID = Gdn::controller()->data('Category.CategoryID', false);
     }
     // Allow plugins and themes to modify parameters.
     Gdn::controller()->EventArguments['NewDiscussionModule'] =& $this;
     Gdn::controller()->fireEvent('BeforeNewDiscussionButton');
     // Make sure the user has the most basic of permissions first.
     $PermissionCategory = CategoryModel::permissionCategory($this->CategoryID);
     if ($this->CategoryID) {
         $Category = CategoryModel::categories($this->CategoryID);
         $HasPermission = Gdn::session()->checkPermission('Vanilla.Discussions.Add', true, 'Category', val('CategoryID', $PermissionCategory));
     } else {
         $HasPermission = Gdn::session()->checkPermission('Vanilla.Discussions.Add', true, 'Category', 'any');
     }
     // Determine if this is a guest & we're using "New Discussion" button as call to action.
     $PrivilegedGuest = $this->ShowGuests && !Gdn::session()->isValid();
     // No module for you!
     if (!$HasPermission && !$PrivilegedGuest) {
         return '';
     }
     // Grab the allowed discussion types.
     $DiscussionTypes = CategoryModel::allowedDiscussionTypes($PermissionCategory);
     foreach ($DiscussionTypes as $Key => $Type) {
         if (isset($Type['AddPermission']) && !Gdn::session()->checkPermission($Type['AddPermission'])) {
             unset($DiscussionTypes[$Key]);
             continue;
         }
         $Url = val('AddUrl', $Type);
         if (!$Url) {
             continue;
         }
         if (isset($Category)) {
             $Url .= '/' . rawurlencode(val('UrlCode', $Category));
         }
         // Present a signin redirect for a $PrivilegedGuest.
         if (!$HasPermission) {
             $Url = $this->GuestUrl . '?Target=' . $Url;
         }
         $this->addButton(t(val('AddText', $Type)), $Url);
     }
     // Add QueryString to URL if one is defined.
     if ($this->QueryString && $HasPermission) {
         foreach ($this->Buttons as &$Row) {
             $Row['Url'] .= (strpos($Row['Url'], '?') !== false ? '&' : '?') . $this->QueryString;
         }
     }
     return parent::toString();
 }
开发者ID:sitexa,项目名称:vanilla,代码行数:56,代码来源:class.newdiscussionmodule.php

示例7: toString

 public function toString()
 {
     $this->fireAs(get_called_class())->fireEvent('render');
     return parent::toString();
 }
开发者ID:vanilla,项目名称:vanilla,代码行数:5,代码来源:class.navmodule.php

示例8: toString

 /**
  * Returns the component as a string to be rendered to the screen.
  *
  * @return string
  */
 public function toString()
 {
     // Setup
     $this->setData('Categories', $this->getChildren());
     $this->setData('Layout', c('Vanilla.Categories.Layout', 'modern'));
     $this->setData('ParentCategory', $this->getCategory());
     // If our category isn't valid, or we have no child categories to display, then display nothing.
     if (!$this->data('ParentCategory') || !$this->data('Categories')) {
         return '';
     }
     // Vanilla's category helper functions are beneficial in creating markdown in the views.
     require_once Gdn::controller()->fetchViewLocation('helper_functions', 'categories', 'vanilla');
     return parent::toString();
 }
开发者ID:vanilla,项目名称:vanilla,代码行数:19,代码来源:class.flatcategorymodule.php


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