Phundament-Components
[ class tree: Phundament-Components ] [ index: Phundament-Components ] [ all elements ]

Source for file LStyleSheetThemeChooser.php

Documentation is available at LStyleSheetThemeChooser.php

  1. <?php
  2.  
  3.  
  4. /**
  5.  * LStaticHtmlBrick class file.
  6.  *
  7.  * @license http://opensource.org/licenses/mozilla1.1.php Mozilla Public License
  8.  * @copyright 2005, diemeisterei GmbH. All rights reserved.
  9.  * @author $Author: schmunk $
  10.  * @version $Revision: 197 $  $Date: 2006-05-11 21:50:24 +0000 (Do, 11 Mai 2006) $
  11.  * @package Phundament.Components
  12.  * @subpackage WebControls
  13.  */
  14.  
  15. /**
  16.  * Displays a brick with static HTML
  17.  * Can also use PRADO tags (testing)
  18.  *
  19.  * @package System.Web.UI.WebControls
  20.  * @subpackage Configuration
  21.  */
  22.  
  23. class LStyleSheetThemeChooser extends TTemplateControl
  24. {
  25.         /**
  26.      * @return string: name of the brick
  27.      */
  28.     public function getDescriptiveName()
  29.     {
  30.         return "StyleSheet-Theme Chooser";
  31.     }
  32.  
  33.     /**
  34.      * adds admin snippets
  35.      */
  36.     public function __construct()
  37.     {
  38.         parent :: __construct();
  39.         #$admin = '<com:TTextBox ID="HTML" Width="100%" Rows="8" TextMode="MultiLine"/><br/>';
  40.         #$this->addAdminSnippet($admin);
  41.     }
  42.  
  43.     /**
  44.      * prepares code in TTemplate
  45.      */
  46.     public function onInit($param)
  47.     {
  48.         parent :: onInit($param);
  49.         $themes $this->Application->getModule("theme")->getAvailableThemes();
  50.         foreach($themes AS $theme)
  51.         {
  52.             $ds[$theme$theme;
  53.         }
  54.         $this->StyleSheetThemes->DataSource $ds;
  55.         $this->StyleSheetThemes->dataBind();
  56.  
  57.         try{
  58.             $this->StyleSheetThemes->SelectedValue $this->Session['LStyleSheetThemeChoose:Style'];
  59.         }
  60.         catch (Exception $e)
  61.         {
  62.             Prado::log($e->getMessage(),TLogger::NOTICE,"Lithron.LStyleSheetThemeChooser");
  63.         }
  64.         #$this->Session['LStyleSheetThemeChoose:Style'];
  65.         $this->Page->setStyleSheetTheme($this->Session['LStyleSheetThemeChoose:Style']);
  66.         #$this->Page->setStyleSheetTheme("");
  67.     }
  68.  
  69.     public function applyStyle()
  70.     {
  71.         $style $this->StyleSheetThemes->SelectedValue;
  72.         $this->Session['LStyleSheetThemeChoose:Style'$style;
  73.         $this->Service->reload();
  74.     }
  75.  
  76. }
  77. ?>

Documentation generated on Sun, 25 Feb 2007 16:11:43 +0100 by phpDocumentor 1.3.1