コード例 #1
0
 function getColumnsForView($sViewNamespace)
 {
     $view_entry = KTUtil::arrayGet($this->views, $sViewNamespace);
     if (is_null($view_entry)) {
         return PEAR::raiseError(sprintf(_kt("No such view: %s"), $sViewNamespace));
     }
     $view_column_entries = KTColumnEntry::getByView($sViewNamespace);
     if (PEAR::isError($view_column_entries)) {
         return $view_column_entries;
     }
     $view_columns = array();
     foreach ($view_column_entries as $oEntry) {
         $res = $this->getColumn($oEntry->getColumnNamespace());
         if (PEAR::isError($res)) {
             // this was returning before, but the function calling this is just doing
             // an array merge, so the error propogation is not great.
             // if this is an unexpected column, lets just skip it for now.
             continue;
         }
         $aOptions = $oEntry->getConfigArray();
         $aOptions['column_id'] = $oEntry->getId();
         $aOptions['required_in_view'] = $oEntry->getRequired();
         $res->setOptions($aOptions);
         $view_columns[] = $res;
     }
     return $view_columns;
 }
コード例 #2
0
ファイル: manageViews.php プロジェクト: 5haman/knowledgetree
 function do_orderDown()
 {
     $entryId = $_REQUEST['entry_id'];
     $view = $_REQUEST['viewNS'];
     $oEntry = KTColumnEntry::get($entryId);
     if (PEAR::isError($oEntry)) {
         $this->errorRedirectTo('editView', _kt('Unable to locate the column entry'), "viewNS={$view}");
         exit;
     }
     $res = $oEntry->movePosition($view, $entryId, 'down');
     if (PEAR::isError($res)) {
         $this->errorRedirectTo('editView', $res->getMessage(), "viewNS={$view}");
         exit;
     }
     $this->redirectTo("editView", "viewNS={$view}");
 }