/**
  * Export
  */
 public function toArray()
 {
     $data = parent::toArray();
     foreach ($data["tableColumns"] as &$tableColumn) {
         if ($tableColumn["title"] == "Title") {
             $tableColumn["data"] = $this->titleFieldName;
         }
         if ($tableColumn["title"] == "Sort") {
             $tableColumn["data"] = $this->orderByFieldName;
         }
     }
     return $data;
 }
示例#2
0
 /**
  * Returns a peer instance associated with this om.
  *
  * Since Peer classes are not to have any instance attributes, this method returns the
  * same instance for all member of this class. The method could therefore
  * be static, but this would prevent one from overriding the behavior.
  *
  * @return     ConfigurationPeer
  */
 public function getPeer()
 {
     if (self::$peer === null) {
         self::$peer = new ConfigurationPeer();
     }
     return self::$peer;
 }
<?php

/****************************************************************************
 *	This file is part of MWFramework.                                       *
 *	                                                                        *
 *	MWFramework is free software: you can redistribute it and/or modify     *
 *	it under the terms of the GNU General Public License as published by    *
 *	the Free Software Foundation, either version 3 of the License, or       *
 *	(at your option) any later version.                                     *
 *	                                                                        *
 *	MWFramework is distributed in the hope that it will be useful,          *
 *	but WITHOUT ANY WARRANTY; without even the implied warranty of          *
 *	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the           *
 *	GNU General Public License for more details.                            *
 *	                                                                        *
 *	You should have received a copy of the GNU General Public License       *
 *	along with MWFramework.  If not, see <http://www.gnu.org/licenses/>.    *
 ****************************************************************************/
class BaseConfiguration
{
    public static $WebPath = "";
    public static $WebName = "Blog Demo";
    public static $MySQL = array("host" => "localhost", "user" => "root", "pass" => "1234", "db" => "mwf_db_demo_blog");
    public static $DefaultMod = "mod_mainpage";
}
BaseConfiguration::$WebPath = dirname(dirname(__FILE__));
示例#4
0
 /**
  * After saving the model, run any tasks for various configuration keys.
  *
  * @return void
  */
 protected function afterSave()
 {
     switch ($this->key_name) {
         case 'FEATURED_KEYWORD':
             Product::SetFeaturedByKeyword($this->key_value);
             break;
         case 'LANGUAGES':
             $this->updateLanguages($this->key_value);
             break;
         case 'SEO_URL_CATEGORIES':
             Yii::app()->params['SEO_URL_CATEGORIES'] = $this->key_value;
             Product::convertSEO();
             break;
         case 'AUTO_UPDATE':
             //This is only applicable to Hosting mode
             if (Yii::app()->params['LIGHTSPEED_HOSTING']) {
                 $this->dummyUpdatefile((int) $this->key_value);
             }
             break;
     }
     parent::afterSave();
 }