コード例 #1
0
ファイル: add.php プロジェクト: nickmancol/forkcms-rhcloud
 /**
  * Load the form
  */
 private function loadForm()
 {
     // gender dropdown values
     $genderValues = array('male' => SpoonFilter::ucfirst(BL::getLabel('Male')), 'female' => SpoonFilter::ucfirst(BL::getLabel('Female')));
     // birthdate dropdown values
     $days = range(1, 31);
     $months = SpoonLocale::getMonths(BL::getInterfaceLanguage());
     $years = range(date('Y'), 1900);
     // create form
     $this->frm = new BackendForm('add');
     // create elements
     $this->frm->addText('email');
     $this->frm->addPassword('password');
     $this->frm->addText('display_name');
     $this->frm->addText('first_name');
     $this->frm->addText('last_name');
     $this->frm->addText('city');
     $this->frm->addDropdown('gender', $genderValues);
     $this->frm->addDropdown('day', array_combine($days, $days));
     $this->frm->addDropdown('month', $months);
     $this->frm->addDropdown('year', array_combine($years, $years));
     $this->frm->addDropdown('country', SpoonLocale::getCountries(BL::getInterfaceLanguage()));
     // set default elements dropdowns
     $this->frm->getField('gender')->setDefaultElement('');
     $this->frm->getField('day')->setDefaultElement('');
     $this->frm->getField('month')->setDefaultElement('');
     $this->frm->getField('year')->setDefaultElement('');
     $this->frm->getField('country')->setDefaultElement('');
 }
コード例 #2
0
ファイル: add.php プロジェクト: naujasdizainas/forkcms
 /**
  * Load the form
  */
 private function loadForm()
 {
     $this->imageIsAllowed = BackendModel::getModuleSetting($this->URL->getModule(), 'show_image_form', true);
     $this->frm = new BackendForm('add');
     // set hidden values
     $rbtHiddenValues[] = array('label' => BL::lbl('Hidden', $this->URL->getModule()), 'value' => 'Y');
     $rbtHiddenValues[] = array('label' => BL::lbl('Published'), 'value' => 'N');
     // get categories
     $categories = BackendBlogModel::getCategories();
     $categories['new_category'] = SpoonFilter::ucfirst(BL::getLabel('AddCategory'));
     // create elements
     $this->frm->addText('title', null, null, 'inputText title', 'inputTextError title');
     $this->frm->addEditor('text');
     $this->frm->addEditor('introduction');
     $this->frm->addRadiobutton('hidden', $rbtHiddenValues, 'N');
     $this->frm->addCheckbox('allow_comments', BackendModel::getModuleSetting($this->getModule(), 'allow_comments', false));
     $this->frm->addDropdown('category_id', $categories, SpoonFilter::getGetValue('category', null, null, 'int'));
     if (count($categories) != 2) {
         $this->frm->getField('category_id')->setDefaultElement('');
     }
     $this->frm->addDropdown('user_id', BackendUsersModel::getUsers(), BackendAuthentication::getUser()->getUserId());
     $this->frm->addText('tags', null, null, 'inputText tagBox', 'inputTextError tagBox');
     $this->frm->addDate('publish_on_date');
     $this->frm->addTime('publish_on_time');
     if ($this->imageIsAllowed) {
         $this->frm->addImage('image');
     }
     // meta
     $this->meta = new BackendMeta($this->frm, null, 'title', true);
 }
コード例 #3
0
ファイル: model.php プロジェクト: netconstructor/forkcms
 /**
  * Calculate time ago.
  *
  * @return	string
  * @param	int $timestamp		Unix timestamp from the past.
  */
 public static function calculateTimeAgo($timestamp)
 {
     // calculate difference
     $secondsBetween = time() - $timestamp;
     // calculate
     $hours = floor($secondsBetween / (60 * 60));
     $minutes = floor($secondsBetween / 60);
     $seconds = floor($secondsBetween);
     // today start
     $todayStart = (int) strtotime(date('d F Y'));
     // today
     if ($timestamp >= $todayStart) {
         // today
         if ($hours >= 1) {
             return BL::getLabel('Today') . ' ' . date('H:i', $timestamp);
         } elseif ($minutes > 1) {
             return sprintf(BL::getLabel('MinutesAgo'), $minutes);
         } elseif ($minutes == 1) {
             return BL::getLabel('OneMinuteAgo');
         } elseif ($seconds > 1) {
             return sprintf(BL::getLabel('SecondsAgo'), $seconds);
         } elseif ($seconds <= 1) {
             return BL::getLabel('OneSecondAgo');
         }
     } elseif ($timestamp < $todayStart && $timestamp >= $todayStart - 86400) {
         return BL::getLabel('Yesterday') . ' ' . date('H:i', $timestamp);
     } else {
         return date('d/m/Y H:i', $timestamp);
     }
 }
