Agora::setAgoraId PHP Метод

setAgoraId() публичный Метод

Creates the Agora id.
public setAgoraId ( $forum_id, $message_id, $url = '', $scope = null, $encode = false ) : string
Результат string If passed with the $url parameter, returns a completed url with the agora_id tacked on at the end, otherwise returns the simple agora_id.
    function setAgoraId($forum_id, $message_id, $url = '', $scope = null, $encode = false)
    {
        $agora_id = $forum_id . '.' . $message_id;
        if (!empty($url)) {
            if ($scope) {
                $url = Horde::url($url)->add('scope', $scope)->setRaw(!$encode);
            } else {
                $url = Horde::url($url)->add('scope', Horde_Util::getGet('scope', 'agora'))->setRaw(!$encode);
            }
            return $url->add('agora', $agora_id);
        }
        return $agora_id;
    }

Usage Example

Пример #1
0
 /**
  */
 public function menu($menu)
 {
     $scope = Horde_Util::getGet('scope', 'agora');
     /* Agora Home. */
     $url = Horde::url('forums.php')->add('scope', $scope);
     $menu->add($url, _("_Forums"), 'forums.png', null, null, null, dirname($_SERVER['PHP_SELF']) == $GLOBALS['registry']->get('webroot') && basename($_SERVER['PHP_SELF']) == 'index.php' ? 'current' : null);
     /* Thread list, if applicable. */
     if (isset($GLOBALS['forum_id'])) {
         $menu->add(Agora::setAgoraId($GLOBALS['forum_id'], null, Horde::url('threads.php')), _("_Threads"), 'threads.png');
         if ($scope == 'agora' && $GLOBALS['registry']->getAuth()) {
             $menu->add(Agora::setAgoraId($GLOBALS['forum_id'], null, Horde::url('messages/edit.php')), _("New Thread"), 'newmessage.png');
         }
     }
     if ($scope == 'agora' && Agora_Driver::hasPermission(Horde_Perms::DELETE, 0, $scope)) {
         $menu->add(Horde::url('editforum.php'), _("_New Forum"), 'newforum.png', null, null, null, Horde_Util::getFormData('agora') ? '__noselection' : null);
     }
     if (Agora_Driver::hasPermission(Horde_Perms::DELETE, 0, $scope)) {
         $url = Horde::url('moderate.php')->add('scope', $scope);
         $menu->add($url, _("_Moderate"), 'moderate.png');
     }
     if ($GLOBALS['registry']->isAdmin()) {
         $menu->add(Horde::url('moderators.php'), _("_Moderators"), 'hot.png');
     }
     $url = Horde::url('search.php')->add('scope', $scope);
     $menu->add($url, _("_Search"), 'search.png');
 }
All Usage Examples Of Agora::setAgoraId