Esempio n. 1
0
 /**
  * Set template var options for page link location menus
  *
  * @param int $page_id Page identifier
  * @param array $current Currently selected link locations (from the form data)
  * @return null
  * @access protected
  */
 protected function create_page_link_options($page_id = 0, $current = array())
 {
     // Get all page links assigned to the page (if it's being edited)
     if ($page_id && empty($current)) {
         $page_links = $this->page_operator->get_page_links(array($page_id));
         foreach ($page_links as $page_link) {
             $current[] = $page_link['page_link_id'];
         }
     }
     // Get all link location names and identifiers
     $link_locations = $this->page_operator->get_link_locations();
     // Set the options list template vars
     foreach ($link_locations as $link) {
         $this->template->assign_block_vars('page_link_options', array('VALUE' => $link['page_link_id'], 'LABEL' => $this->user->lang($link['page_link_location']), 'S_SELECTED' => in_array($link['page_link_id'], $current)));
     }
 }
Esempio n. 2
0
 /**
  * Show users as viewing Pages on Who Is Online page
  *
  * @param object $event The event object
  * @return null
  * @access public
  */
 public function viewonline_page($event)
 {
     // Are any users on app.php?
     if ($event['on_page'][1] == 'app') {
         // Load our language file
         $this->user->add_lang_ext('phpbb/pages', 'pages_common');
         // Load our page routes and titles
         $routes = $this->page_operator->get_page_routes();
         // If any of our pages are being viewed, update the event vars with our routes and titles
         foreach ($routes as $route => $page_title) {
             if ($event['row']['session_page'] == 'app.' . $this->php_ext . '/page/' . $route) {
                 $event['location'] = $this->user->lang('PAGES_VIEWONLINE', $page_title);
                 $event['location_url'] = $this->helper->route('phpbb_pages_main_controller', array('route' => $route));
                 break;
             }
         }
     }
 }