コード例 #4
0
ファイル: add.php プロジェクト: naujasdizainas/forkcms
 /**
  * Load the form
  */
 private function loadForm()
 {
     $this->frm = new BackendForm('add');
     $this->frm->addText('name');
     $this->frm->addDropdown('method', array('database' => BL::getLabel('MethodDatabase'), 'database_email' => BL::getLabel('MethodDatabaseEmail')), 'database_email');
     $this->frm->addText('email');
     $this->frm->addText('identifier', BackendFormBuilderModel::createIdentifier());
     $this->frm->addEditor('success_message');
 }
コード例 #5
0
ファイル: edit.php プロジェクト: netconstructor/forkcms
 /**
  * Load the form
  *
  * @return	void
  */
 private function loadForm()
 {
     // create form
     $this->frm = new BackendForm('edit');
     // create elements
     $this->frm->addText('name', $this->record['name']);
     $this->frm->addDropdown('method', array('database' => BL::getLabel('MethodDatabase'), 'database_email' => BL::getLabel('MethodDatabaseEmail')), $this->record['method']);
     $this->frm->addText('email', $this->record['email']);
     $this->frm->addText('identifier', $this->record['identifier']);
     $this->frm->addEditor('success_message', $this->record['success_message']);
     // textfield dialog
     $this->frm->addText('textbox_label');
     $this->frm->addText('textbox_value');
     $this->frm->addCheckbox('textbox_required');
     $this->frm->addText('textbox_required_error_message');
     $this->frm->addDropdown('textbox_validation', array('' => '', 'email' => BL::getLabel('Email'), 'numeric' => BL::getLabel('Numeric')));
     $this->frm->addText('textbox_validation_parameter');
     $this->frm->addText('textbox_error_message');
     // textarea dialog
     $this->frm->addText('textarea_label');
     $this->frm->addTextarea('textarea_value');
     $this->frm->getField('textarea_value')->setAttribute('cols', 30);
     $this->frm->addCheckbox('textarea_required');
     $this->frm->addText('textarea_required_error_message');
     $this->frm->addDropdown('textarea_validation', array('' => ''));
     $this->frm->addText('textarea_validation_parameter');
     $this->frm->addText('textarea_error_message');
     // dropdown dialog
     $this->frm->addText('dropdown_label');
     $this->frm->addText('dropdown_values');
     $this->frm->addDropdown('dropdown_default_value', array('' => ''))->setAttribute('rel', 'dropDownValues');
     $this->frm->addCheckbox('dropdown_required');
     $this->frm->addText('dropdown_required_error_message');
     // radiobutton dialog
     $this->frm->addText('radiobutton_label');
     $this->frm->addText('radiobutton_values');
     $this->frm->addDropdown('radiobutton_default_value', array('' => ''))->setAttribute('rel', 'radioButtonValues');
     $this->frm->addCheckbox('radiobutton_required');
     $this->frm->addText('radiobutton_required_error_message');
     // checkbox dialog
     $this->frm->addText('checkbox_label');
     $this->frm->addText('checkbox_values');
     $this->frm->addDropdown('checkbox_default_value', array('' => ''))->setAttribute('rel', 'checkBoxValues');
     $this->frm->addCheckbox('checkbox_required');
     $this->frm->addText('checkbox_required_error_message');
     // heading dialog
     $this->frm->addText('heading');
     // paragraph dialog
     $this->frm->addTextarea('paragraph');
     $this->frm->getField('paragraph')->setAttribute('cols', 30);
     // submit dialog
     $this->frm->addText('submit');
 }
コード例 #6
0
ファイル: categories.php プロジェクト: naujasdizainas/forkcms
 /**
  * Convert the count in a human readable one.
  *
  * @param int $count The count.
  * @param string $link The link for the count.
  * @return string
  */
 public static function setClickableCount($count, $link)
 {
     $count = (int) $count;
     $link = (string) $link;
     $return = '';
     if ($count > 1) {
         $return = '<a href="' . $link . '">' . $count . ' ' . BL::getLabel('Articles') . '</a>';
     } elseif ($count == 1) {
         $return = '<a href="' . $link . '">' . $count . ' ' . BL::getLabel('Article') . '</a>';
     }
     return $return;
 }
