summaryrefslogtreecommitdiff
path: root/demos/blog/protected/Pages/Admin/ConfigMan.php
diff options
context:
space:
mode:
authorctrlaltca <>2012-07-12 11:21:01 +0000
committerctrlaltca <>2012-07-12 11:21:01 +0000
commit903ae8a581fac1e6917fc3e31d2ad8fb91df80c3 (patch)
treee08bf04f0823650a231227ac3499121270172a23 /demos/blog/protected/Pages/Admin/ConfigMan.php
parent3e4e6e66aeb3f8fea4e1eb4237498ef9d2358f63 (diff)
standardize the use of unix eol; use svn properties to enforce native eol
Diffstat (limited to 'demos/blog/protected/Pages/Admin/ConfigMan.php')
-rw-r--r--demos/blog/protected/Pages/Admin/ConfigMan.php152
1 files changed, 76 insertions, 76 deletions
diff --git a/demos/blog/protected/Pages/Admin/ConfigMan.php b/demos/blog/protected/Pages/Admin/ConfigMan.php
index 61516c27..c60a04e8 100644
--- a/demos/blog/protected/Pages/Admin/ConfigMan.php
+++ b/demos/blog/protected/Pages/Admin/ConfigMan.php
@@ -1,77 +1,77 @@
-<?php
-/**
- * ConfigMan class file
- *
- * @author Qiang Xue <qiang.xue@gmail.com>
- * @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2006 PradoSoft
- * @license http://www.pradosoft.com/license/
- * @version $Id$
- */
-
-/**
- * ConfigMan class
- *
- * @author Qiang Xue <qiang.xue@gmail.com>
- * @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2006 PradoSoft
- * @license http://www.pradosoft.com/license/
- */
-class ConfigMan extends BlogPage
-{
- const CONFIG_FILE='Application.Data.Settings';
-
- public function onLoad($param)
- {
- parent::onLoad($param);
- if(!$this->IsPostBack)
- {
- $parameters=$this->Application->Parameters;
- $this->SiteTitle->Text=$parameters['SiteTitle'];
- $this->SiteSubtitle->Text=$parameters['SiteSubtitle'];
- $this->SiteOwner->Text=$parameters['SiteOwner'];
- $this->AdminEmail->Text=$parameters['AdminEmail'];
- $this->MultipleUser->Checked=TPropertyValue::ensureBoolean($parameters['MultipleUser']);
- $this->AccountApproval->Checked=TPropertyValue::ensureBoolean($parameters['AccountApproval']);
- $this->PostPerPage->Text=$parameters['PostPerPage'];
- $this->RecentComments->Text=$parameters['RecentComments'];
- $this->PostApproval->Checked=TPropertyValue::ensureBoolean($parameters['PostApproval']);
- $themes=$this->Service->ThemeManager->AvailableThemes;
- $this->ThemeName->DataSource=$themes;
- $this->ThemeName->dataBind();
- $this->ThemeName->SelectedValue=array_search($parameters['ThemeName'],$themes);
- }
- }
-
- public function saveButtonClicked($sender,$param)
- {
- $dom=new TXmlDocument;
- $dom->Encoding='utf-8';
- $dom->TagName='parameters';
- $elements=$dom->Elements;
- $elements[]=$this->createParameter('SiteTitle',$this->SiteTitle->Text);
- $elements[]=$this->createParameter('SiteSubtitle',$this->SiteSubtitle->Text);
- $elements[]=$this->createParameter('SiteOwner',$this->SiteOwner->Text);
- $elements[]=$this->createParameter('AdminEmail',$this->AdminEmail->Text);
- $elements[]=$this->createParameter('MultipleUser',$this->MultipleUser->Checked);
- $elements[]=$this->createParameter('AccountApproval',$this->AccountApproval->Checked);
- $elements[]=$this->createParameter('PostPerPage',$this->PostPerPage->Text);
- $elements[]=$this->createParameter('RecentComments',$this->RecentComments->Text);
- $elements[]=$this->createParameter('PostApproval',$this->PostApproval->Checked);
- $themeName=$this->ThemeName->SelectedItem->Text;
- $elements[]=$this->createParameter('ThemeName',$themeName);
- $dom->saveToFile(Prado::getPathOfNamespace(self::CONFIG_FILE,'.xml'));
- if($themeName!==$this->Theme->Name)
- $this->Response->reload();
- }
-
- private function createParameter($id,$value)
- {
- $element=new TXmlElement('parameter');
- $element->Attributes['id']=$id;
- $element->Attributes['value']=TPropertyValue::ensureString($value);
- return $element;
- }
-}
-
+<?php
+/**
+ * ConfigMan class file
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright &copy; 2006 PradoSoft
+ * @license http://www.pradosoft.com/license/
+ * @version $Id$
+ */
+
+/**
+ * ConfigMan class
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright &copy; 2006 PradoSoft
+ * @license http://www.pradosoft.com/license/
+ */
+class ConfigMan extends BlogPage
+{
+ const CONFIG_FILE='Application.Data.Settings';
+
+ public function onLoad($param)
+ {
+ parent::onLoad($param);
+ if(!$this->IsPostBack)
+ {
+ $parameters=$this->Application->Parameters;
+ $this->SiteTitle->Text=$parameters['SiteTitle'];
+ $this->SiteSubtitle->Text=$parameters['SiteSubtitle'];
+ $this->SiteOwner->Text=$parameters['SiteOwner'];
+ $this->AdminEmail->Text=$parameters['AdminEmail'];
+ $this->MultipleUser->Checked=TPropertyValue::ensureBoolean($parameters['MultipleUser']);
+ $this->AccountApproval->Checked=TPropertyValue::ensureBoolean($parameters['AccountApproval']);
+ $this->PostPerPage->Text=$parameters['PostPerPage'];
+ $this->RecentComments->Text=$parameters['RecentComments'];
+ $this->PostApproval->Checked=TPropertyValue::ensureBoolean($parameters['PostApproval']);
+ $themes=$this->Service->ThemeManager->AvailableThemes;
+ $this->ThemeName->DataSource=$themes;
+ $this->ThemeName->dataBind();
+ $this->ThemeName->SelectedValue=array_search($parameters['ThemeName'],$themes);
+ }
+ }
+
+ public function saveButtonClicked($sender,$param)
+ {
+ $dom=new TXmlDocument;
+ $dom->Encoding='utf-8';
+ $dom->TagName='parameters';
+ $elements=$dom->Elements;
+ $elements[]=$this->createParameter('SiteTitle',$this->SiteTitle->Text);
+ $elements[]=$this->createParameter('SiteSubtitle',$this->SiteSubtitle->Text);
+ $elements[]=$this->createParameter('SiteOwner',$this->SiteOwner->Text);
+ $elements[]=$this->createParameter('AdminEmail',$this->AdminEmail->Text);
+ $elements[]=$this->createParameter('MultipleUser',$this->MultipleUser->Checked);
+ $elements[]=$this->createParameter('AccountApproval',$this->AccountApproval->Checked);
+ $elements[]=$this->createParameter('PostPerPage',$this->PostPerPage->Text);
+ $elements[]=$this->createParameter('RecentComments',$this->RecentComments->Text);
+ $elements[]=$this->createParameter('PostApproval',$this->PostApproval->Checked);
+ $themeName=$this->ThemeName->SelectedItem->Text;
+ $elements[]=$this->createParameter('ThemeName',$themeName);
+ $dom->saveToFile(Prado::getPathOfNamespace(self::CONFIG_FILE,'.xml'));
+ if($themeName!==$this->Theme->Name)
+ $this->Response->reload();
+ }
+
+ private function createParameter($id,$value)
+ {
+ $element=new TXmlElement('parameter');
+ $element->Attributes['id']=$id;
+ $element->Attributes['value']=TPropertyValue::ensureString($value);
+ return $element;
+ }
+}
+
?> \ No newline at end of file