Ejemplo n.º 1
0
 public function __get($name)
 {
     if (isset($this->_rf[self::RF_NAMED_OBJECTS][$name])) {
         return $this->_rf[self::RF_NAMED_OBJECTS][$name];
     } else {
         return parent::__get($name);
     }
 }
Ejemplo n.º 2
0
 /**
  * Constructor.
  * @param TPage page that owns this client script manager
  */
 public function __construct(TPage $owner)
 {
     parent::__construct();
     $this->_page = $owner;
 }
Ejemplo n.º 3
0
 /**
  * Constructor.
  * @param TControl the control to which the adapter is attached
  */
 public function __construct($control)
 {
     parent::__construct();
     $this->_control = $control;
 }
Ejemplo n.º 4
0
 /**
  * Constructor.
  * @param string theme path
  * @param string theme URL
  * @throws TConfigurationException if theme path does not exist or any parsing error of the skin files
  */
 public function __construct($themePath, $themeUrl)
 {
     parent::__construct();
     $this->_themeUrl = $themeUrl;
     $this->_themePath = realpath($themePath);
     $this->_name = basename($themePath);
     $cacheValid = false;
     // TODO: the following needs to be cleaned up (Qiang)
     if (($cache = $this->getApplication()->getCache()) !== null) {
         $array = $cache->get(self::THEME_CACHE_PREFIX . $themePath);
         if (is_array($array)) {
             list($skins, $cssFiles, $jsFiles, $timestamp) = $array;
             if ($this->getApplication()->getMode() !== TApplicationMode::Performance) {
                 if (($dir = opendir($themePath)) === false) {
                     throw new TIOException('theme_path_inexistent', $themePath);
                 }
                 $cacheValid = true;
                 while (($file = readdir($dir)) !== false) {
                     if ($file === '.' || $file === '..') {
                         continue;
                     } else {
                         if (basename($file, '.css') !== $file) {
                             $this->_cssFiles[] = $themeUrl . '/' . $file;
                         } else {
                             if (basename($file, '.js') !== $file) {
                                 $this->_jsFiles[] = $themeUrl . '/' . $file;
                             } else {
                                 if (basename($file, self::SKIN_FILE_EXT) !== $file && filemtime($themePath . DIRECTORY_SEPARATOR . $file) > $timestamp) {
                                     $cacheValid = false;
                                     break;
                                 }
                             }
                         }
                     }
                 }
                 closedir($dir);
                 if ($cacheValid) {
                     $this->_skins = $skins;
                 }
             } else {
                 $cacheValid = true;
                 $this->_cssFiles = $cssFiles;
                 $this->_jsFiles = $jsFiles;
                 $this->_skins = $skins;
             }
         }
     }
     if (!$cacheValid) {
         $this->_cssFiles = array();
         $this->_jsFiles = array();
         $this->_skins = array();
         if (($dir = opendir($themePath)) === false) {
             throw new TIOException('theme_path_inexistent', $themePath);
         }
         while (($file = readdir($dir)) !== false) {
             if ($file === '.' || $file === '..') {
                 continue;
             } else {
                 if (basename($file, '.css') !== $file) {
                     $this->_cssFiles[] = $themeUrl . '/' . $file;
                 } else {
                     if (basename($file, '.js') !== $file) {
                         $this->_jsFiles[] = $themeUrl . '/' . $file;
                     } else {
                         if (basename($file, self::SKIN_FILE_EXT) !== $file) {
                             $template = new TTemplate(file_get_contents($themePath . '/' . $file), $themePath, $themePath . '/' . $file);
                             foreach ($template->getItems() as $skin) {
                                 if (!isset($skin[2])) {
                                     // a text string, ignored
                                     continue;
                                 } else {
                                     if ($skin[0] !== -1) {
                                         throw new TConfigurationException('theme_control_nested', $skin[1], dirname($themePath));
                                     }
                                 }
                                 $type = $skin[1];
                                 $id = isset($skin[2]['skinid']) ? $skin[2]['skinid'] : 0;
                                 unset($skin[2]['skinid']);
                                 if (isset($this->_skins[$type][$id])) {
                                     throw new TConfigurationException('theme_skinid_duplicated', $type, $id, dirname($themePath));
                                 }
                                 /*
                                 foreach($skin[2] as $name=>$value)
                                 {
                                 	if(is_array($value) && ($value[0]===TTemplate::CONFIG_DATABIND || $value[0]===TTemplate::CONFIG_PARAMETER))
                                 		throw new TConfigurationException('theme_databind_forbidden',dirname($themePath),$type,$id);
                                 }
                                 */
                                 $this->_skins[$type][$id] = $skin[2];
                             }
                         }
                     }
                 }
             }
         }
         closedir($dir);
         sort($this->_cssFiles);
         sort($this->_jsFiles);
         if ($cache !== null) {
             $cache->set(self::THEME_CACHE_PREFIX . $themePath, array($this->_skins, $this->_cssFiles, $this->_jsFiles, time()));
         }
     }
 }
Ejemplo n.º 5
0
 /**
  * Constructor.
  * @param ITextWriter a writer that THtmlWriter will pass its rendering result to
  */
 public function __construct($writer)
 {
     parent::__construct();
     $this->_writer = $writer;
 }
Ejemplo n.º 6
0
 /**
  * Constructor. Attach a response to be adapted.
  * @param THttpResponse the response object the adapter is to attach to.
  */
 public function __construct($response)
 {
     parent::__construct();
     $this->_response = $response;
 }
 /**
  * Constructor.
  */
 public function __construct()
 {
     parent::__construct();
     $this->_actions = new TList();
 }
Ejemplo n.º 8
0
 /**
  * @param string url to RPC server
  * @param boolean whether requests are considered to be notifications (completely ignoring the response) (default: false)
  */
 public function __construct($serverUrl, $isNotification = false)
 {
     parent::__construct();
     $this->_serverUrl = $serverUrl;
     $this->_isNotification = TPropertyValue::ensureBoolean($isNotification);
 }