コード例 #7
0
ファイル: index.php プロジェクト: naujasdizainas/forkcms
 /**
  * Load the datagrids
  */
 private function loadDataGrid()
 {
     $this->dataGrid = new BackendDataGridDB(BackendFormBuilderModel::QRY_BROWSE, BL::getWorkingLanguage());
     $this->dataGrid->setHeaderLabels(array('email' => SpoonFilter::ucfirst(BL::getLabel('Recipient')), 'sent_forms' => ''));
     $this->dataGrid->setSortingColumns(array('name', 'email', 'method', 'sent_forms'), 'name');
     $this->dataGrid->setColumnFunction(array('BackendFormBuilderModel', 'formatRecipients'), array('[email]'), 'email');
     $this->dataGrid->setColumnFunction(array('BackendFormBuilderModel', 'getLocale'), array('Method_[method]'), 'method');
     $this->dataGrid->setColumnFunction(array('BackendFormBuilderIndex', 'parseNumForms'), array('[id]', '[sent_forms]'), 'sent_forms');
     // check if edit action is allowed
     if (BackendAuthentication::isAllowedAction('edit')) {
         $this->dataGrid->setColumnURL('name', BackendModel::createURLForAction('edit') . '&amp;id=[id]');
         $this->dataGrid->addColumn('edit', null, BL::getLabel('Edit'), BackendModel::createURLForAction('edit') . '&amp;id=[id]', BL::getLabel('Edit'));
     }
 }
コード例 #8
0
ファイル: categories.php プロジェクト: naujasdizainas/forkcms
 /**
  * Convert the count in a human readable one.
  *
  * @param int $count
  * @param string $link
  * @return string
  */
 public static function setClickableCount($count, $link)
 {
     // redefine
     $count = (int) $count;
     $link = (string) $link;
     // return link in case of more than one item, one item, other
     if ($count > 1) {
         return '<a href="' . $link . '">' . $count . ' ' . BL::getLabel('Questions') . '</a>';
     }
     if ($count == 1) {
         return '<a href="' . $link . '">' . $count . ' ' . BL::getLabel('Question') . '</a>';
     }
     return '';
 }
コード例 #9
0
ファイル: index.php プロジェクト: netconstructor/forkcms
 /**
  * Load the datagrids
  *
  * @return	void
  */
 private function loadDataGrid()
 {
     // create datagrid
     $this->dataGrid = new BackendDataGridDB(BackendFormBuilderModel::QRY_BROWSE, BL::getWorkingLanguage());
     // set headers
     $this->dataGrid->setHeaderLabels(array('email' => ucfirst(BL::getLabel('Recipient')), 'sent_forms' => ''));
     // sorting columns
     $this->dataGrid->setSortingColumns(array('name', 'email', 'method', 'sent_forms'), 'name');
     // set colum URLs
     $this->dataGrid->setColumnURL('name', BackendModel::createURLForAction('edit') . '&amp;id=[id]');
     // set method label
     $this->dataGrid->setColumnFunction(array('BackendFormBuilderModel', 'getLocale'), array('Method_[method]'), 'method');
     // set the amount of sent forms
     $this->dataGrid->setColumnFunction(array('BackendFormBuilderIndex', 'parseNumForms'), array('[id]', '[sent_forms]'), 'sent_forms');
     // add edit column
     $this->dataGrid->addColumn('edit', null, BL::getLabel('Edit'), BackendModel::createURLForAction('edit') . '&amp;id=[id]', BL::getLabel('Edit'));
 }
