Пример #1
0
 /**
  * Set jQuery UI CSS Framework.
  * Path is {root}/css/ui/{interface}
  * This is a simple wrapper to {@link MParams::setInterface($value)}.
  * @param string $value
  */
 public static function setInterface($value)
 {
     if ((is_string($value) || is_int($value)) && array_key_exists($value, MParams::getAvailableInterfaces()) && MPath::interfaceExists($value)) {
         MParams::setInterface($value);
     } else {
         Yii::log(W3::t('system', 'Incorrect parameter in method call: {method}.', array('{method}' => __METHOD__ . '(' . var_export($value, true) . ')')), 'notice', 'w3');
     }
 }
Пример #2
0
 /**
  * Initialize css.
  */
 public static function css()
 {
     $cs = Yii::app()->getClientScript();
     // main css
     $cs->registerCssFile(Yii::app()->request->baseUrl . '/static/css/main.css');
     // 960 css
     $cs->registerCssFile(Yii::app()->request->baseUrl . '/static/css/960.css');
     // all jquery plugins css
     //$cs->registerCssFile(Yii::app()->request->baseUrl.'/static/css/jquery-1.3.x.plugins.css');
     // jquery-ui
     if (MParams::getRegisterJqueryUI() && MPath::interfaceExists(MParams::getInterface())) {
         $cs->registerCssFile(Yii::app()->request->baseUrl . '/static/css/ui/' . MParams::getInterface() . '/jquery-ui-' . MParams::jqueryUIVersion . '.custom.css');
     }
     // use this css if you want to globally redefine jquery-ui css framework classes
     $redefineJqueryUI = dirname(Yii::app()->basePath) . DIRECTORY_SEPARATOR . 'static' . DIRECTORY_SEPARATOR . 'css' . DIRECTORY_SEPARATOR . 'ui.css';
     if (file_exists($redefineJqueryUI) && filesize($redefineJqueryUI) !== 0) {
         $cs->registerCssFile(Yii::app()->request->baseUrl . '/static/css/ui.css');
     }
 }
Пример #3
0
 /**
  * jQuery UI CSS Framework.
  * Path is {root}/css/ui/{interface}
  * @param string $value
  */
 public static function setInterface($value)
 {
     $availableInterfaces = self::getAvailableInterfaces();
     if ($value === self::_default) {
         if (MPath::interfaceExists(self::$coreDefaultData['interface'])) {
             $value = self::$coreDefaultData['interface'];
         } else {
             self::log(array('method' => __METHOD__, 'value' => $value, 'append' => self::$coreDefaultData['interface']));
             return false;
         }
     } else {
         if (!is_string($value) && !is_int($value) || !array_key_exists($value, $availableInterfaces) || !MPath::interfaceExists($value)) {
             $append = W3::t('system', 'Available interfaces: {availableInterfaces}.', array('{availableInterfaces}' => var_export($availableInterfaces, true)));
             self::log(array('method' => __METHOD__, 'value' => $value, 'append' => $append));
             $value = self::$coreDefaultData['interface'];
             // set the wrong value to default
         }
     }
     self::$coreData['interface'] = $value;
 }