/** Main view */
 public function _default()
 {
     $feedback_collection = new FeedbackRepository();
     $feedback_collection->addOrderByField('date_created', true);
     echo Columns::getInstance()->add('<a href="?p=' . P . '&do=_remove_unconfirmed" class="btn btn-danger">Remove unconfirmed</a>
         &nbsp;&nbsp;&nbsp;&nbsp;<a href="?p=' . P . '&do=_remove_dupes" class="btn btn-warning">Remove duplicate emails</a>', ['align' => 'right']);
     echo CmsTable::getInstance()->addData($feedback_collection)->addColumn(ColumnData::getInstance('date_created')->enableOrderableColumn()->disableNewlines()->enableRightAlign()->setHref('?p=' . P . '&do=view&id={%id%}')->dataType('ts2datetime')->setTitle('Date'))->addColumn(ColumnData::getInstance('name')->enableOrderableColumn())->addColumn(ColumnData::getInstance('phone')->enableOrderableColumn())->addColumn(ColumnData::getInstance('email')->enableOrderableColumn()->dataType('email'))->addColumn(ColumnAccept::getInstance('done')->setHref('?p=' . P . '&do=_done&id={%id%}')->enableOrderableColumn())->addColumn(ColumnDelete::getInstance()->setHref('?p=' . P . '&do=_delete&id={%id%}'))->attachFilterForm(FilterForm::getInstance()->setWidth('100%')->addFilter('Email', Text::getInstance('email')->actAs('like')));
 }
 public function _default()
 {
     $breadcrumbs = BreadCrumbs::getInstance()->addCrumb(ucfirst(P))->addCrumb('All Reviews');
     $reviews = new ReviewEntityRepository();
     $reviews->addSimpleSelectFields(['id', 'title', 'active', 'image']);
     $reviews->addSimpleSelectFieldsAsString('"0" as `images`');
     $reviews->addOrderByField('id');
     $images = new ImageRepository();
     $images->addSimpleSelectFieldsAsString('(SELECT COUNT(*) FROM `' . $images->getDbTableName() . '` WHERE `item_id` = `' . $reviews->getDbTableName() . '`.`id` AND `item_type` = "review") AS `images`');
     $reviews->mergeWithCollection($images, 'id', 'item_id', 'left');
     $table = CmsTable::getInstance()->addData($reviews)->addColumn(ColumnImg::getInstance('image')->imgHeight('100'))->addColumn(ColumnEdit::getInstance('title')->enableOrderableColumn()->enableTranslationColumn()->setHref('?p=' . P . '&do=edit&id={%id%}'))->addColumn(ColumnData::getInstance('images')->enableOrderableColumn()->setWidth('1%')->enableRightAlign()->setHref('?p=' . P . '&do=images&id={%id%}'))->addColumn(ColumnActive::getInstance('active')->setHref('?p=' . P . '&do=_active&id={%id%}')->enableOrderableColumn()->enableAjax())->addColumn(ColumnDelete::getInstance('delete')->setHref('?p=' . P . '&do=_delete&id={%id%}'));
     echo Columns::getInstance()->add($breadcrumbs)->add('<a class="btn btn-success" href="?p=' . P . '&do=add">Add Review</a>', ['align' => 'right']);
     echo $table;
 }
 /** Tags */
 public function tags()
 {
     $tags = new ArticleTagEntityRepository();
     echo BreadCrumbs::getInstance()->addCrumb(__('Articles'))->addCrumb(__('Tags'));
     echo Columns::getInstance()->add('<a class="btn btn-success" href="?p=' . P . '&do=tags_add">' . __('Add Tag') . '</a><br><br>', ['align' => 'right']);
     echo CmsTable::getInstance()->addData($tags)->addColumn(ColumnData::getInstance('title')->enableTranslationColumn())->addColumn(ColumnEdit::getInstance('edit'))->addColumn(ColumnActive::getInstance('active'))->addColumn(ColumnDelete::getInstance('delete'));
 }
Example #4
0
 /** Categories */
 public static function categories()
 {
     $categories = new FaqCategoryEntityRepository();
     $categories->addOrderByField('id');
     echo Columns::getInstance()->add('<a class="btn btn-success" href="?p=' . P . '&do=categories_add">Add Category</a>', ['align' => 'right']);
     echo '<br>';
     echo CmsTable::getInstance()->addData($categories)->addColumn(ColumnEdit::getInstance('title')->setHref('?p=' . P . '&do=categories_edit&id={%id%}')->enableOrderableColumn()->enableTranslationColumn())->addColumn(ColumnDelete::getInstance()->setHref('?p=' . P . '&do=_categories_delete&id={%id%}'));
 }
 public function setting_options()
 {
     $id = abs((int) $_GET['id']);
     if (!$id) {
         return;
     }
     $setting = new CustomSetting($id);
     $breadcrumbs = BreadCrumbs::getInstance()->addCrumb(ucfirst(P))->addCrumb($setting->getModule())->addCrumb($setting->getKey());
     $options = new CustomSettingOptionRepository();
     $options->setWhereSettingId($id);
     $table = CmsTable::getInstance()->setHeadingTitle('Options')->addData($options)->addColumn(ColumnData::getInstance('option_name')->enableOrderableColumn())->addColumn(ColumnEdit::getInstance('edit')->href('?p=' . P . '&do=setting_options_edit&id={%id%}')->width('1%')->value(__('Edit')))->addColumn(ColumnDelete::getInstance('delete')->href('?p=' . P . '&do=_setting_options_delete&id={%id%}'));
     $columns = Columns::getInstance()->add($breadcrumbs)->add('<a class="btn btn-success" href="?p=' . P . '&do=setting_options_add&id=' . $id . '">Add Setting Option</a>', ['align' => 'right']);
     echo $columns;
     echo $table;
 }