コード例 #10
0
 /**
  * Load the data grid for installable modules.
  */
 private function loadDataGridInstallable()
 {
     // create datagrid
     $this->dataGridInstallableModules = new BackendDataGridArray($this->installableModules);
     $this->dataGridInstallableModules->setSortingColumns(array('raw_name'));
     $this->dataGridInstallableModules->setHeaderLabels(array('raw_name' => SpoonFilter::ucfirst(BL::getLabel('Name'))));
     $this->dataGridInstallableModules->setColumnsHidden(array('installed', 'name', 'cronjobs_active'));
     // check if this action is allowed
     if (BackendAuthentication::isAllowedAction('detail_module')) {
         $this->dataGridInstallableModules->setColumnURL('raw_name', BackendModel::createURLForAction('detail_module') . '&amp;module=[raw_name]');
         $this->dataGridInstallableModules->addColumn('details', null, BL::lbl('Details'), BackendModel::createURLForAction('detail_module') . '&amp;module=[raw_name]', BL::lbl('Details'));
     }
     // check if this action is allowed
     if (BackendAuthentication::isAllowedAction('install_module')) {
         // add install column
         $this->dataGridInstallableModules->addColumn('install', null, BL::lbl('Install'), BackendModel::createURLForAction('install_module') . '&amp;module=[raw_name]', BL::lbl('Install'));
         $this->dataGridInstallableModules->setColumnConfirm('install', sprintf(BL::msg('ConfirmModuleInstall'), '[raw_name]'), null, SpoonFilter::ucfirst(BL::lbl('Install')) . '?');
     }
 }
コード例 #11
0
ファイル: model.php プロジェクト: naujasdizainas/forkcms
 /**
  * Get modules based on the directory listing in the backend application.
  *
  * If a module contains a info.xml it will be parsed.
  *
  * @return array
  */
 public static function getModules()
 {
     // get installed modules
     $installedModules = (array) BackendModel::getDB()->getRecords('SELECT name FROM modules', null, 'name');
     // get modules present on the filesystem
     $modules = SpoonDirectory::getList(BACKEND_MODULES_PATH, false, null, '/^[a-zA-Z0-9_]+$/');
     // all modules that are managable in the backend
     $managableModules = array();
     // get more information for each module
     foreach ($modules as $moduleName) {
         // skip ignored modules
         if (in_array($moduleName, self::$ignoredModules)) {
             continue;
         }
         // init module information
         $module = array();
         $module['id'] = 'module_' . $moduleName;
         $module['raw_name'] = $moduleName;
         $module['name'] = SpoonFilter::ucfirst(BL::getLabel(SpoonFilter::toCamelCase($moduleName)));
         $module['description'] = '';
         $module['version'] = '';
         $module['installed'] = false;
         $module['cronjobs_active'] = true;
         // the module is present in the database, that means its installed
         if (isset($installedModules[$moduleName])) {
             $module['installed'] = true;
         }
         // get extra info from the info.xml
         try {
             $infoXml = @new SimpleXMLElement(BACKEND_MODULES_PATH . '/' . $module['raw_name'] . '/info.xml', LIBXML_NOCDATA, true);
             // process XML to a clean array
             $info = self::processModuleXml($infoXml);
             // set fields if they were found in the XML
             if (isset($info['description'])) {
                 $module['description'] = BackendDataGridFunctions::truncate($info['description'], 80);
             }
             if (isset($info['version'])) {
                 $module['version'] = $info['version'];
             }
             // check if cronjobs are set
             if (isset($info['cronjobs'])) {
                 // go search whether or not all or active
                 foreach ($info['cronjobs'] as $cronjob) {
                     if (!$cronjob['active']) {
                         $module['cronjobs_active'] = false;
                         break;
                     }
                 }
             }
         } catch (Exception $e) {
             // don't act upon error, we simply won't possess some info
         }
         // add to list of managable modules
         $managableModules[] = $module;
     }
     return $managableModules;
 }
コード例 #12
0
ファイル: groups.php プロジェクト: netconstructor/forkcms
 /**
  * Parse amount of profiles for the datagrid.
  *
  * @return	string
  * @param	int $groupId		Group id.
  * @param	int $numProfiles	Number of profiles.
  */
 public static function parseNumProfiles($groupId, $numProfiles)
 {
     // 1 item
     if ($numProfiles == 1) {
         $output = '1 ' . BL::getLabel('Profile');
     } else {
         $output = $numProfiles . ' ' . BL::getLabel('Profiles');
     }
     // complete output
     return '<a href="' . BackendModel::createURLForAction('index') . '&amp;group=' . $groupId . '" title="' . $output . '">' . $output . '</a>';
 }
