Esempio n. 1
0
 /**
  * Get root panels list
  * @return array
  */
 public function getRootPanels()
 {
     $list = $this->_tree->getChilds(0);
     $names = array();
     if (empty($list)) {
         return array();
     }
     foreach ($list as $k => $v) {
         $object = $v['data'];
         $class = $object->getClass();
         if ($class === 'Object_Instance') {
             $class = $object->getObject()->getClass();
         }
         if (in_array($class, Designer_Project::$_containers, true) && $class !== 'Window' && $class != 'Menu' && !Designer_Project::isWindowComponent($class)) {
             $names[] = $object->getName();
         }
     }
     return $names;
 }
Esempio n. 2
0
 /**
  * Get css icon clas for object
  * @param string $objClass
  */
 public static function getIconClass($objClass)
 {
     $config = array('Docked' => 'objectDocked', 'Window' => 'objectWindowIcon', 'Text' => 'textFieldIcon', 'Textarea' => 'textareaIcon', 'Checkbox' => 'checkboxIcon', 'Checkboxgroup' => 'checkboxGroupIcon', 'Container' => 'containerIcon', 'Time' => 'clockIcon', 'Date' => 'dateIcon', 'Display' => 'displayfieldIcon', 'Fieldset' => 'fieldsetIcon', 'Fieldcontainer' => 'fieldContainerIcon', 'File' => 'fileIcon', 'Htmleditor' => 'htmlEditorIcon', 'Picker' => 'pickerIcon', 'Radio' => 'radioIcon', 'Radiogroup' => 'radioGroupIcon', 'Number' => 'numberFieldIcon', 'Panel' => 'panelIcon', 'Tabpanel' => 'tabIcon', 'Grid' => 'gridIcon', 'Form' => 'formIcon', 'Form_Field_Text' => 'textFieldIcon', 'Form_Field_Number' => 'textFieldIcon', 'Form_Field_Hidden' => 'hiddenFieldIcon', 'Form_Field_Checkbox' => 'checkboxIcon', 'Form_Field_Textarea' => 'textareaIcon', 'Form_Field_Htmleditor' => 'htmlEditorIcon', 'Form_Field_File' => 'fileIcon', 'Form_Field_Radio' => 'radioIcon', 'Form_Field_Time' => 'clockIcon', 'Form_Field_Date' => 'dateIcon', 'Form_Fieldset' => 'fieldsetIcon', 'Form_Field_Display' => 'displayfieldIcon', 'Form_Fieldcontainer' => 'fieldContainerIcon', 'Form_Checkboxgroup' => 'checkboxGroupIcon', 'Form_Radiogroup' => 'radioGroupIcon', 'Form_Field_Combobox' => 'comboboxFieldIcon', 'Button' => 'buttonIcon', 'Button_Split' => 'buttonSplitIcon', 'Buttongroup' => 'buttonGroupIcon', 'Tree' => 'treeIcon', 'Window' => 'windowIcon', 'Store' => 'storeIcon', 'Data_Store' => 'storeIcon', 'Data_Store_Tree' => 'storeIcon', 'Model' => 'modelIcon', 'Component_Window_System_Crud' => 'objectWindowIcon', 'Component_Window_System_Crud_Vc' => 'objectWindowIcon', 'Component_Field_System_Searchfield' => 'olinkIcon', 'Component_Field_System_Dictionary' => 'comboboxFieldIcon', 'Component_Field_System_Medialibhtml' => 'textMediaFieldIcon', 'Component_Field_System_Medialibitem' => 'resourceFieldIcon', 'Component_Field_System_Related' => 'gridIcon', 'Component_Field_System_Objectlink' => 'olinkIcon', 'Component_Field_System_Objectslist' => 'gridIcon', 'Toolbar' => 'toolbarIcon', 'Toolbar_Separator' => 'toolbarSeparatorIcon', 'Toolbar_Spacer' => 'toolbarSpacerIcon', 'Toolbar_Fill' => 'toolbarFillIcon', 'Toolbar_Textitem' => 'toolbarTextitemIcon', 'Menu' => 'menuItemsIcon', 'Menu_Separator' => 'menuSeparatorIcon', 'Menu_Item' => 'toolbarTextitemIcon', 'Menu_Datepicker' => 'dateIcon', 'Menu_Colorpicker' => 'colorPickerIcon', 'Menu_Checkitem' => 'checkboxIcon');
     if (Designer_Project::isWindowComponent($objClass)) {
         return 'objectWindowIcon';
     }
     if (isset($config[$objClass])) {
         return $config[$objClass];
     } else {
         if (Designer_Project::isContainer($objClass)) {
             return 'objectIcon';
         } else {
             return 'objectLeafIcon';
         }
     }
 }
