コード例 #1
0
 public function action($node_id)
 {
     \OLOG\Exits::exit403If(!Auth::currentUserHasAnyOfPermissions([1]));
     $html = DemoNodeEditAction::tabsHtml($node_id);
     $html .= '<div>&nbsp;</div>';
     $new_term_to_node = new DemoTermToNode();
     $new_term_to_node->setNodeId($node_id);
     $html .= CRUDTable::html(DemoTermToNode::class, CRUDForm::html($new_term_to_node, [new CRUDFormInvisibleRow(new CRUDFormWidgetInput('node_id')), new CRUDFormRow('Term id', new CRUDFormWidgetReference('term_id', DemoTerm::class, 'title'), 'Рубрика, с которой должен быть связан материал')]), [new CRUDTableColumn('Term', new CRUDTableWidgetText('{' . DemoTerm::class . '.{this->term_id}->title}')), new CRUDTableColumn('Delete', new CRUDTableWidgetDelete())], [new CRUDTableFilterEqualInvisible('node_id', $node_id)]);
     DemoLayoutTemplate::render($html, 'Node ' . $node_id, DemoNodeEditAction::breadcrumbsArr($node_id));
 }
コード例 #2
0
 public function action()
 {
     \OLOG\Exits::exit403If(!Auth::currentUserHasAnyOfPermissions([1]));
     $table_id = 'tableContainer_NodeList';
     $form_id = 'formElem_NodeList';
     $html = '';
     $html .= CRUDTable::html(DemoNode::class, \OLOG\CRUD\CRUDForm::html(new DemoNode(), [new CRUDFormRow('Title', new CRUDFormWidgetInput('title')), new CRUDFormRow('body2', new CRUDFormWidgetInput('body2'))], '', [], $form_id), [new CRUDTableColumn('Title', new CRUDTableWidgetHtmlWithLink('{this->title}<br>{this->getReverseTitle()}', DemoNodeEditAction::getUrl('{this->id}'))), new CRUDTableColumn('Reverse title', new CRUDTableWidgetText('{this->getReverseTitle()}')), new CRUDTableColumn('', new CRUDTableWidgetDelete())], [], 'title', $table_id);
     // Загрузка скриптов
     $html .= CRUDCreateFormScript::getHtml($form_id, $table_id);
     DemoLayoutTemplate::render($html, 'Nodes', self::getBreadcrumbsArr());
 }
コード例 #3
0
ファイル: DemoNodeEditAction.php プロジェクト: o-log/php-crud
 public static function tabsHtml($node_id)
 {
     ob_start();
     self::renderTabs([['TITLE' => 'edit', 'MATCH_URL' => DemoNodeEditAction::getUrl(), 'LINK_URL' => DemoNodeEditAction::getUrl($node_id)], ['TITLE' => 'terms', 'MATCH_URL' => DemoNodeTermsAction::getUrl(), 'LINK_URL' => DemoNodeTermsAction::getUrl($node_id)]]);
     return ob_get_clean();
 }