コード例 #13
0
ファイル: data.php プロジェクト: naujasdizainas/forkcms
 /**
  * Load the datagrids
  */
 private function loadDataGrid()
 {
     list($query, $parameters) = $this->buildQuery();
     // create datagrid
     $this->dataGrid = new BackendDataGridDB($query, $parameters);
     // overrule default URL
     $this->dataGrid->setURL(BackendModel::createURLForAction(null, null, null, array('offset' => '[offset]', 'order' => '[order]', 'sort' => '[sort]', 'start_date' => $this->filter['start_date'], 'end_date' => $this->filter['end_date']), false) . '&amp;id=' . $this->id);
     // sorting columns
     $this->dataGrid->setSortingColumns(array('sent_on'), 'sent_on');
     $this->dataGrid->setSortParameter('desc');
     // check if this action is allowed
     if (BackendAuthentication::isAllowedAction('data_details')) {
         // set colum URLs
         $this->dataGrid->setColumnURL('sent_on', BackendModel::createURLForAction('data_details', null, null, array('start_date' => $this->filter['start_date'], 'end_date' => $this->filter['end_date']), false) . '&amp;id=[id]');
         // add edit column
         $this->dataGrid->addColumn('details', null, BL::getLabel('Details'), BackendModel::createURLForAction('data_details', null, null, array('start_date' => $this->filter['start_date'], 'end_date' => $this->filter['end_date'])) . '&amp;id=[id]', BL::getLabel('Details'));
     }
     // date
     $this->dataGrid->setColumnFunction(array('BackendFormBuilderModel', 'calculateTimeAgo'), '[sent_on]', 'sent_on', false);
     $this->dataGrid->setColumnFunction('ucfirst', '[sent_on]', 'sent_on', false);
     // add the multicheckbox column
     $this->dataGrid->setMassActionCheckboxes('checkbox', '[id]');
     // mass action
     $ddmMassAction = new SpoonFormDropdown('action', array('delete' => BL::getLabel('Delete')), 'delete');
     $ddmMassAction->setOptionAttributes('delete', array('data-message-id' => 'confirmDelete'));
     $this->dataGrid->setMassAction($ddmMassAction);
 }
コード例 #14
0
ファイル: index.php プロジェクト: netconstructor/forkcms
 /**
  * Load the datagrid
  *
  * @return	void
  */
 private function loadDataGrid()
 {
     // fetch query and parameters
     list($query, $parameters) = $this->buildQuery();
     // create datagrid
     $this->dgProfiles = new BackendDataGridDB($query, $parameters);
     // overrule default URL
     $this->dgProfiles->setURL(BackendModel::createURLForAction(null, null, null, array('offset' => '[offset]', 'order' => '[order]', 'sort' => '[sort]', 'email' => $this->filter['email'], 'status' => $this->filter['status'], 'group' => $this->filter['group']), false));
     // sorting columns
     $this->dgProfiles->setSortingColumns(array('email', 'display_name', 'status', 'registered_on'), 'email');
     // set column URLs
     $this->dgProfiles->setColumnURL('email', BackendModel::createURLForAction('edit') . '&amp;id=[id]');
     // set column function
     $this->dgProfiles->setColumnFunction(array('BackendDataGridFunctions', 'getLongDate'), array('[registered_on]'), 'registered_on', true);
     // add columns
     $this->dgProfiles->addColumn('edit', null, BL::getLabel('Edit'), BackendModel::createURLForAction('edit', null, null, null) . '&amp;id=[id]', BL::getLabel('Edit'));
     // add the mass action controls
     $this->dgProfiles->setMassActionCheckboxes('checkbox', '[id]');
     $ddmMassAction = new SpoonFormDropdown('action', array('addToGroup' => BL::getLabel('AddToGroup'), 'delete' => BL::getLabel('Delete')), 'addToGroup');
     $ddmMassAction->setAttribute('id', 'massAction');
     $ddmMassAction->setOptionAttributes('addToGroup', array('data-message-id' => 'confirmAddToGroup'));
     $ddmMassAction->setOptionAttributes('delete', array('data-message-id' => 'confirmDelete'));
     $this->dgProfiles->setMassAction($ddmMassAction);
 }