Esempio n. 3
0
 protected function _compileJs($parent)
 {
     $definesCode = '';
     $layoutCode = '';
     $items = array();
     $docked = array();
     $menu = array();
     /*
      * Compile Models and Stores primarily for root node
      */
     if ($parent === 0) {
         $models = $this->_project->getModels();
         if (!empty($models)) {
             foreach ($models as $id => $item) {
                 $definesCode .= $this->getObjectDefineJs($id);
             }
         }
         $stores = $this->_project->getStores();
         if (!empty($stores)) {
             foreach ($stores as $id => $item) {
                 if ($item->isExtendedComponent()) {
                     $definesCode .= $this->getObjectDefineJs($id);
                     if ($item->getConfig()->defineOnly) {
                         continue;
                     }
                 }
                 $layoutCode .= $this->getObjectLayoutCode($id);
                 $items[] = $this->_project->runnamespace . '.' . $item->getName();
             }
         }
     }
     if ($this->_project->hasChilds($parent)) {
         $childs = $this->_project->getChilds($parent);
         foreach ($childs as $k => $item) {
             $itemObject = $item['data'];
             $oClass = $item['data']->getClass();
             /*
              * Skip Stores amd Models
              */
             if ($oClass === 'Store' || $oClass === 'Model' || $oClass === 'Data_Store' || $oClass === 'Data_Store_Tree') {
                 continue;
             }
             if ($itemObject->isExtendedComponent() || in_array($oClass, Designer_Project::$defines, true) || Designer_Project::isWindowComponent($oClass)) {
                 $result = $this->_compileExtendedItem($item['id'], $item['id']);
                 $definesCode .= $result['defines'];
                 continue;
             }
             switch ($oClass) {
                 case 'Docked':
                     if (!$this->_project->hasChilds($item['id'])) {
                         continue;
                     }
                     $result = $this->_compileItem($item['id']);
                     $layoutCode .= $result['layout'];
                     /*
                      * Only last Ext_Docked object will be processed
                      */
                     $docked = $this->_project->runnamespace . '.' . $itemObject->getName();
                     break;
                 case 'Menu':
                     if (!$this->_project->hasChilds($item['id'])) {
                         continue;
                     }
                     $menu = $this->_compileConfig($item['id']);
                     break;
                 default:
                     $result = $this->_compileItem($item['id']);
                     $layoutCode .= $result['layout'];
                     $items[] = $this->_project->runnamespace . '.' . $itemObject->getName();
                     break;
             }
         }
     }
     if ($parent !== 0) {
         $parentObject = $this->_project->getItemData($parent);
         if (!empty($items) && $parentObject->isValidProperty('items')) {
             $parentObject->items = Utils_String::addIndent("[\n" . Utils_String::addIndent(implode(",\n", $items)) . "\n]\n");
         }
         if (!empty($docked) && $parentObject->isValidProperty('dockedItems')) {
             $parentObject->dockedItems = $docked;
         }
         if (!empty($menu) && $parentObject->isValidProperty('menu')) {
             $parentObject->menu = $menu;
         }
     }
     return array('defines' => $definesCode, 'layout' => $layoutCode);
 }