public function getConfiguration() { $fields = parent::getConfiguration(); $fields->push(TextField::create("Location", _t('Dashboard.LOCATION', 'Location'))); $fields->push(DropdownField::create("Units", _t('Dashboard.UNITS', 'Units'), array('c' => _t('Dashboard.CELCIUS', 'Celcius'), 'f' => _t('Dashboard.FARENHEIT', 'Farenheit')))->addExtraClass("no-chzn")); return $fields; }
public function getConfiguration() { $fields = parent::getConfiguration(); $fields->push(DropdownField::create('SelectCriteria', 'Select Criteria', singleton('DashboardLifeTimeValuePanel')->dbObject('SelectCriteria')->enumValues())->setEmptyString('(Select criteria)')); $monthArray = array(); for ($i = 1; $i <= 12; $i++) { $month = date('F', mktime(0, 0, 0, $i, 1, 2015)); $monthArray[$i] = $month; } // callback function $monthDataSource = function ($criteria) { if ($criteria == 'Monthly') { return $monthArray; } }; $criteria = $fields->dataFieldByName('SelectCriteria'); //$fields->push(DependentDropdownField::create('Month','Select Month', $monthDataSource)->setDepends($criteria)->setEmptyString('(Select month)')); $fields->push(DropdownField::create('Month', 'Select Month', $monthArray)->setEmptyString('(Select month)')); $currentYear = date('Y'); $yearArray = array(); for ($j = $currentYear - 10; $j <= $currentYear; $j++) { $yearArray[$j] = $j; } $fields->push(DropdownField::create('Year', 'Select Year', $yearArray)->setEmptyString('(Select year)')); return $fields; }
public function getConfiguration() { $fields = parent::getConfiguration(); $fields->push(TextField::create("FeedURL", "Link to feed (include http://)")); $fields->push(DropdownField::create("DateFormat", "Date format", array('%B %e, %Y' => strftime('%B %e, %Y'), '%e %B, %Y' => strftime('%e %B, %Y')))); $fields->push(TextField::create("Count", _t('DashboardRecentEdits.COUNT', 'Number of pages to display'))); return $fields; }
public function getConfiguration() { $fields = parent::getConfiguration(); $fields->push(DropdownField::create("ParentID", "Section", $this->getHierarchy(0))->addExtraClass("no-chzn")); $fields->push(DropdownField::create("Subject", "Page type", $this->getPageTypes())->addExtraClass("no-chzn")); $fields->push(TextField::create("Count", _t('DashboardRecentEdits.COUNT', 'Number of pages to display'))); return $fields; }
public function getConfiguration() { $fields = parent::getConfiguration(); $fields->push(DateField::create('StartDate', 'Start Date')->setConfig('showcalendar', true)); $fields->push(DateField::create('EndDate', 'End Date')->setConfig('showcalendar', true)); $fields->push(DropdownField::create('SelectCriteria', 'Select Criteria', singleton('DashboardRevenueUnitsByProductPanel')->dbObject('SelectCriteria')->enumValues())->setEmptyString('(Select criteria)')); return $fields; }
public function getConfiguration() { $fields = parent::getConfiguration(); $fields->push(TextField::create("Location", _t('Dashboard.LOCATION', 'Location'))); // Added support for fetching by citycode if the city is not found. $fields->push(OptionsetField::create("LocationType", _t('Dashboard.TYPE', 'Location type'), array('city' => _t('Dashboard.CITY', 'City'), 'code' => _t('Dashboard.CODE', 'City code')))); $fields->push(DropdownField::create("Units", _t('Dashboard.UNITS', 'Units'), array('c' => _t('Dashboard.CELCIUS', 'Celcius'), 'f' => _t('Dashboard.FARENHEIT', 'Farenheit')))->addExtraClass("no-chzn")); return $fields; }
public function getConfiguration() { $fields = parent::getConfiguration(); $fields->push(TreeDropdownField::create("ParentID", "Section", "SiteTree")->setFilterFunction(function ($node) { return SiteTree::get()->filter("ParentID", $node->ID)->exists(); })); $fields->push(DropdownField::create("Subject", "Page type", $this->getPageTypes())->addExtraClass("no-chzn")); $fields->push(TextField::create("Count", _t('DashboardRecentEdits.COUNT', 'Number of pages to display'))); return $fields; }
/** * Gets the fields to configure the panel settings * * @return FieldList */ public function getConfiguration() { $fields = parent::getConfiguration(); $grids = array(); if ($this->SubjectPage()->exists()) { $grids = $this->getGridFieldsFor($this->SubjectPage()); } $fields->push(TextField::create("Count", _t('DashbordModelAdmin.COUNT', 'Number of records to display'))); $fields->push(DropdownField::create("SubjectPageID", _t('Dashboard.PAGE', 'Page'), $this->getHierarchy(0))->addExtraClass('no-chzn')->setAttribute('data-lookupurl', $this->Link("gridsforpage"))->setEmptyString("--- " . _t('Dashboard.PLEASESELECT', 'Please select') . " ---")->setTemplate("DashboardDropdownField")); $fields->push(DropdownField::create("GridFieldName", _t('Dashboard.GRIDFIELDNAME', 'GridField name'), $grids)->addExtraClass('no-chzn')); return $fields; }
/** * Gets the fields to configure the panel settings * * @return FieldList */ public function getConfiguration() { $fields = parent::getConfiguration(); $modeladmins = array(); $models = $this->getManagedModelsFor($this->ModelAdminClass); foreach (SS_ClassLoader::instance()->getManifest()->getDescendantsOf("ModelAdmin") as $class) { $SNG = Injector::inst()->get($class); if ($SNG instanceof TestOnly) { continue; } $title = Config::inst()->get($class, "menu_title", Config::INHERITED); $modeladmins[$class] = $title ? $title : $class; } $fields->push(TextField::create("Count", _t('DashbordModelAdmin.COUNT', 'Number of records to display'))); $fields->push(DropdownField::create("ModelAdminClass", _t('Dashboard.MODELADMINCLASS', 'Model admin tab'), $modeladmins)->addExtraClass('no-chzn')->setAttribute('data-lookupurl', $this->Link("modelsforpanel"))->setEmptyString("--- " . _t('Dashboard.PLEASESELECT', 'Please select') . " ---")); $fields->push(DropdownField::create("ModelAdminModel", _t('Dashboard.MODELADMINMODEL', 'Model'), $models)->addExtraClass('no-chzn')); return $fields; }
/** * Gets the configuration FieldList for this panel * * @return FieldList */ public function getConfiguration() { $fields = parent::getConfiguration(); if (!$this->isValid()) { $fields->push(LiteralField::create("warning", _t('Dashboard.NOGOOGLEACCOUNT', '<p>You have not configured a valid Google Analytics account.</p>'))); return $fields; } $pages = $this->getHierarchy(0); $fields->push(OptionsetField::create("PathType", _t('Dashboard.FILTERBYPAGE', 'Filter'), array('none' => _t('Dashboard.NONESHOWALL', 'No filter. Show analytics for the entire site'), 'list' => _t('Dashboard.PAGEINLIST', 'Filter by a specific page in the tree'), 'custom' => _t('Dashboard.ACUSTOMPATH', 'Filter by a specific path')))); $fields->push(DropdownField::create("SubjectPageID", '', $pages)->addExtraClass('no-chzn')->setEmptyString("-- " . _t('Dashboard.PLEASESELECT', 'Please select') . " --")); $fields->push(TextField::create("CustomPath", '')->setAttribute('placeholder', 'e.g. /about-us/contact')); $fields->push(DropdownField::create("DateFormat", _t('Dashboard.DATEFORMAT', 'Date format'), array('dmy' => date('j M, Y'), 'mdy' => date('M j, Y')))->addExtraClass('no-chzn')); $fields->push(DropdownField::create("DateRange", _t('Dashboard.DATERANGE', 'Date range'), array('day' => _t('Dashboard.TODAY', 'Today'), 'week' => _t('Dashboard.PREVIOUSSEVENDAYS', '7 days'), 'month' => _t('Dashboard.PREVIOUSTHIRTYDAYS', '30 days'), 'year' => _t('Dashboard.PREVIOUSYEAR', '365 days')))->addExtraClass('no-chzn')); return $fields; }
public function getConfiguration() { $fields = parent::getConfiguration(); $fields->push(TextField::create("Count", "Number of orders to show")); return $fields; }
public function getConfiguration() { $fields = parent::getConfiguration(); $fields->push(DashboardHasManyRelationEditor::create($this, "Links", "DashboardQuickLink")); return $fields; }
public function getConfiguration() { $fields = parent::getConfiguration(); $fields->push(TextField::create("Count", _t('DashboardCustomerQuestions.COUNT', 'Number of submitted forms to display'))); return $fields; }
public function getConfiguration() { $fields = parent::getConfiguration(); $fields->push(DropdownField::create("BlogHolderID", "Choose a page to link to:", DataList::create("BlogHolder")->map("ID", "Title", "Please Select"))); return $fields; }
public function getConfiguration() { $fields = parent::getConfiguration(); $fields->push(TextField::create("Count", _t('ShopDashboard.NUMBER_OF_ACCOUNTS', "Number of accounts to show"))); return $fields; }
public function getConfiguration() { $fields = parent::getConfiguration(); return $fields; }
public function getConfiguration() { $fields = parent::getConfiguration(); $fields->push(TextField::create("Count", _t('DashboardRecentEdits.COUNT', 'Number of pages to display'))); return $fields; }
public function getConfiguration() { $fields = parent::getConfiguration(); $fields->push(TextField::create("Days", _t('ShopDashboard.NumberOfDays', "Number of days to show"))); return $fields; }