includes/template.php
changeset 1274 673a1b6712fa
parent 1227 bdac73ed481e
child 1302 b48d2de63007
equal deleted inserted replaced
1273:3351055b467e 1274:673a1b6712fa
   415  	* @param string Namespace; not required if including a PageProcessor.
   415  	* @param string Namespace; not required if including a PageProcessor.
   416  	*/
   416  	*/
   417 	
   417 	
   418 	function set_page($page_id_or_pp, $namespace = false)
   418 	function set_page($page_id_or_pp, $namespace = false)
   419 	{
   419 	{
       
   420 		global $paths;
       
   421 		
   420 		if ( is_object($page_id_or_pp) && get_class($page_id_or_pp) === 'PageProcessor' )
   422 		if ( is_object($page_id_or_pp) && get_class($page_id_or_pp) === 'PageProcessor' )
   421 		{
   423 		{
   422 			$this->page_initted = false;
   424 			$this->page_initted = false;
   423 			$page =& $page_id_or_pp;
   425 			$page =& $page_id_or_pp;
   424 			$this->page = $page;
   426 			$this->page = $page;
   440 		}
   442 		}
   441 		else
   443 		else
   442 		{
   444 		{
   443 			return false;
   445 			return false;
   444 		}
   446 		}
       
   447 		$this->assign_vars(array(
       
   448 				'PAGE_URLNAME' => $paths->get_pathskey($this->page_id, $this->namespace)
       
   449 			));
   445 		return true;
   450 		return true;
   446 	}
   451 	}
   447 	
   452 	
   448 	/**
   453 	/**
   449  	* Queue a Javascript file to be loaded with the page instead of on demand.
   454  	* Queue a Javascript file to be loaded with the page instead of on demand.
   697 				'TEXT'=>$lang->get('sidebar_btn_administration'),
   702 				'TEXT'=>$lang->get('sidebar_btn_administration'),
   698 			));
   703 			));
   699 		
   704 		
   700 		$admin_link = $parser->run();
   705 		$admin_link = $parser->run();
   701 		
   706 		
   702 		$parser->assign_vars(Array(
   707 		// We're leaving this in for now, just blanked out, to avoid compatibility issues.
   703 				'HREF'=>makeUrlNS('Special', 'EditSidebar'),
   708 		$sidebar_link = '';
   704 				'FLAGS'=>'onclick="if ( !KILL_SWITCH ) { void(ajaxLoginNavTo(\'Special\', \'EditSidebar\', ' . USER_LEVEL_ADMIN . ')); return false; }"',
       
   705 				'TEXT'=>$lang->get('sidebar_btn_editsidebar'),
       
   706 			));
       
   707 		
       
   708 		$sidebar_link = $parser->run();
       
   709 		
   709 		
   710 		$this->assign_vars(array(
   710 		$this->assign_vars(array(
   711 				'ADMIN_LINK' => $admin_link,
   711 				'ADMIN_LINK' => $admin_link,
   712 				'SIDEBAR_LINK' => $sidebar_link,
   712 				'SIDEBAR_LINK' => $sidebar_link,
   713 				'THEME_ID' => $this->theme,
   713 				'THEME_ID' => $this->theme,
  2828 	function __construct($text)
  2828 	function __construct($text)
  2829 	{
  2829 	{
  2830 		global $db, $session, $paths, $template, $plugins; // Common objects
  2830 		global $db, $session, $paths, $template, $plugins; // Common objects
  2831 		$this->tpl_code = $text;
  2831 		$this->tpl_code = $text;
  2832 		$this->tpl_strings = $template->tpl_strings;
  2832 		$this->tpl_strings = $template->tpl_strings;
       
  2833 		// echo 'templateIndividual init. Using strings: <pre>' . htmlspecialchars(print_r($this->tpl_strings, true)) . '</pre>';
  2833 		$this->tpl_bool = $template->tpl_bool;
  2834 		$this->tpl_bool = $template->tpl_bool;
  2834 	}
  2835 	}
  2835 	/**
  2836 	/**
  2836  	* PHP 4 constructor. Deprecated in 1.1.x.
  2837  	* PHP 4 constructor. Deprecated in 1.1.x.
  2837  	*/
  2838  	*/