コード例 #15
0
ファイル: edit.php プロジェクト: naujasdizainas/forkcms
 /**
  * Load the form
  */
 private function loadForm()
 {
     // create form
     $this->frm = new BackendForm('edit');
     // set hidden values
     $rbtHiddenValues[] = array('label' => BL::lbl('Hidden'), 'value' => 'Y');
     $rbtHiddenValues[] = array('label' => BL::lbl('Published'), 'value' => 'N');
     // get categories
     $categories = BackendBlogModel::getCategories();
     $categories['new_category'] = SpoonFilter::ucfirst(BL::getLabel('AddCategory'));
     // create elements
     $this->frm->addText('title', $this->record['title'], null, 'inputText title', 'inputTextError title');
     $this->frm->addEditor('text', $this->record['text']);
     $this->frm->addEditor('introduction', $this->record['introduction']);
     $this->frm->addRadiobutton('hidden', $rbtHiddenValues, $this->record['hidden']);
     $this->frm->addCheckbox('allow_comments', $this->record['allow_comments'] === 'Y' ? true : false);
     $this->frm->addDropdown('category_id', $categories, $this->record['category_id']);
     if (count($categories) != 2) {
         $this->frm->getField('category_id')->setDefaultElement('');
     }
     $this->frm->addDropdown('user_id', BackendUsersModel::getUsers(), $this->record['user_id']);
     $this->frm->addText('tags', BackendTagsModel::getTags($this->URL->getModule(), $this->record['id']), null, 'inputText tagBox', 'inputTextError tagBox');
     $this->frm->addDate('publish_on_date', $this->record['publish_on']);
     $this->frm->addTime('publish_on_time', date('H:i', $this->record['publish_on']));
     if ($this->imageIsAllowed) {
         $this->frm->addImage('image');
         $this->frm->addCheckbox('delete_image');
     }
     // meta object
     $this->meta = new BackendMeta($this->frm, $this->record['meta_id'], 'title', true);
     // set callback for generating a unique URL
     $this->meta->setUrlCallback('BackendBlogModel', 'getURL', array($this->record['id']));
 }
コード例 #16
0
ファイル: edit.php プロジェクト: netconstructor/forkcms
 /**
  * Load the data grid with groups.
  *
  * @return	void
  */
 private function loadGroups()
 {
     // create the data grid
     $this->dgGroups = new BackendDataGridDB(BackendProfilesModel::QRY_DATAGRID_BROWSE_PROFILE_GROUPS, array($this->profile['id']));
     // sorting columns
     $this->dgGroups->setSortingColumns(array('group_name'), 'group_name');
     // disable paging
     $this->dgGroups->setPaging(false);
     // set column URLs
     $this->dgGroups->setColumnURL('group_name', BackendModel::createURLForAction('edit_profile_group') . '&amp;id=[id]&amp;profile_id=' . $this->id);
     // set column function
     $this->dgGroups->setColumnFunction(array('BackendDataGridFunctions', 'getLongDate'), array('[expires_on]'), 'expires_on', true);
     // edit column
     $this->dgGroups->addColumn('edit', null, BL::getLabel('Edit'), BackendModel::createURLForAction('edit_profile_group') . '&amp;id=[id]&amp;profile_id=' . $this->id, BL::getLabel('Edit'));
 }
