Exemplo n.º 1
0
 public function design($path)
 {
     $options = DataCenterViewModels::$options[$path['type']];
     if (isset($options['gallery'])) {
         // Gets all components from database
         $models = DataCenterDB::getModels($path['type']);
         // Returns single columm layout with a table
         return DataCenterUI::renderLayout('columns', array(DataCenterUI::renderLayout('rows', array(DataCenterUI::renderWidget('heading', array('message' => 'select-deploy-type', 'type' => 'model')), DataCenterUI::renderWidget('gallery', array_merge($options['gallery'], array('rows' => $models, 'link' => array('page' => 'assets', 'type' => $path['type'], 'action' => 'deploy', 'parameter' => '#id'))))))));
     }
 }
Exemplo n.º 2
0
 public function select($path)
 {
     // Checks if...
     if (is_scalar($path['parameter']) && isset(self::$options[$path['parameter']]['gallery'])) {
         // Gets all components from database
         $models = DataCenterDB::getModels($path['parameter'], dataCenterDB::buildSort('model', $path['parameter'], self::$options[$path['parameter']]['sort']));
         // Build gallery options
         $galleryOptions = array_merge(self::$options[$path['parameter']]['gallery'], array('rows' => $models, 'link' => array('page' => 'models', 'type' => $path['type'], 'id' => $path['id'], 'action' => 'attach', 'parameter' => array($path['parameter'], '#id'))));
         // Returns single columm layout with a table
         return DataCenterUI::renderLayout('columns', array(DataCenterUI::renderLayout('rows', array(DataCenterUI::renderWidget('heading', array('message' => 'select-attach-type', 'type' => 'model')), DataCenterUI::renderWidget('gallery', $galleryOptions)))));
     }
 }