/** * Loads the settings form */ private function loadForm() { // init settings form $this->frm = new BackendForm('settings'); $settings = BackendModel::get('fork.settings')->getForModule('Agenda'); $this->frm->addText('width1', $settings['width1']); $this->frm->addText('height1', $settings['height1']); $this->frm->addCheckbox('allow_enlargment1', $settings['allow_enlargment1']); $this->frm->addCheckbox('force_aspect_ratio1', $settings['force_aspect_ratio1']); $this->frm->addText('width1', $settings['width2']); $this->frm->addText('height1', $settings['height2']); $this->frm->addCheckbox('allow_enlargment2', $settings['allow_enlargment2']); $this->frm->addCheckbox('force_aspect_ratio2', $settings['force_aspect_ratio2']); $this->frm->addText('width3', $settings['width3']); $this->frm->addText('height3', $settings['height3']); $this->frm->addCheckbox('allow_enlargment3', $settings['allow_enlargment3']); $this->frm->addCheckbox('force_aspect_ratio3', $settings['force_aspect_ratio3']); $this->frm->addCheckbox('allow_subscriptions', $settings['allow_subscriptions']); $this->frm->addCheckbox('moderation', $settings['moderation']); $this->frm->addCheckbox('notify_by_email_on_new_subscription_to_moderate', $settings['notify_by_email_on_new_subscription_to_moderate']); $this->frm->addCheckbox('notify_by_email_on_new_subscription', $settings['notify_by_email_on_new_subscription']); $this->frm->addText('cache_timeout', $settings['cache_timeout']); $this->frm->addDropdown('zoom_level', array_combine(array_merge(array('auto'), range(3, 18)), array_merge(array(BL::lbl('Auto', $this->getModule())), range(3, 18))), $this->get('fork.settings')->get($this->URL->getModule(), 'zoom_level_widget', 13)); $this->frm->addText('width', $this->get('fork.settings')->get($this->URL->getModule(), 'width')); $this->frm->addText('height', $this->get('fork.settings')->get($this->URL->getModule(), 'height')); $this->frm->addDropdown('map_type', array('ROADMAP' => BL::lbl('Roadmap', $this->getModule()), 'SATELLITE' => BL::lbl('Satellite', $this->getModule()), 'HYBRID' => BL::lbl('Hybrid', $this->getModule()), 'TERRAIN' => BL::lbl('Terrain', $this->getModule())), $this->get('fork.settings')->get($this->URL->getModule(), 'map_type_widget', 'roadmap')); }
/** * Load the form */ protected function loadForm() { // create form $this->frm = new Form('edit'); $this->frm->addText('title', $this->record['title'], null, 'inputText title', 'inputTextError title'); $this->frm->addEditor('text', $this->record['text']); //$this->frm->addText('link', $this->record['link']); $this->frm->addText('linktext', $this->record['linktext']); $this->frm->addImage('image'); // build array with options for the hidden Radiobutton $RadiobuttonHiddenValues[] = array('label' => Language::lbl('Hidden'), 'value' => 'Y'); $RadiobuttonHiddenValues[] = array('label' => Language::lbl('Published'), 'value' => 'N'); $this->frm->addRadioButton('hidden', $RadiobuttonHiddenValues, $this->record['hidden']); // get categories $categories = BackendBlocksModel::getCategories(); $this->frm->addDropdown('category_id', $categories, $this->record['category_id']); // meta $this->meta = new Meta($this->frm, $this->record['meta_id'], 'title', true); $this->meta->setUrlCallBack('Backend\\Modules\\Blocks\\Engine\\Model', 'getUrl', array($this->record['id'])); // redirect $redirectValue = 'none'; if (isset($this->record['page_id'])) { $redirectValue = 'internal'; } if (isset($this->record['link'])) { $redirectValue = 'external'; } $redirectValues = array(array('value' => 'none', 'label' => \SpoonFilter::ucfirst(Language::lbl('None'))), array('value' => 'internal', 'label' => \SpoonFilter::ucfirst(Language::lbl('InternalLink')), 'variables' => array('isInternal' => true)), array('value' => 'external', 'label' => \SpoonFilter::ucfirst(Language::lbl('ExternalLink')), 'variables' => array('isExternal' => true))); $this->frm->addRadiobutton('redirect', $redirectValues, $redirectValue); $this->frm->addDropdown('internal_redirect', BackendPagesModel::getPagesForDropdown(), $redirectValue == 'internal' ? $this->record['page_id'] : null); $this->frm->addText('external_redirect', $redirectValue == 'external' ? $this->record['link'] : null, null, null, null, true); }
/** * Load the datagrids * * @return void */ private function loadDataGrids() { // load all categories that are in use $categories = BackendSlideshowModel::getActiveCategories(true); // run over categories and create datagrid for each one foreach ($categories as $categoryId => $categoryTitle) { // create datagrid $dataGrid = new BackendDataGridDB(BackendSlideshowModel::QRY_DATAGRID_BROWSE, array(BL::getWorkingLanguage(), $categoryId)); // disable paging $dataGrid->setPaging(false); // set colum URLs $dataGrid->setColumnURL('title', BackendModel::createURLForAction('Edit') . '&id=[id]'); // set column functions $dataGrid->setColumnFunction(array(new BackendDataGridFunctions(), 'getLongDate'), array('[publish_on]'), 'publish_on', true); $dataGrid->setColumnFunction(array(new BackendDataGridFunctions(), 'getUser'), array('[user_id]'), 'user_id', true); // set headers $dataGrid->setHeaderLabels(array('user_id' => \SpoonFilter::ucfirst(BL::lbl('Author')), 'publish_on' => \SpoonFilter::ucfirst(BL::lbl('PublishedOn')))); // enable drag and drop $dataGrid->enableSequenceByDragAndDrop(); // our JS needs to know an id, so we can send the new order $dataGrid->setRowAttributes(array('id' => '[id]')); $dataGrid->setAttributes(array('data-action' => "GallerySequence")); // create a column #images $dataGrid->addColumn('images', ucfirst(BL::lbl('Images'))); $dataGrid->setColumnFunction(array('Backend\\Modules\\Slideshow\\Engine\\Model', 'getImagesByGallery'), array('[id]', true), 'images', true); // hide columns $dataGrid->setColumnsHidden(array('category_id', 'sequence', 'filename')); // add edit column $dataGrid->addColumn('edit', null, BL::lbl('Edit'), BackendModel::createURLForAction('Edit') . '&id=[id]', BL::lbl('Edit')); // set column order $dataGrid->setColumnsSequence('dragAndDropHandle', 'title', 'images', 'user_id', 'publish_on', 'edit'); // add dataGrid to list $this->dataGrids[] = array('id' => $categoryId, 'title' => $categoryTitle, 'content' => $dataGrid->getContent()); } }
/** * Load the form */ private function loadForm() { $this->isGod = BackendAuthentication::getUser()->isGod(); $this->frm = new BackendForm('settingsEmail'); // email settings $mailerFrom = $this->get('fork.settings')->get('Core', 'mailer_from'); $this->frm->addText('mailer_from_name', isset($mailerFrom['name']) ? $mailerFrom['name'] : ''); $this->frm->addText('mailer_from_email', isset($mailerFrom['email']) ? $mailerFrom['email'] : ''); $mailerTo = $this->get('fork.settings')->get('Core', 'mailer_to'); $this->frm->addText('mailer_to_name', isset($mailerTo['name']) ? $mailerTo['name'] : ''); $this->frm->addText('mailer_to_email', isset($mailerTo['email']) ? $mailerTo['email'] : ''); $mailerReplyTo = $this->get('fork.settings')->get('Core', 'mailer_reply_to'); $this->frm->addText('mailer_reply_to_name', isset($mailerReplyTo['name']) ? $mailerReplyTo['name'] : ''); $this->frm->addText('mailer_reply_to_email', isset($mailerReplyTo['email']) ? $mailerReplyTo['email'] : ''); if ($this->isGod) { $mailerType = $this->get('fork.settings')->get('Core', 'mailer_type', 'mail'); $this->frm->addDropdown('mailer_type', array('mail' => 'PHP\'s mail', 'smtp' => 'SMTP'), $mailerType); // smtp settings $this->frm->addText('smtp_server', $this->get('fork.settings')->get('Core', 'smtp_server', '')); $this->frm->addText('smtp_port', $this->get('fork.settings')->get('Core', 'smtp_port', 25)); $this->frm->addText('smtp_username', $this->get('fork.settings')->get('Core', 'smtp_username', '')); $this->frm->addPassword('smtp_password', $this->get('fork.settings')->get('Core', 'smtp_password', '')); $this->frm->addDropdown('smtp_secure_layer', array('no' => ucfirst(BL::lbl('None')), 'ssl' => 'SSL', 'tls' => 'TLS'), $this->get('fork.settings')->get('Core', 'smtp_secure_layer', 'no')); } $this->tpl->assign('isGod', $this->isGod); }
/** * Load the form */ private function loadForm() { $this->imageIsAllowed = $this->get('fork.settings')->get($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', $this->get('fork.settings')->get($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); }
/** * Load the datagrid for statistics */ private function loadStatistics() { // fetch the latest mailing $mailing = BackendMailmotorModel::getSentMailings(1); // check if a mailing was found if (empty($mailing)) { return false; } // check if a mailing was set if (!isset($mailing[0])) { return false; } // show the sent mailings block $this->tpl->assign('oSentMailings', true); // fetch the statistics for this mailing $stats = BackendMailmotorCMHelper::getStatistics($mailing[0]['id'], true); // reformat the send date $mailing[0]['sent'] = \SpoonDate::getDate('d-m-Y', $mailing[0]['sent']) . ' ' . BL::lbl('At') . ' ' . \SpoonDate::getDate('H:i', $mailing); // get results $results[] = array('label' => BL::lbl('MailmotorLatestMailing'), 'value' => $mailing[0]['name']); $results[] = array('label' => BL::lbl('MailmotorSendDate'), 'value' => $mailing[0]['sent']); $results[] = array('label' => BL::lbl('MailmotorSent'), 'value' => $stats['recipients'] . ' (' . $stats['recipients_percentage'] . ')'); $results[] = array('label' => BL::lbl('MailmotorOpened'), 'value' => $stats['unique_opens'] . ' (' . $stats['unique_opens_percentage'] . ')'); $results[] = array('label' => BL::lbl('MailmotorClicks'), 'value' => $stats['clicks_total'] . ' (' . $stats['clicks_percentage'] . ')'); // there are some results if (!empty($results)) { // get the datagrid $dataGrid = new BackendDataGridArray($results); // no pagination $dataGrid->setPaging(false); // parse the datagrid $this->tpl->assign('dgMailmotorStatistics', $dataGrid->getContent()); } }
/** * Loads the dataGrids */ private function loadDatagrids() { // load all categories $categories = BackendFaqModel::getCategories(true); // loop categories and create a dataGrid for each one foreach ($categories as $categoryId => $categoryTitle) { $dataGrid = new BackendDataGridDB(BackendFaqModel::QRY_DATAGRID_BROWSE, array(BL::getWorkingLanguage(), $categoryId)); $dataGrid->setAttributes(array('class' => 'dataGrid sequenceByDragAndDrop')); $dataGrid->setColumnsHidden(array('category_id', 'sequence')); $dataGrid->addColumn('dragAndDropHandle', null, '<span>' . BL::lbl('Move') . '</span>'); $dataGrid->setColumnsSequence('dragAndDropHandle'); $dataGrid->setColumnAttributes('question', array('class' => 'title')); $dataGrid->setColumnAttributes('dragAndDropHandle', array('class' => 'dragAndDropHandle')); $dataGrid->setRowAttributes(array('id' => '[id]')); // check if this action is allowed if (BackendAuthentication::isAllowedAction('Edit')) { $dataGrid->setColumnURL('question', BackendModel::createURLForAction('Edit') . '&id=[id]'); $dataGrid->addColumn('edit', null, BL::lbl('Edit'), BackendModel::createURLForAction('Edit') . '&id=[id]', BL::lbl('Edit')); } // add dataGrid to list $this->dataGrids[] = array('id' => $categoryId, 'title' => $categoryTitle, 'content' => $dataGrid->getContent()); } // set empty datagrid $this->emptyDatagrid = new BackendDataGridArray(array(array('dragAndDropHandle' => '', 'question' => BL::msg('NoQuestionInCategory'), 'edit' => ''))); $this->emptyDatagrid->setAttributes(array('class' => 'dataGrid sequenceByDragAndDrop emptyGrid')); $this->emptyDatagrid->setHeaderLabels(array('edit' => null, 'dragAndDropHandle' => null)); }
/** * Load the form */ protected function loadForm() { $groupCheckboxes = array(); // set hidden values $rbtActiveValues = array(); $rbtActiveValues[] = array('label' => ucfirst(BL::lbl('Active')), 'value' => 'Y'); $rbtActiveValues[] = array('label' => ucfirst(BL::lbl('NotActive')), 'value' => 'N'); // create form $this->frm = new BackendForm('edit'); $this->frm->addText('name', $this->record['name']); $this->frm->addText('email', $this->record['email']); $this->frm->addRadiobutton('active', $rbtActiveValues, $this->record['active']); //--Get all the groups $groups = BackendMailengineModel::getAllGroups(); //--Check if there are groups if (!empty($groups)) { //--Loop all the users foreach ($groups as $key => &$group) { $groupCheckboxes[] = array("label" => $group["title"], "value" => $group["id"]); } //--Get the users from the group $groupsUser = BackendMailengineModel::getGroupsForUser($this->id); //--Create a selected-array $groupCheckboxesSelected = count($groupsUser) > 0 ? array_keys($groupsUser) : null; //--Add multicheckboxes to form $this->frm->addMultiCheckbox("groups", $groupCheckboxes, $groupCheckboxesSelected); } }
/** * Load the form */ protected function loadForm() { $rbtHiddenValues[] = array('label' => BL::lbl('Published'), 'value' => 'N'); $rbtHiddenValues[] = array('label' => BL::lbl('Hidden'), 'value' => 'Y'); $this->frm = new BackendForm('edit'); $this->frm->addText('company', $this->record['company']); $this->frm->addText('name', $this->record['name']); $this->frm->addText('firstname', $this->record['firstname']); $this->frm->addText('email', $this->record['email']); $this->frm->addText('address', $this->record['address']); $this->frm->addText('zipcode', $this->record['zipcode']); $this->frm->addText('city', $this->record['city']); // $this->frm->addText('country', $this->record['country']); $this->frm->addDropdown('country', Intl::getRegionBundle()->getCountryNames(BL::getInterfaceLanguage()), $this->record['country']); $this->frm->addText('phone', $this->record['phone']); $this->frm->addText('fax', $this->record['fax']); $this->frm->addText('website', $this->record['website']); $this->frm->addText('vat', $this->record['vat']); $this->frm->addTextArea('zipcodes', $this->record['zipcodes']); $this->frm->addText('remark', $this->record['remark']); //$this->frm->addText('assort', $this->record['assort']); //$this->frm->addText('open', $this->record['open']); //$this->frm->addText('closed', $this->record['closed']); //$this->frm->addText('visit', $this->record['visit']); //$this->frm->addText('size', $this->record['size']); //$this->frm->addEditor('text', $this->record['text']); $this->frm->addImage('image'); $this->frm->addCheckbox('delete_image'); $this->frm->addRadiobutton('hidden', $rbtHiddenValues, $this->record['hidden']); foreach ((array) BackendModel::get('fork.settings')->get('Core', 'languages') as $key => $language) { $addressesLanguage = BackendAddressesModel::getLanguage($this->id, $language); $fieldText = $this->frm->addEditor("text_" . strtolower($language), $addressesLanguage['text']); $fieldOpeningHours = $this->frm->addEditor("opening_hours_" . strtolower($language), $addressesLanguage['opening_hours']); $this->fieldLanguages[$key]["key"] = $key; $this->fieldLanguages[$key]["language"] = $language; $this->fieldLanguages[$key]["text"] = $fieldText->parse(); $this->fieldLanguages[$key]["opening_hours"] = $fieldOpeningHours->parse(); } //--Get all the groups $groups = BackendAddressesModel::getAllGroups(); if (!empty($groups)) { //--Loop all the users foreach ($groups as &$group) { $groupCheckboxes[] = array("label" => $group["title"], "value" => $group["id"]); } //--Get the users from the group $groupsAddress = BackendAddressesModel::getGroupsForAddress($this->id); //--Create a selected-array $groupCheckboxesSelected = count($groupsAddress) > 0 ? array_keys($groupsAddress) : null; //--Add multicheckboxes to form $this->frm->addMultiCheckbox("groups", $groupCheckboxes, $groupCheckboxesSelected); } $groups2 = BackendAddressesModel::getAllGroupsTreeArray(); $this->tpl->assign('groups2', $groups2); $this->tpl->assign('groups2selected', $groupCheckboxesSelected == null ? array() : $groupCheckboxesSelected); // meta $this->meta = new BackendMeta($this->frm, $this->record['meta_id'], 'company', true); $this->meta->setUrlCallback('Backend\\Modules\\Addresses\\Engine\\Model', 'getUrl', array($this->record['id'])); }
/** * Parse into template */ private function parse() { // get the logged in user $authenticatedUser = BackendAuthentication::getUser(); // check if we need to show the password strength and parse the label $this->tpl->assign('showPasswordStrength', $authenticatedUser->getSetting('password_strength') !== 'strong'); $this->tpl->assign('passwordStrengthLabel', BL::lbl($authenticatedUser->getSetting('password_strength'))); }
/** * Loads the settings form */ private function loadForm() { $this->frm = new BackendForm('settings'); // add map info (widgets) $this->frm->addDropdown('zoom_level_widget', array_combine(array_merge(array('auto'), range(3, 18)), array_merge(array(BL::lbl('Auto', $this->getModule())), range(3, 18))), $this->get('fork.settings')->get($this->URL->getModule(), 'zoom_level_widget', 13)); $this->frm->addText('width_widget', $this->get('fork.settings')->get($this->URL->getModule(), 'width_widget')); $this->frm->addText('height_widget', $this->get('fork.settings')->get($this->URL->getModule(), 'height_widget')); $this->frm->addDropdown('map_type_widget', array('ROADMAP' => BL::lbl('Roadmap', $this->getModule()), 'SATELLITE' => BL::lbl('Satellite', $this->getModule()), 'HYBRID' => BL::lbl('Hybrid', $this->getModule()), 'TERRAIN' => BL::lbl('Terrain', $this->getModule())), $this->get('fork.settings')->get($this->URL->getModule(), 'map_type_widget', 'roadmap')); }
private function loadDatagrid() { // create datagrid $this->dgRooms = new BackendDataGridDB(BackendHotelsModel::QRY_DATAGRID_BROWSE_ROOMS, array($this->id)); // set column URLs $this->dgRooms->setColumnURL('title', BackendModel::createURLForAction('RoomEdit') . '&id=[id]'); $this->dgRooms->setColumnFunction(array(new BackendDataGridFunctions(), 'showImage'), array(FRONTEND_FILES_URL . '/rooms/images/64x64', '[image]'), 'image', true); // add edit column $this->dgRooms->addColumn('edit', null, BL::lbl('Edit'), BackendModel::createURLForAction('RoomEdit') . '&id=[id]', BL::lbl('RoomEdit')); }
/** * Load the datagrids */ private function loadDataGrid() { $this->dataGrid = new BackendDataGridDB(BackendContentBlocksModel::QRY_BROWSE, array('active', BL::getWorkingLanguage())); $this->dataGrid->setSortingColumns(array('title')); // check if this action is allowed if (BackendAuthentication::isAllowedAction('Edit')) { $this->dataGrid->setColumnURL('title', BackendModel::createURLForAction('Edit') . '&id=[id]'); $this->dataGrid->addColumn('edit', null, BL::lbl('Edit'), BackendModel::createURLForAction('Edit') . '&id=[id]', BL::lbl('Edit')); } }
/** * Load the form */ private function loadForm() { // set hidden values $rbtHiddenValues[] = array('label' => BL::lbl('Hidden', $this->URL->getModule()), 'value' => 'Y'); $rbtHiddenValues[] = array('label' => BL::lbl('Published'), 'value' => 'N'); // create form $this->frm = new BackendForm('add_category'); $this->frm->addText('title', null, 255, 'inputText title', 'inputTextError title'); $this->frm->addRadiobutton('hidden', $rbtHiddenValues, 'N'); }
/** * Load the datagrid */ public function loadDataGrid() { $this->dataGrid = new BackendDataGridDB(BackendGroupsModel::QRY_BROWSE); // check if this action is allowed if (BackendAuthentication::isAllowedAction('Edit')) { $this->dataGrid->setColumnURL('name', BackendModel::createURLForAction('Edit') . '&id=[id]'); $this->dataGrid->setColumnURL('num_users', BackendModel::createURLForAction('Edit') . '&id=[id]#tabUsers'); $this->dataGrid->addColumn('edit', null, BL::lbl('Edit'), BackendModel::createURLForAction('Edit') . '&id=[id]'); } }
/** * Load the form * * @return void */ private function loadForm() { // create form $this->frm = new BackendForm('edit_category'); // get values for the form $rbtHiddenValues[] = array('label' => BL::lbl('Hidden'), 'value' => 'Y'); $rbtHiddenValues[] = array('label' => BL::lbl('Published'), 'value' => 'N'); // create elements $this->frm->addText('title', $this->record['title']); $this->frm->addRadiobutton('hidden', $rbtHiddenValues, $this->record['hidden']); }
/** * Load the dataGrid */ protected function loadDataGrid() { $this->dataGrid = new DataGridDB(BackendInstagramModel::QRY_DATAGRID_BROWSE, Language::getWorkingLanguage()); // Reform date $this->dataGrid->setColumnFunction(array('Backend\\Core\\Engine\\DataGridFunctions', 'getLongDate'), array('[created_on]'), 'created_on', true); // Check if this action is allowed if (Authentication::isAllowedAction('Edit')) { $this->dataGrid->addColumn('edit', null, Language::lbl('Edit'), Model::createURLForAction('Edit') . '&id=[id]', Language::lbl('Edit')); $this->dataGrid->setColumnURL('username', Model::createURLForAction('Edit') . '&id=[id]'); } }
/** * Load the dataGrid */ private function loadDataGrid() { $this->dataGrid = new DataGridDB(BackendBlocksModel::QRY_DATAGRID_BROWSE_CATEGORIES, Language::getWorkingLanguage()); // check if this action is allowed if (Authentication::isAllowedAction('EditCategory')) { $this->dataGrid->addColumn('edit', null, Language::lbl('Edit'), Model::createURLForAction('EditCategory') . '&id=[id]', Language::lbl('Edit')); $this->dataGrid->setColumnURL('title', Model::createURLForAction('EditCategory') . '&id=[id]'); } // sequence $this->dataGrid->enableSequenceByDragAndDrop(); $this->dataGrid->setAttributes(array('data-action' => 'sequence_categories')); }
/** * Load the datagrids */ private function loadDataGrid() { // create datagrid $this->dataGrid = new BackendDataGridDB(BackendExtensionsModel::QRY_BROWSE_TEMPLATES, array($this->selectedTheme)); // check if this action is allowed if (BackendAuthentication::isAllowedAction('EditThemeTemplate')) { // set colum URLs $this->dataGrid->setColumnURL('title', BackendModel::createURLForAction('EditThemeTemplate') . '&id=[id]'); // add edit column $this->dataGrid->addColumn('edit', null, BL::lbl('Edit'), BackendModel::createURLForAction('EditThemeTemplate') . '&id=[id]', BL::lbl('Edit')); } }
/** * Load the datagrid */ protected function loadDataGrid() { $this->dataGrid = new BackendDataGridDB(BackendMailengineModel::QRY_DATAGRID_BROWSE_TEMPLATES); // sorting columns $this->dataGrid->setSortingColumns(array('title')); $this->dataGrid->setSortParameter('asc'); // check if this action is allowed if (BackendAuthentication::isAllowedAction('EditTemplate')) { $this->dataGrid->setColumnURL('title', BackendModel::createURLForAction('edit_template') . '&id=[id]'); $this->dataGrid->addColumn('edit', null, BL::lbl('Edit'), BackendModel::createURLForAction('edit_template') . '&id=[id]', BL::lbl('Edit')); } }
/** * Insert an item in the database * * @param array $item * @return int */ public static function insert(array $item) { $item['created_on'] = BackendModel::getUTCDate(); $item['edited_on'] = BackendModel::getUTCDate(); $db = BackendModel::get('database'); // insert extra $item['extra_id'] = BackendModel::insertExtra('widget', 'Instagram', 'InstagramFeed'); $item['id'] = (int) $db->insert('instagram_users', $item); // update extra (item id is now known) BackendModel::updateExtra($item['extra_id'], 'data', array('id' => $item['id'], 'extra_label' => \SpoonFilter::ucfirst(Language::lbl('Instagram', 'InstagramFeed')) . ': ' . $item['username'], 'edit_url' => BackendModel::createURLForAction('Edit', 'Instagram', null) . '&id=' . $item['id'])); return $item['id']; }
/** * Load the dataGrid */ private function loadDataGrid() { $this->dataGrid = new BackendDataGridDB(BackendCatalogModel::QRY_DATAGRID_BROWSE_BRANDS, array(BL::getWorkingLanguage())); // check if this action is allowed if (BackendAuthentication::isAllowedAction('EditBrand')) { $this->dataGrid->setColumnURL('title', BackendModel::createURLForAction('edit_brand') . '&id=[id]'); $this->dataGrid->addColumn('edit', null, BL::lbl('Edit'), BackendModel::createURLForAction('edit_brand') . '&id=[id]', BL::lbl('Edit')); } // sequence $this->dataGrid->enableSequenceByDragAndDrop(); $this->dataGrid->setAttributes(array('data-action' => 'SequenceBrands')); }
/** * Load the dataGrid */ protected function loadDataGrid() { $this->dataGrid = new DataGridDB(BackendBlocksModel::QRY_DATAGRID_BROWSE, Language::getWorkingLanguage()); // reform date $this->dataGrid->setColumnFunction(array('Backend\\Core\\Engine\\DataGridFunctions', 'getLongDate'), array('[created_on]'), 'created_on', true); // drag and drop sequencing $this->dataGrid->enableSequenceByDragAndDrop(); // check if this action is allowed if (Authentication::isAllowedAction('Edit')) { $this->dataGrid->addColumn('edit', null, Language::lbl('Edit'), Model::createURLForAction('Edit') . '&id=[id]', Language::lbl('Edit')); $this->dataGrid->setColumnURL('title', Model::createURLForAction('Edit') . '&id=[id]'); } }
/** * Loads the datagrids */ private function loadDataGrid() { // create datagrid $this->dataGrid = new DataGridDB($this->get('team_repository')->getDataGridQuery(), ['language' => Language::getWorkingLanguage()]); $this->dataGrid->setColumnFunction(['Rhumsaa\\Uuid\\Uuid', 'fromBytes'], ['[id]'], 'id', true); $this->dataGrid->setColumnFunction([new DataGridFunctions(), 'getLongDate'], ['[created_on]'], 'created_on', true); // check if this action is allowed if (Authentication::isAllowedAction('Edit')) { // add column $this->dataGrid->addColumn('edit', null, Language::lbl('Edit'), Model::createURLForAction('Edit'), Language::lbl('Edit')); $this->dataGrid->setColumnFunction([__CLASS__, 'addIdToEditUrl'], ['[edit]', '[id]'], 'edit', true); } $this->tpl->assign('dataGrid', (string) $this->dataGrid->getContent()); }
/** * Load the form */ protected function loadForm() { $rbtHiddenValues[] = array('label' => BL::lbl('Published'), 'value' => 'N'); $rbtHiddenValues[] = array('label' => BL::lbl('Hidden'), 'value' => 'Y'); $this->frm = new BackendForm('edit'); $this->frm->addText('title', $this->record['title'], null, 'inputText title', 'inputTextError title'); $this->frm->addText("from_email", $this->record['from_email']); $this->frm->addText("from_name", $this->record['from_name']); $this->frm->addText("reply_email", $this->record['reply_email']); $this->frm->addText("reply_name", $this->record['reply_name']); $this->frm->addEditor("template", $this->record['template'], "inputEditorNewsletter"); $this->frm->addTextarea("css", $this->record['css']); $this->frm->addRadiobutton('hidden', $rbtHiddenValues, $this->record['hidden']); }
public static function setCountText($count, $id) { switch ($count) { case 0: return '<a href="' . BackendModel::createURLForAction('Rooms') . '&id=' . $id . '">' . BL::lbl('NoRooms') . '</a>'; break; case 1: return '<a href="' . BackendModel::createURLForAction('Rooms') . '&id=' . $id . '">' . 1 . ' ' . BL::lbl('Room') . '</a>'; break; default: return '<a href="' . BackendModel::createURLForAction('Rooms') . '&id=' . $id . '">' . $count . ' ' . BL::lbl('Rooms') . '</a>'; break; } }
/** * Load the form */ protected function loadForm() { $rbtHiddenValues[] = array('label' => BL::lbl('Published'), 'value' => 'N'); $rbtHiddenValues[] = array('label' => BL::lbl('Hidden'), 'value' => 'Y'); $this->frm = new BackendForm('add'); $this->frm->addText('company'); $this->frm->addText('name'); $this->frm->addText('firstname'); $this->frm->addText('email'); $this->frm->addText('address'); $this->frm->addText('zipcode'); $this->frm->addText('city'); $this->frm->addDropdown('country', Intl::getRegionBundle()->getCountryNames(BL::getInterfaceLanguage()), 'BE'); $this->frm->addText('phone'); $this->frm->addText('fax'); $this->frm->addText('website'); $this->frm->addEditor('text'); $this->frm->addImage('image'); $this->frm->addText('vat'); $this->frm->addTextArea('zipcodes'); $this->frm->addText('remark'); //$this->frm->addText('assort'); //$this->frm->addText('open'); //$this->frm->addText('closed'); //$this->frm->addText('visit'); //$this->frm->addText('size'); $this->frm->addRadiobutton('hidden', $rbtHiddenValues, 'N'); foreach ((array) BackendModel::get('fork.settings')->get('Core', 'languages') as $key => $language) { $fieldText = $this->frm->addEditor("text_" . strtolower($language)); $fieldOpeningHours = $this->frm->addEditor("opening_hours_" . strtolower($language)); $this->fieldLanguages[$key]["key"] = $key; $this->fieldLanguages[$key]["language"] = $language; $this->fieldLanguages[$key]["text"] = $fieldText->parse(); $this->fieldLanguages[$key]["opening_hours"] = $fieldOpeningHours->parse(); } //--Get all the users $groups = BackendAddressesModel::getAllGroups(); if (!empty($groups)) { //--Loop all the group foreach ($groups as &$group) { $groupCheckboxes[] = array("label" => $group["title"], "value" => $group["id"]); } //--Add multicheckboxes to form $this->frm->addMultiCheckbox("groups", $groupCheckboxes); } $groups2 = BackendAddressesModel::getAllGroupsTreeArray(); $this->tpl->assign('groups2', $groups2); $this->meta = new BackendMeta($this->frm, null, 'company', true); }
/** * Load the form */ protected function loadForm() { $rbtHiddenValues[] = array('label' => BL::lbl('Published'), 'value' => 'N'); $rbtHiddenValues[] = array('label' => BL::lbl('Hidden'), 'value' => 'Y'); $rbtShowWebsiteValues[] = array('label' => BL::lbl('Yes'), 'value' => 'Y'); $rbtShowWebsiteValues[] = array('label' => BL::lbl('No'), 'value' => 'N'); $templates = BackendMailengineModel::getAllTemplatesForDropdown(); $this->frm = new BackendForm('add'); $this->frm->addText('subject', null, null, 'inputText title', 'inputTextError title'); $this->frm->addEditor('text'); $this->frm->addRadiobutton('hidden', $rbtHiddenValues, 'N'); $this->frm->addRadiobutton('show_on_website', $rbtShowWebsiteValues, 'Y'); $this->frm->addDropdown("template_id", $templates); $this->meta = new BackendMeta($this->frm, null, 'subject', true); }
/** * Load the dataGrid */ protected function loadDataGrid() { $this->dataGrid = new BackendDataGridDB(BackendMailengineModel::QRY_DATAGRID_BROWSE_MAIL_STATS); // sorting columns $this->dataGrid->setSortingColumns(array('date', 'subject', 'date', 'users')); $this->dataGrid->setSortParameter('desc'); $this->dataGrid->setColumnFunction(array(new BackendDataGridFunctions(), 'getLongDate'), array('[date]'), 'date', true); // check if this action is allowed $this->dataGrid->setColumnURL('subject', BackendModel::createURLForAction('detail_stat') . '&id=[id]'); $this->dataGrid->setColumnURL('date', BackendModel::createURLForAction('detail_stat') . '&id=[id]'); $this->dataGrid->setColumnURL('users', BackendModel::createURLForAction('detail_stat') . '&id=[id]'); // $this->dataGrid->setColumnURL('opened', BackendModel::createURLForAction('detail_stat') . '&id=[id]'); // $this->dataGrid->setColumnURL('percentage', BackendModel::createURLForAction('detail_stat') . '&id=[id]'); $this->dataGrid->addColumn('detail', null, ucfirst(BL::lbl('View')), BackendModel::createURLForAction('detail_stat') . '&id=[id]', ucfirst(BL::lbl('View'))); }
/** * Load the form */ private function loadForm() { // get values for the form $rbtHiddenValues[] = array('label' => BL::lbl('Hidden'), 'value' => 'Y'); $rbtHiddenValues[] = array('label' => BL::lbl('Published'), 'value' => 'N'); $categories = BackendFaqModel::getCategories(); // create form $this->frm = new BackendForm('edit'); $this->frm->addText('title', $this->record['question'], null, 'inputText title', 'inputTextError title'); $this->frm->addEditor('answer', $this->record['answer']); $this->frm->addRadiobutton('hidden', $rbtHiddenValues, $this->record['hidden']); $this->frm->addDropdown('category_id', $categories, $this->record['category_id']); $this->frm->addText('tags', BackendTagsModel::getTags($this->URL->getModule(), $this->record['id']), null, 'inputText tagBox', 'inputTextError tagBox'); $this->meta = new BackendMeta($this->frm, $this->record['meta_id'], 'title', true); }