コード例 #17
0
ファイル: meta.php プロジェクト: naujasdizainas/forkcms
 /**
  * Add all element into the form
  */
 protected function loadForm()
 {
     // is the form submitted?
     if ($this->frm->isSubmitted()) {
         /**
          * If the fields are disabled we don't have any values in the post. When an error occurs in the other fields of the form the meta-fields would be cleared
          * therefore we alter the POST so it contains the initial values.
          */
         if (!isset($_POST['page_title'])) {
             $_POST['page_title'] = isset($this->data['title']) ? $this->data['title'] : null;
         }
         if (!isset($_POST['meta_description'])) {
             $_POST['meta_description'] = isset($this->data['description']) ? $this->data['description'] : null;
         }
         if (!isset($_POST['meta_keywords'])) {
             $_POST['meta_keywords'] = isset($this->data['keywords']) ? $this->data['keywords'] : null;
         }
         if (!isset($_POST['url'])) {
             $_POST['url'] = isset($this->data['url']) ? $this->data['url'] : null;
         }
         if ($this->custom && !isset($_POST['meta_custom'])) {
             $_POST['meta_custom'] = isset($this->data['custom']) ? $this->data['custom'] : null;
         }
         if (!isset($_POST['seo_index'])) {
             $_POST['seo_index'] = isset($this->data['data']['seo_index']) ? $this->data['data']['seo_index'] : 'none';
         }
         if (!isset($_POST['seo_follow'])) {
             $_POST['seo_follow'] = isset($this->data['data']['seo_follow']) ? $this->data['data']['seo_follow'] : 'none';
         }
     }
     // add page title elements into the form
     $this->frm->addCheckbox('page_title_overwrite', isset($this->data['title_overwrite']) && $this->data['title_overwrite'] == 'Y');
     $this->frm->addText('page_title', isset($this->data['title']) ? $this->data['title'] : null);
     // add meta description elements into the form
     $this->frm->addCheckbox('meta_description_overwrite', isset($this->data['description_overwrite']) && $this->data['description_overwrite'] == 'Y');
     $this->frm->addText('meta_description', isset($this->data['description']) ? $this->data['description'] : null);
     // add meta keywords elements into the form
     $this->frm->addCheckbox('meta_keywords_overwrite', isset($this->data['keywords_overwrite']) && $this->data['keywords_overwrite'] == 'Y');
     $this->frm->addText('meta_keywords', isset($this->data['keywords']) ? $this->data['keywords'] : null);
     // add URL elements into the form
     $this->frm->addCheckbox('url_overwrite', isset($this->data['url_overwrite']) && $this->data['url_overwrite'] == 'Y');
     $this->frm->addText('url', isset($this->data['url']) ? urldecode($this->data['url']) : null);
     // advanced SEO
     $indexValues = array(array('value' => 'none', 'label' => BL::getLabel('None')), array('value' => 'index', 'label' => 'index'), array('value' => 'noindex', 'label' => 'noindex'));
     $this->frm->addRadiobutton('seo_index', $indexValues, isset($this->data['data']['seo_index']) ? $this->data['data']['seo_index'] : 'none');
     $followValues = array(array('value' => 'none', 'label' => BL::getLabel('None')), array('value' => 'follow', 'label' => 'follow'), array('value' => 'nofollow', 'label' => 'nofollow'));
     $this->frm->addRadiobutton('seo_follow', $followValues, isset($this->data['data']['seo_follow']) ? $this->data['data']['seo_follow'] : 'none');
     // should we add the meta-custom field
     if ($this->custom) {
         // add meta custom element into the form
         $this->frm->addTextarea('meta_custom', isset($this->data['custom']) ? $this->data['custom'] : null);
     }
     $this->frm->addHidden('meta_id', $this->id);
     $this->frm->addHidden('base_field_name', $this->baseFieldName);
     $this->frm->addHidden('custom', $this->custom);
     $this->frm->addHidden('class_name', $this->callback['class']);
     $this->frm->addHidden('method_name', $this->callback['method']);
     $this->frm->addHidden('parameters', SpoonFilter::htmlspecialchars(serialize($this->callback['parameters'])));
 }
コード例 #18
0
ファイル: groups.php プロジェクト: naujasdizainas/forkcms
 /**
  * Parse amount of profiles for the datagrid.
  *
  * @param int $groupId Group id.
  * @param int $numProfiles Number of profiles.
  * @return string
  */
 public static function parseNumProfiles($groupId, $numProfiles)
 {
     // 1 item
     if ($numProfiles == 1) {
         $output = '1 ' . BL::getLabel('Profile');
     } else {
         $output = $numProfiles . ' ' . BL::getLabel('Profiles');
     }
     // check if this action is allowed
     if (BackendAuthentication::isAllowedAction('edit')) {
         // complete output
         $output = '<a href="' . BackendModel::createURLForAction('index') . '&amp;group=' . $groupId . '" title="' . $output . '">' . $output . '</a>';
     }
     return $output;
 }
コード例 #19
0
 /**
  * Load the data grid which contains the cronjobs.
  */
 private function loadDataGridCronjobs()
 {
     // no cronjobs = dont bother
     if (!isset($this->information['cronjobs'])) {
         return;
     }
     // create data grid
     $this->dataGridCronjobs = new BackendDataGridArray($this->information['cronjobs']);
     // hide columns
     $this->dataGridCronjobs->setColumnsHidden(array('minute', 'hour', 'day-of-month', 'month', 'day-of-week', 'action', 'description', 'active'));
     // add cronjob data column
     $this->dataGridCronjobs->addColumn('cronjob', BL::getLabel('Cronjob'), '[description]<br /><strong>[minute] [hour] [day-of-month] [month] [day-of-week]</strong> php ' . PATH_WWW . '/backend/cronjob.php module=<strong>' . $this->currentModule . '</strong> action=<strong>[action]</strong>', null, null, null, 0);
     // no paging
     $this->dataGridCronjobs->setPaging(false);
 }