Ejemplo n.º 1
0
 public static function resolveSource2Array($model, $items, $isBackForm)
 {
     $source = '';
     if ($isBackForm) {
         $source = $model['back_form_source'];
     } else {
         $source = $model['front_form_source'];
     }
     $ret = TStringHelper::parse2Array($source);
     return array_merge($ret, $items);
 }
Ejemplo n.º 2
0
 private static function getActions($table, $type = 'back')
 {
     $ret = [];
     if (!empty($table[$type . '_action_custom'])) {
         $tableName = $table['table_name'];
         $customActions = TStringHelper::parse2Array($table[$type . '_action_custom']);
         if (!empty($customActions)) {
             foreach ($customActions as $id => $action) {
                 $ret[$id] = $type . 'end\\actions\\content\\' . $tableName . '\\' . $action;
             }
         }
     }
     return $ret;
 }
Ejemplo n.º 3
0
 public static function getActions($table, $type = 'back')
 {
     $ret = [];
     $tableName = $table['table_name'];
     $ret['index'] = DefineTable::getActionItem($table, $type, 'index', 'IndexAction');
     $ret['create'] = DefineTable::getActionItem($table, $type, 'create', 'CreateAction');
     $ret['update'] = DefineTable::getActionItem($table, $type, 'update', 'UpdateAction');
     $ret['delete'] = DefineTable::getActionItem($table, $type, 'delete', 'DeleteAction');
     $ret['other'] = DefineTable::getActionItem($table, $type, 'other', 'OtherAction');
     if ($type == 'front') {
         $ret['channel'] = DefineTable::getActionItem($table, $type, 'channel', 'ChannelAction');
         $ret['list'] = DefineTable::getActionItem($table, $type, 'list', 'ListAction');
         $ret['detail'] = DefineTable::getActionItem($table, $type, 'detail', 'DetailAction');
         $ret['search'] = DefineTable::getActionItem($table, $type, 'search', 'SearchAction');
     }
     if (!empty($table[$type . '_action_custom'])) {
         $customActions = TStringHelper::parse2Array($table[$type . '_action_custom']);
         if (!empty($customActions)) {
             foreach ($customActions as $id => $action) {
                 $ret[$id] = $type . 'end\\actions\\content\\' . $tableName . '\\' . $action;
             }
         }
     }
     return $ret;
 }