コード例 #1
0
ファイル: display.php プロジェクト: Sajaki/customisation-db
 /**
  * Assign global template variables
  *
  * @return null
  */
 public function assign_global_vars()
 {
     $this->generate_breadcrumbs(array('CUSTOMISATION_DATABASE' => $this->controller_helper->route('phpbb.titania.index')));
     $u_my_contribs = $u_manage = false;
     if ($this->user->data['is_registered'] && !$this->user->data['is_bot']) {
         $u_my_contribs = $this->controller_helper->route('phpbb.titania.author', array('author' => urlencode($this->user->data['username_clean']), 'page' => 'contributions'));
     }
     $manageable_types = $this->types->find_authed();
     if (!empty($manageable_types) || $this->auth->acl_get('u_titania_mod_contrib_mod') || $this->auth->acl_get('u_titania_mod_post_mod')) {
         $u_manage = $this->controller_helper->route('phpbb.titania.manage');
     }
     $web_root_path = $this->path_helper->get_web_root_path();
     $style_path = $web_root_path . 'ext/phpbb/titania/styles/' . rawurlencode($this->user->style['style_path']) . '/';
     $this->template->assign_vars(array('T_TITANIA_TEMPLATE_PATH' => $style_path . 'template', 'T_TITANIA_THEME_PATH' => $style_path . 'theme', 'T_TITANIA_IMAGES_PATH' => $web_root_path . 'images', 'T_TITANIA_ASSETS_PATH' => $web_root_path . 'ext/phpbb/titania/assets', 'TITANIA_ROOT_PATH' => $web_root_path, 'U_MANAGE' => $u_manage, 'U_MY_CONTRIBUTIONS' => $u_my_contribs, 'U_ALL_SUPPORT' => $this->controller_helper->route('phpbb.titania.support'), 'U_TITANIA_INDEX' => $this->controller_helper->route('phpbb.titania.index'), 'U_TITANIA_FAQ' => $this->controller_helper->route('phpbb.titania.faq'), 'S_IN_TITANIA' => true));
 }
コード例 #2
0
ファイル: post.php プロジェクト: Sajaki/customisation-db
 /**
  * Assign details
  *
  * A little different from those in other classes, this one only returns the info ready for output
  */
 public function assign_details($output_text = true)
 {
     $details = array('POST_ID' => $this->post_id, 'TOPIC_ID' => $this->topic_id, 'POST_TYPE' => $this->post_type, 'POST_ACCESS' => $this->post_access, 'POST_LOCKED' => $this->post_locked, 'POST_ATTACHMENT' => $this->post_attachment, 'POST_USER_ID' => $this->post_user_id, 'POST_IP' => phpbb::$auth->acl_get('u_titania_mod_post_mod') ? $this->post_ip : false, 'POST_TIME' => phpbb::$user->format_date($this->post_time), 'POST_EDIT_REASON' => censor_text($this->post_edit_reason), 'POST_SUBJECT' => censor_text($this->post_subject), 'POST_TEXT' => $output_text ? $this->generate_text_for_display() : '', 'EDITED_MESSAGE' => $this->post_edited ? sprintf(phpbb::$user->lang['EDITED_MESSAGE'], users_overlord::get_user($this->post_edit_user, '_full'), phpbb::$user->format_date($this->post_edited)) : '', 'DELETED_MESSAGE' => $this->post_deleted != 0 ? sprintf(phpbb::$user->lang['DELETED_MESSAGE'], users_overlord::get_user($this->post_delete_user, '_full'), phpbb::$user->format_date($this->post_deleted), $this->get_url('undelete')) : '', 'U_VIEW' => $this->get_url(), 'U_EDIT' => $this->acl_get('edit') ? $this->get_url('edit') : '', 'U_QUICKEDIT' => $this->acl_get('edit') ? $this->get_url('quick_edit') : '', 'U_DELETE' => $this->acl_get('delete') && (!$this->post_deleted || phpbb::$auth->acl_get('u_titania_post_hard_delete')) ? $this->get_url('delete') : '', 'U_REPORT' => phpbb::$user->data['is_registered'] ? $this->get_url('report') : '', 'U_WARN' => false, 'U_INFO' => phpbb::$auth->acl_gets('u_titania_mod_author_mod', 'u_titania_mod_contrib_mod', 'u_titania_mod_faq_mod', 'u_titania_mod_post_mod') || $this->types->find_authed('moderate') ? $this->controller_helper->route('phpbb.titania.manage.attention.redirect', array('type' => TITANIA_POST, 'id' => $this->post_id)) : '', 'U_QUOTE' => $this->acl_get('post') ? $this->get_url('quote') : '', 'S_UNREAD_POST' => $this->unread ? true : false, 'S_POST_APPROVED' => phpbb::$auth->acl_get('u_titania_mod_post_mod') ? $this->post_approved : true, 'S_POST_REPORTED' => phpbb::$auth->acl_get('u_titania_mod_post_mod') ? $this->post_reported : false, 'S_POST_DELETED' => $this->post_deleted != 0 ? true : false, 'S_ACCESS_TEAMS' => $this->access->is_team($this->post_access), 'S_ACCESS_AUTHORS' => $this->access->is_author($this->post_access));
     // Hooks
     titania::$hook->call_hook_ref(array(__CLASS__, __FUNCTION__), $details, $this);
     return $details;
 }
