Provides basic functionality when extended by real modules.
Since: 2.0
Author: Mark O'Sullivan (markm@vanillaforums.com)
Author: Todd Burry (todd@vanillaforums.com)
Inheritance: extends Gdn_Pluggable, implements Gdn_IModule
 public function ToString()
 {
     if (is_object($this->Conversation) && $this->Conversation->ConversationID > 0) {
         return parent::ToString();
     }
     return '';
 }
 public function toString()
 {
     if (!$this->data('DiscussionEvents')) {
         $this->getData($this->Limit);
     }
     return parent::ToString();
 }
 public function ToString()
 {
     if (!Gdn::Session()->IsValid() && C('Garden.Modules.ShowGuestModule')) {
         return parent::ToString();
     }
     return '';
 }
 public function ToString()
 {
     if (is_object($this->User)) {
         return parent::ToString();
     }
     return '';
 }
 public function __construct(&$Sender = '')
 {
     $this->HtmlId = 'SideMenu';
     $this->AutoLinkGroups = TRUE;
     $this->ClearGroups();
     parent::__construct($Sender);
 }
 public function ToString()
 {
     if ($this->_ActivityData !== FALSE && $this->_ActivityData->NumRows() > 0) {
         return parent::ToString();
     }
     return '';
 }
 public function ToString()
 {
     $Session = Gdn::Session();
     $Controller = Gdn::Controller();
     $UserID = $Controller->User->UserID;
     $MemberOptions = array();
     $ProfileOptions = array();
     $Controller->EventArguments['UserID'] = $UserID;
     $Controller->EventArguments['ProfileOptions'] =& $ProfileOptions;
     $Controller->EventArguments['MemberOptions'] =& $MemberOptions;
     if ($Controller->EditMode) {
         return '<div class="ProfileOptions">' . Anchor(T('Back to Profile'), UserUrl($Controller->User), array('class' => 'ProfileButtons')) . '</div>';
         //         $ProfileOptions[] = array('Text' => T('Back to Profile'), 'Url' => UserUrl($Controller->User), 'CssClass' => 'BackToProfile');
     } else {
         // Profile Editing
         if (hasEditProfile($Controller->User->UserID)) {
             $ProfileOptions[] = array('Text' => Sprite('SpEditProfile') . ' ' . T('Edit Profile'), 'Url' => UserUrl($Controller->User, '', 'edit'));
         }
         // Ban/Unban
         $MayBan = CheckPermission('Garden.Moderation.Manage') || CheckPermission('Garden.Users.Edit') || CheckPermission('Moderation.Users.Ban');
         if ($MayBan && $UserID != $Session->UserID) {
             if ($Controller->User->Banned) {
                 $ProfileOptions[] = array('Text' => Sprite('SpBan') . ' ' . T('Unban'), 'Url' => "/user/ban?userid={$UserID}&unban=1", 'CssClass' => 'Popup');
             } elseif (!$Controller->User->Admin) {
                 $ProfileOptions[] = array('Text' => Sprite('SpBan') . ' ' . T('Ban'), 'Url' => "/user/ban?userid={$UserID}", 'CssClass' => 'Popup');
             }
         }
         // Delete content.
         if (CheckPermission('Garden.Moderation.Manage')) {
             $ProfileOptions[] = array('Text' => Sprite('SpDelete') . ' ' . T('Delete Content'), 'Url' => "/user/deletecontent?userid={$UserID}", 'CssClass' => 'Popup');
         }
     }
     return parent::ToString();
 }
 public function ToString()
 {
     if (!Gdn::Session()->IsValid()) {
         return parent::ToString();
     }
     return '';
 }
 public function toString()
 {
     $Form = $this->_Sender->Form;
     $this->_Sender->addJsFile('condition.js');
     if ($Form->authenticatedPostBack()) {
         // Grab the conditions from the form and convert them to the conditions array.
         $this->Conditions($this->_FromForm());
     } else {
     }
     $this->Types = array_merge(array('' => '(' . sprintf(t('Select a %s'), t('Condition Type', 'Type')) . ')'), Gdn_Condition::AllTypes());
     //die(print_r($this->Types));
     // Get all of the permissions that are valid for the permissions dropdown.
     $PermissionModel = new PermissionModel();
     $Permissions = $PermissionModel->GetGlobalPermissions(0);
     $Permissions = array_keys($Permissions);
     sort($Permissions);
     $Permissions = array_combine($Permissions, $Permissions);
     $Permissions = array_merge(array('' => '(' . sprintf(t('Select a %s'), t('Permission')) . ')'), $Permissions);
     $this->Permissions = $Permissions;
     // Get all of the roles.
     $RoleModel = new RoleModel();
     $Roles = $RoleModel->getArray();
     $Roles = array_merge(array('-' => '(' . sprintf(t('Select a %s'), t('Role')) . ')'), $Roles);
     $this->Roles = $Roles;
     $this->Form = $Form;
     return parent::ToString();
 }
 public function ToString()
 {
     if (Gdn::Config('Vanilla.Categories.Use') == TRUE) {
         return parent::ToString();
     }
     return '';
 }
 public function ToString()
 {
     if (isset($this->Data) && is_object($this->Data) && $this->Data->NumRows() > 0) {
         return parent::ToString();
     }
     return '';
 }
 public function toString()
 {
     if (is_object($this->Data) && $this->Data->numRows() > 0) {
         return parent::toString();
     }
     return '';
 }
 public function ToString()
 {
     if ($this->Data) {
         return parent::ToString();
     }
     return '';
 }
 public function toString()
 {
     if (Gdn::session()->isValid()) {
         return parent::ToString();
     }
     return '';
 }
 public function toString()
 {
     if (is_array($this->ModeratorData) && count($this->ModeratorData) > 0 && is_array($this->ModeratorData[0]->Moderators) && count($this->ModeratorData[0]->Moderators) > 0) {
         return parent::ToString();
     }
     return '';
 }
 public function __construct($Sender = '')
 {
     $this->_TagData = FALSE;
     $this->ParentID = NULL;
     $this->ParentType = 'Global';
     $this->CategorySearch = C('Plugins.Tagging.CategorySearch', FALSE);
     parent::__construct($Sender);
 }
