/** * Show list of plans */ public function plans() { if (!$this->ion_auth->logged_in()) { redirect('/auth'); } $user = $this->getUser(); $feature = new Feature(); $plan = new Plan(); $this->template->layout = 'layouts/customer_settings'; $this->template->set('features', $feature->get()); $this->template->set('plans', $plan->getActualPlansWithoutActive($user)); $this->template->set('user', $user); $this->template->set('options', $this->config->config['period_qualifier']); $this->template->render(); }
public function getCMSFields() { $fields = new FieldList(); $feature = $this->Feature(); if ($feature->exists()) { $fields->push(ReadonlyField::create("FeatureTitle", "Feature", $feature->Title)); $fields->push($feature->getValueField()); } else { $selected = Feature::get()->innerJoin("ProductFeatureValue", "Feature.ID = ProductFeatureValue.FeatureID")->filter("ProductFeatureValue.ProductID", Controller::curr()->currentPageID())->getIDList(); $features = Feature::get()->filter("ID:not", $selected); $fields->push(DropdownField::create("FeatureID", "Feature", $features->map()->toArray())); $fields->push(LiteralField::create("creationnote", "<p class=\"message\">You can choose a value for this feature after saving.</p>")); } return $fields; }
public function updateCMSFields(FieldList $fields) { $fields->addFieldToTab("Root.Features", $grid = GridField::create("Features", "Features", $this->owner->Features(), GridFieldConfig_RecordEditor::create())); $grid->getConfig()->removeComponentsByType('GridFieldDataColumns')->removeComponentsByType('GridFieldAddNewButton')->addComponent(new GridFieldAddNewInlineButton())->addComponent(new GridFieldEditableColumns())->addComponent(new GridFieldOrderableRows()); $grid->getConfig()->getComponentByType('GridFieldEditableColumns')->setDisplayFields(array('FeatureID' => function ($record, $column, $grid) { $dropdown = new DropdownField($column, 'Feature', Feature::get()->map('ID', 'Title')->toArray()); $dropdown->addExtraClass('on_feature_select_fetch_value_field'); return $dropdown; }, 'Value' => function ($record, $column, $grid) { if ($record->FeatureID) { $field = $record->Feature()->getValueField(); $field->setName($column); return $field; } return new HiddenField($column); })); }
public function index($request) { if (!SecurityToken::inst()->checkRequest($request)) { return $this->httpError(403); } $id = $request->getVar('ID'); if (!$id) { return $this->httpError(400); } $feature = Feature::get()->byId($id); if (!$feature) { return $this->httpError(404); } if (!$feature->canView()) { return $this->httpError(403); } $field = $feature->getValueField()->setName($request->getVar('Name')); return $field->forTemplate(); }
public function plans() { $post = $this->input->post(); if (!empty($post)) { if (isset($post['planId'])) { $selectedPlan = $post['planId']; redirect('auth/register/' . $selectedPlan, 'refresh'); } } $feature = new Feature(); $plan = new Plan(); $this->template->set('features', $feature->get()); $withTrial = !$this->ion_auth->logged_in(); CssJs::getInst()->add_js('libs/eq-height.js'); $this->template->set('plans', $plan->getActualPlans($withTrial)); $this->template->set('options', $this->config->config['period_qualifier']); $this->template->render(); }
public function LatestFeatures($PageID) { return Feature::get()->filter(array('FeaturesPageID' => $PageID))->sort('Created', 'ASC'); }
function RoadmapList() { $RoadmapQuery = "Roadmap = TRUE AND ProductPageID =" . $this->ID; $RoadmapList = Feature::get()->where($RoadmapQuery); return $RoadmapList; }
/** * @return DataList */ public function Features() { return Feature::get()->leftJoin("ProductFeatureValue", "\"Feature\".\"ID\" = \"ProductFeatureValue\".\"FeatureID\"")->filter("ProductID", $this->getSelectionIDs()); }