コード例 #3
0
ファイル: base.php プロジェクト: Sajaki/customisation-db
 /**
  * Get navigation tab options.
  *
  * @return array
  */
 protected function get_navigation_options()
 {
     /**
      * Menu Array
      *
      * 'filename' => array(
      *	'title'		=> 'nav menu title',
      * 	'url'		=> $page_url,
      *	'auth'		=> ($can_see_page) ? true : false, // Not required, always true if missing
      * ),
      */
     return array('attention' => array('title' => 'ATTENTION', 'url' => $this->helper->route('phpbb.titania.manage.attention'), 'auth' => $this->auth->acl_gets('u_titania_mod_author_mod', 'u_titania_mod_contrib_mod', 'u_titania_mod_faq_mod', 'u_titania_mod_post_mod') || $this->types->find_authed('moderate'), 'count' => $this->get_open_attention_count()), 'queue' => array('title' => 'VALIDATION_QUEUE', 'url' => $this->helper->route('phpbb.titania.queue'), 'auth' => $this->types->find_authed('view') && $this->ext_config->use_queue), 'queue_discussion' => array('title' => 'QUEUE_DISCUSSION', 'url' => $this->helper->route('phpbb.titania.queue_discussion'), 'auth' => $this->types->find_authed('queue_discussion') && $this->ext_config->use_queue), 'administration' => array('title' => 'ADMINISTRATION', 'url' => $this->helper->route('phpbb.titania.administration'), 'auth' => $this->auth->acl_get('u_titania_admin'), 'match' => array('categories')), 'categories' => array('title' => 'MANAGE_CATEGORIES', 'url' => $this->helper->route('phpbb.titania.manage.categories'), 'auth' => $this->auth->acl_get('u_titania_admin'), 'display' => false));
 }
コード例 #4
0
ファイル: search.php プロジェクト: Sajaki/customisation-db
 /**
  * Generate query for searching all content.
  *
  * @return null
  */
 protected function generate_search_all_query()
 {
     $contrib_types = $this->types->get_ids();
     $restrictions = array(TITANIA_SUPPORT => $contrib_types, TITANIA_CONTRIB => $contrib_types, TITANIA_FAQ => $contrib_types);
     // Enforce permissions on the results to ensure that we don't leak posts to users who don't have access to the originating queues.
     $access_queue_discussion = $this->types->find_authed('queue_discussion');
     $access_validation_queue = $this->types->find_authed('view');
     if (!empty($access_validation_queue)) {
         $restrictions[TITANIA_QUEUE] = $access_validation_queue;
     }
     if (!empty($access_queue_discussion)) {
         $restrictions[TITANIA_QUEUE_DISCUSSION] = $access_queue_discussion;
     }
     $this->engine->set_granular_type_restrictions($restrictions);
 }