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(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("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;
 }
Ejemplo n.º 4
0
 /**
  * A controller action that handles the reordering of the panels
  *
  * @param SS_HTTPRequest The current request
  * @return SS_HTTPResponse
  */
 public function sort(SS_HTTPRequest $r)
 {
     if ($sort = $r->requestVar('dashboard-panel')) {
         foreach ($sort as $index => $id) {
             if ($panel = DashboardPanel::get()->byID((int) $id)) {
                 if ($panel->MemberID == Member::currentUserID()) {
                     $panel->SortOrder = $index;
                     $panel->write();
                 }
             }
         }
     }
 }
 public function getConfiguration()
 {
     $fields = parent::getConfiguration();
     $fields->push(TextField::create("Count", _t('DashboardRecentEdits.COUNT', 'Number of pages to display')));
     return $fields;
 }
 /**
  * Overload the renderer to load requirements
  *
  * @return SSViewer
  */
 public function PanelHolder()
 {
     Requirements::javascript("dashboard/javascript/dashboard-gridfield-panel.js");
     return parent::PanelHolder();
 }
 /**
  * Loads the requirements before rendering the panel.
  *
  * @return SSViewer
  */
 public function PanelHolder()
 {
     Requirements::javascript("dashboard/javascript/dashboard-google-analytics.js");
     Requirements::css("dashboard/css/dashboard-google-analytics.css");
     return parent::PanelHolder();
 }
 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(TextField::create("Days", _t('ShopDashboard.NumberOfDays', "Number of days to show")));
     return $fields;
 }
 public function getSecondaryActions()
 {
     if (!$this->Subject || !$this->ParentID) {
         return false;
     }
     $actions = parent::getSecondaryActions();
     $actions->push(DashboardPanelAction::create($this->ViewAllLink(), sprintf(_t('Dashboard.VIEWALL', 'View all %s'), $this->SubjectPluralName())));
     return $actions;
 }
 public function PanelHolder()
 {
     Requirements::css("dashboard/css/dashboard-weather.css");
     return parent::PanelHolder();
 }
 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 PanelHolder()
 {
     Requirements::javascript("dashboard/javascript/dashboard-blog-entry.js");
     return parent::PanelHolder();
 }