コード例 #1
0
 function do_main()
 {
     $aFieldsets = KTFieldset::getList("is_conditional = 1 AND disabled != true");
     $oTemplating =& KTTemplating::getSingleton();
     $oTemplate = $oTemplating->loadTemplate("ktcore/metadata/conditional/select_fieldset");
     $aTemplateData = array("context" => &$this, "available_fieldsets" => $aFieldsets);
     return $oTemplate->render($aTemplateData);
 }
コード例 #2
0
 function _upgradeSavedSearch($aSearch)
 {
     $aMapping = array('-1' => 'ktcore.criteria.name', '-6' => 'ktcore.criteria.id', '-2' => 'ktcore.criteria.title', '-3' => 'ktcore.criteria.creator', '-4' => 'ktcore.criteria.datecreated', '-5' => 'ktcore.criteria.documenttype', '-7' => 'ktcore.criteria.datemodified', '-8' => 'ktcore.criteria.size', '-9' => 'ktcore.criteria.content', '-10' => 'ktcore.criteria.workflowstate', '-13' => 'ktcore.criteria.discussiontext', '-12' => 'ktcore.criteria.searchabletext', '-11' => 'ktcore.criteria.transactiontext');
     $aFieldsets =& KTFieldset::getList('disabled != true');
     foreach ($aFieldsets as $oFieldset) {
         $aFields =& DocumentField::getByFieldset($oFieldset);
         foreach ($aFields as $oField) {
             $sNamespace = $oFieldset->getNamespace() . '.' . $oField->getName();
             $sId = (string) $oField->getId();
             $aMapping[$sId] = $sNamespace;
         }
     }
     foreach (array_keys($aSearch['subgroup']) as $sgkey) {
         $sg =& $aSearch['subgroup'][$sgkey];
         foreach (array_keys($sg['values']) as $vkey) {
             $item =& $sg['values'][$vkey];
             $type = $item['type'];
             $toreplace = 'bmd' . ((int) $type < 0 ? '_' : '') . abs((int) $type);
             $item['type'] = $aMapping[$type];
             $nData = array();
             foreach ($item['data'] as $k => $v) {
                 $k = str_replace($toreplace, $aMapping[$type], $k);
                 $nData[$k] = $v;
             }
             $item['data'] = $nData;
         }
     }
     return $aSearch;
 }
コード例 #3
0
 function do_main()
 {
     $oTemplate =& $this->oValidator->validateTemplate('ktcore/metadata/admin/list');
     $oTemplate->setData(array('context' => $this, 'fieldsets' => KTFieldset::getList("disabled != true AND namespace != 'tagcloud'")));
     return $oTemplate;
 }