Пример #1
0
 /**
  * 
  *
  * @return array
  */
 public function getConfigParams()
 {
     $params = array();
     foreach ($this->_layoutProperties as $name => &$value) {
         if (PhpExt_ObjectCollection::isExtObjectCollection($value)) {
             if ($value->getCount() > 0) {
                 $params[] = $this->paramToString($name, $value);
             }
         } else {
             if ($value != NULL) {
                 $params[] = $this->paramToString($name, $value);
             }
         }
     }
     return $params;
 }
Пример #2
0
 public static function valueToJavascript($value, $lazy = false)
 {
     $resolvedValue = $value;
     if (is_bool($value)) {
         $resolvedValue = $value ? "true" : "false";
     } else {
         if (is_null($value)) {
             $resolvedValue = null;
         } else {
             if (is_string($value)) {
                 $resolvedValue = "'{$value}'";
             } else {
                 if (is_array($value)) {
                     $resolvedValue = PhpExt_Javascript::jsonEncode($value);
                 } else {
                     if (PhpExt_Object::isExtObject($value)) {
                         $resolvedValue = $value->getJavascript($lazy);
                     } else {
                         if (PhpExt_ObjectCollection::isExtObjectCollection($value)) {
                             if ($value->getCount() > 0) {
                                 $resolvedValue = $value->getJavascript($lazy);
                             }
                         } else {
                             if (PhpExt_Javascript::isJavascript($value) || PhpExt_Javascript::isJavascriptStm($value)) {
                                 $resolvedValue = $value->output();
                             } else {
                                 if (is_object($value)) {
                                     $resolvedValue = PhpExt_Javascript::jsonEncode($value);
                                 }
                             }
                         }
                     }
                 }
             }
         }
     }
     return $resolvedValue;
 }
Пример #3
0
 protected function getConfigParams($lazy = false)
 {
     if ($this->_plugins->getCount() == 0) {
         $this->setExtConfigProperty("plugins", null);
     }
     $params = parent::getConfigParams($lazy);
     if ($lazy && $this->_xType != null) {
         $params[] = $this->paramToString("xtype", $this->_xType);
     }
     if ($this->_layoutData !== null) {
         $layoutParams = $this->_layoutData->getConfigParams();
         $params = array_merge($params, $layoutParams);
     }
     return $params;
 }