Exemple #17
0
 /**
  * @param string $Sender
  */
 public function __construct($Sender = '')
 {
     $this->_TagData = false;
     $this->ParentID = null;
     $this->ParentType = 'Global';
     $this->CategorySearch = c('Plugins.Tagging.CategorySearch', false);
     parent::__construct($Sender);
 }
 public function ToString()
 {
     $Data = $this->_Sender->Data['RecentUserData'];
     if ($Data !== FALSE && $Data->NumRows() > 0) {
         return parent::ToString();
     }
     return '';
 }
 public function __construct($Sender = '') {
    $this->_Tags = array();
    $this->_Strings = array();
    $this->_Title = '';
    $this->_SubTitle = '';
    $this->_TitleDivider = '';
    parent::__construct($Sender);
 }
 public function ToString()
 {
     $Session = Gdn::Session();
     if ($Session->IsValid()) {
         return parent::ToString();
     }
     return '';
 }
 public function ToString()
 {
     if (!$this->Data('Discussions')) {
         $this->GetData();
     }
     require_once Gdn::Controller()->FetchViewLocation('helper_functions', 'Discussions', 'Vanilla');
     return parent::ToString();
 }
 /**
  * @param Gdn_Controller $Controller The controller using this model.
  */
 public function __construct($Sender)
 {
     parent::__construct($Sender);
     if (property_exists($Sender, 'Form')) {
         $this->Form($Sender->Form);
     }
     $this->ConfigurationModule = $this;
 }
 public function ToString()
 {
     $String = '';
     if ($this->CheckPermission()) {
         $String = parent::ToString();
     }
     return $String;
 }
 /**
  * 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 '';
 }
 public function toString()
 {
     if (!$this->Data) {
         $this->GetData();
     }
     $this->filterDepth($this->Data->result(), $this->startDepth, $this->endDepth);
     return parent::ToString();
 }
 public function ToString()
 {
     $String = '';
     $Sections = $this->Data('Items');
     if ($Sections && (is_array($Sections) && count($Sections) > 0) || $Sections instanceof Gdn_DataSet && $Sections->NumRows() > 0) {
         $String = parent::ToString();
     }
     return $String;
 }
 /**
  * @param int $categoryID The ID of the category we're in.
  * @param string $selectedSort The selected sort.
  * @param array $selectedFilters The selected filters.
  */
 public function __construct($categoryID = 0, $selectedSort = '', $selectedFilters = [])
 {
     parent::__construct();
     if ($categoryID) {
         $this->categoryID = $categoryID;
     }
     $this->selectedSort = $selectedSort;
     $this->selectedFilters = $selectedFilters;
 }
 public function ToString() {
    if (!isset($this->Data))
       $this->GetData();
    
    if (is_object($this->Data) && $this->Data->NumRows() > 0)
       return parent::ToString();
    
    return '';
 }
Exemple #29
0
 public function toString()
 {
     if (!Gdn::session()->isValid()) {
         return '';
     }
     if (!$this->data('Conversations')) {
         $this->getData();
     }
     return parent::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 '';
 }