Ejemplo n.º 1
0
 public function add()
 {
     $form = new FormEngine\Elements\Form(array('name' => 'pagescheme', 'action' => '', 'method' => 'post'));
     $filesPane = $form->AddChild(new FormEngine\Elements\Fieldset(array('name' => 'files_pane', 'label' => 'Dodaj nowy szablon')));
     $filesPane->AddChild(new FormEngine\Elements\Tip(array('tip' => '<p align="center">Wybierz z dysku lub wgraj plik zip z szablonem sklepu. Po imporcie będziesz mógł zmienić jego ustawienia oraz ustawić jako domyślny dla sklepu.</p>', 'direction' => FormEngine\Elements\Tip::DOWN)));
     $files = $filesPane->AddChild(new FormEngine\Elements\LocalFile(array('name' => 'files', 'label' => 'Plik', 'file_source' => 'themes/', 'traversable' => false, 'file_types' => array('zip'))));
     if ($form->Validate(FormEngine\FE::SubmittedData())) {
         $Data = $form->getSubmitValues(FormEngine\Elements\Form::FORMAT_FLAT);
         $check = App::getModel('pagescheme/import')->check($Data['files']['file']);
         $bValid = false;
         if (is_array($check)) {
             foreach ($check as $file) {
                 if ($file['filename'] == 'settings/export.json') {
                     $bValid = true;
                     break;
                 }
             }
         }
         if ($bValid) {
             App::getModel('pagescheme/import')->importPagescheme($Data['files']['file']);
             App::redirect(__ADMINPANE__ . '/templateeditor');
         } else {
             Session::setVolatileMessage("Musisz wybrać prawidłowe archiwum ZIP.");
             App::redirect(__ADMINPANE__ . '/templateeditor/add');
         }
     }
     $this->registry->template->assign('form', $form->Render());
     $this->registry->xajax->processRequest();
     $this->registry->template->assign('xajax', $this->registry->xajax->getJavascript());
     $this->registry->template->display($this->loadTemplate('add.tpl'));
 }
Ejemplo n.º 2
0
 public function edit()
 {
     $form = new FormEngine\Elements\Form(array('name' => 'rangetype', 'action' => '', 'method' => 'post'));
     $requiredData = $form->AddChild(new FormEngine\Elements\Fieldset(array('name' => 'required_data', 'label' => _('TXT_MAIN_DATA'))));
     $languageData = $requiredData->AddChild(new FormEngine\Elements\FieldsetLanguage(array('name' => 'language_data', 'label' => _('TXT_LANGUAGE_DATA'))));
     $languageData->AddChild(new FormEngine\Elements\TextField(array('name' => 'name', 'label' => _('TXT_NAME'), 'rules' => array(new FormEngine\Rules\Required(_('ERR_EMPTY_NAME')), new FormEngine\Rules\LanguageUnique(_('ERR_NAME_ALREADY_EXISTS'), 'rangetypetranslation', 'name', null, array('column' => 'rangetypeid', 'values' => (int) $this->registry->core->getParam()))))));
     $categoryData = $form->AddChild(new FormEngine\Elements\Fieldset(array('name' => 'category_data', 'label' => _('TXT_CATEGORY_DATA'))));
     $rawRangetypeData = App::getModel('rangetype')->getRangeTypeView($this->registry->core->getParam());
     $categoryData->AddChild(new FormEngine\Elements\Tree(array('name' => 'category', 'label' => _('TXT_CATEGORY'), 'choosable' => false, 'selectable' => true, 'sortable' => false, 'clickable' => false, 'items' => App::getModel('category')->getChildCategories(0, $rawRangetypeData['rangetypecategorys']), 'load_children' => array(App::getModel('category'), 'getChildCategories'))));
     $form->AddFilter(new FormEngine\Filters\NoCode());
     $form->AddFilter(new FormEngine\Filters\Trim());
     $form->AddFilter(new FormEngine\Filters\Secure());
     $rangetypeData = array('required_data' => array('language_data' => $rawRangetypeData['language']), 'category_data' => array('category' => $rawRangetypeData['rangetypecategorys']));
     $form->Populate($rangetypeData);
     if ($form->Validate(FormEngine\FE::SubmittedData())) {
         try {
             App::getModel('rangetype')->editRangeType($form->getSubmitValues(FormEngine\Elements\Form::FORMAT_FLAT), $this->registry->core->getParam());
         } catch (Exception $e) {
             $this->registry->template->assign('error', $e->getMessage());
         }
         App::redirect(__ADMINPANE__ . '/rangetype');
     }
     $this->registry->template->assign('form', $form->Render());
     $this->registry->xajax->processRequest();
     $this->registry->template->assign('xajax', $this->registry->xajax->getJavascript());
     $this->registry->template->display($this->loadTemplate('edit.tpl'));
 }
Ejemplo n.º 3
0
 public function initForm()
 {
     $form = new FormEngine\Elements\Form(array('name' => 'language', 'action' => '', 'method' => 'post'));
     $requiredData = $form->AddChild(new FormEngine\Elements\Fieldset(array('name' => 'required_data', 'label' => _('TXT_MAIN_DATA'))));
     $requiredData->AddChild(new FormEngine\Elements\TextField(array('name' => 'name', 'label' => _('TXT_NAME'), 'comment' => _('TXT_EXAMPLE') . ': en_EN', 'rules' => array(new FormEngine\Rules\Required(_('ERR_EMPTY_NAME')), new FormEngine\Rules\Unique(_('ERR_NAME_ALREADY_EXISTS'), 'language', 'name', null, array('column' => 'idlanguage', 'values' => (int) $this->registry->core->getParam()))))));
     $requiredData->AddChild(new FormEngine\Elements\TextField(array('name' => 'translation', 'label' => _('TXT_TRANSLATION'), 'comment' => _('TXT_EXAMPLE') . ': TXT_ENGLISH', 'rules' => array(new FormEngine\Rules\Required(_('ERR_EMPTY_TRANSLATION'))))));
     if ($this->registry->core->getParam() == '') {
         $requiredData->AddChild(new FormEngine\Elements\Select(array('name' => 'copylanguage', 'label' => _('TXT_COPY_FROM_LANGUAGE'), 'options' => FormEngine\Option::Make($this->registry->core->getDefaultValueToSelect() + App::getModel('language')->getLanguageALLToSelect()), 'default' => 0)));
     }
     $requiredData->AddChild(new FormEngine\Elements\LocalFile(array('name' => 'translations', 'label' => 'Plik z tłumaczeniem', 'file_source' => 'upload/', 'file_types' => array('xml'))));
     $currencies = App::getModel('currencieslist')->getCurrencyForSelect();
     $currencyData = $form->AddChild(new FormEngine\Elements\Fieldset(array('name' => 'currency_data', 'label' => _('TXT_CURRENCY_DATA'))));
     $currencyData->AddChild(new FormEngine\Elements\Select(array('name' => 'currencyid', 'label' => _('TXT_DEFAULT_LANGUAGE_CURRENCY'), 'options' => FormEngine\Option::Make($currencies))));
     $flagPane = $form->addChild(new FormEngine\Elements\Fieldset(array('name' => 'flag_pane', 'label' => _('TXT_LANGUAGE_FLAG'))));
     $flagPane->AddChild(new FormEngine\Elements\LocalFile(array('name' => 'flag', 'label' => _('TXT_LANGUAGE_FLAG'), 'file_source' => 'design/_images_common/icons/languages/', 'file_types' => array('png'))));
     $layerData = $form->AddChild(new FormEngine\Elements\Fieldset(array('name' => 'view_data', 'label' => _('TXT_STORES'))));
     $layerData->AddChild(new FormEngine\Elements\LayerSelector(array('name' => 'view', 'label' => _('TXT_VIEW'), 'default' => Helper::getViewIdsDefault())));
     $Data = Event::dispatch($this, 'admin.language.initForm', array('form' => $form, 'id' => (int) $this->registry->core->getParam(), 'data' => $this->populateData));
     if (!empty($Data)) {
         $form->Populate($Data);
     }
     $form->AddFilter(new FormEngine\Filters\NoCode());
     $form->AddFilter(new FormEngine\Filters\Trim());
     $form->AddFilter(new FormEngine\Filters\Secure());
     return $form;
 }
Ejemplo n.º 4
0
 public function initForm()
 {
     $form = new FormEngine\Elements\Form(array('name' => 'news', 'action' => '', 'method' => 'post'));
     $requiredData = $form->AddChild(new FormEngine\Elements\Fieldset(array('name' => 'required_data', 'label' => _('TXT_MAIN_DATA'))));
     $languageData = $requiredData->AddChild(new FormEngine\Elements\FieldsetLanguage(array('name' => 'language_data', 'label' => _('TXT_LANGUAGE_DATA'))));
     $languageData->AddChild(new FormEngine\Elements\TextField(array('name' => 'topic', 'label' => _('TXT_TOPIC'), 'rules' => array(new FormEngine\Rules\Required(_('ERR_EMPTY_TOPIC')), new FormEngine\Rules\LanguageUnique(_('ERR_TOPIC_ALREADY_EXISTS'), 'newstranslation', 'topic', null, array('column' => 'newsid', 'values' => (int) $this->registry->core->getParam()))))));
     $languageData->AddChild(new FormEngine\Elements\TextField(array('name' => 'seo', 'label' => _('TXT_SEO_URL'), 'rules' => array(new FormEngine\Rules\Required(_('ERR_EMPTY_SEO_URL'))))));
     $languageData->AddChild(new FormEngine\Elements\RichTextEditor(array('name' => 'summary', 'label' => _('TXT_NEWS_SUMMARY'))));
     $languageData->AddChild(new FormEngine\Elements\RichTextEditor(array('name' => 'content', 'label' => _('TXT_CONTENT'), 'comment' => _('TXT_MAX_LENGTH') . ' 5000', 'max_length' => 5000)));
     $requiredData->AddChild(new FormEngine\Elements\Checkbox(array('name' => 'publish', 'label' => _('TXT_PUBLISH'), 'default' => '1')));
     $requiredData->AddChild(new FormEngine\Elements\Checkbox(array('name' => 'featured', 'label' => _('Polecany'), 'default' => '1')));
     $metaData = $form->AddChild(new FormEngine\Elements\Fieldset(array('name' => 'meta_data', 'label' => _('TXT_META_INFORMATION'))));
     $metaData->AddChild(new FormEngine\Elements\Tip(array('tip' => '<p align="center">W przypadku braku informacji META system wygeneruje je automatycznie. W każdej chwili możesz je zmienić edytując dane poniżej.</p>', 'direction' => FormEngine\Elements\Tip::DOWN)));
     $additionalData = $form->AddChild(new FormEngine\Elements\Fieldset(array('name' => 'additional_data', 'label' => _('TXT_ADDITIONAL_INFORMATION'))));
     $additionalData->AddChild(new FormEngine\Elements\Date(array('name' => 'startdate', 'label' => _('TXT_START_DATE'))));
     $additionalData->AddChild(new FormEngine\Elements\Date(array('name' => 'enddate', 'label' => _('TXT_END_DATE'))));
     $languageData = $metaData->AddChild(new FormEngine\Elements\FieldsetLanguage(array('name' => 'language_data', 'label' => _('TXT_LANGUAGE_DATA'))));
     $languageData->AddChild(new FormEngine\Elements\TextField(array('name' => 'keyword_title', 'label' => _('TXT_KEYWORD_TITLE'))));
     $languageData->AddChild(new FormEngine\Elements\Textarea(array('name' => 'keyword_description', 'label' => _('TXT_KEYWORD_DESCRIPTION'), 'comment' => _('TXT_MAX_LENGTH') . ' 1000', 'max_length' => 1000)));
     $languageData->AddChild(new FormEngine\Elements\Textarea(array('name' => 'keyword', 'label' => _('TXT_KEYWORDS'), 'comment' => _('TXT_KEYWORDS_HELP'))));
     $photosPane = $form->AddChild(new FormEngine\Elements\Fieldset(array('name' => 'photos_pane', 'label' => _('TXT_PHOTOS'))));
     $photosPane->AddChild(new FormEngine\Elements\Image(array('name' => 'photo', 'label' => _('TXT_PHOTOS'), 'repeat_min' => 0, 'repeat_max' => FormEngine\FE::INFINITE, 'upload_url' => App::getURLAdressWithAdminPane() . 'files/add', 'main_id' => isset($this->populateData['photos_pane']['mainphotoid']) ? $this->populateData['photos_pane']['mainphotoid'] : NULL)));
     $layerData = $form->AddChild(new FormEngine\Elements\Fieldset(array('name' => 'view_data', 'label' => _('TXT_STORES'))));
     $layerData->AddChild(new FormEngine\Elements\LayerSelector(array('name' => 'view', 'label' => _('TXT_VIEW'), 'default' => Helper::getViewIdsDefault())));
     $Data = Event::dispatch($this, 'admin.news.initForm', array('form' => $form, 'id' => (int) $this->registry->core->getParam(), 'data' => $this->populateData));
     if (!empty($Data)) {
         $form->Populate($Data);
     }
     $form->AddFilter(new FormEngine\Filters\Trim());
     $form->AddFilter(new FormEngine\Filters\Secure());
     return $form;
 }
Ejemplo n.º 5
0
 public function initForm()
 {
     $form = new FormEngine\Elements\Form(array('name' => 'producer', 'action' => '', 'method' => 'post'));
     $requiredData = $form->AddChild(new FormEngine\Elements\Fieldset(array('name' => 'required_data', 'label' => _('TXT_MAIN_DATA'))));
     $languageData = $requiredData->AddChild(new FormEngine\Elements\FieldsetLanguage(array('name' => 'language_data', 'label' => _('TXT_LANGUAGE_DATA'))));
     $languageData->AddChild(new FormEngine\Elements\TextField(array('name' => 'name', 'label' => _('TXT_NAME'), 'rules' => array(new FormEngine\Rules\Required(_('ERR_EMPTY_NAME')), new FormEngine\Rules\LanguageUnique(_('ERR_NAME_ALREADY_EXISTS'), 'producertranslation', 'name', null, array('column' => 'producerid', 'values' => (int) $this->registry->core->getParam()))))));
     $languageData->AddChild(new FormEngine\Elements\TextField(array('name' => 'seo', 'label' => _('TXT_SEO_URL'), 'rules' => array(new FormEngine\Rules\Required(_('ERR_EMPTY_SEO_URL'))))));
     $languageData->AddChild(new FormEngine\Elements\RichTextEditor(array('name' => 'description', 'label' => _('TXT_DESCRIPTION'), 'rows' => 10)));
     $requiredData->AddChild(new FormEngine\Elements\MultiSelect(array('name' => 'deliverer', 'label' => _('TXT_DELIVERER'), 'options' => FormEngine\Option::Make(App::getModel('deliverer')->getDelivererToSelect()))));
     $requiredData->AddChild(new FormEngine\Elements\StaticText(array('text' => '<p style="padding-left: 195px;"><a href="' . App::getURLAdressWithAdminPane() . 'deliverer/add' . '" target="_blank"><span>' . _('TXT_ADD_DELIVERER') . '</span></a></p>')));
     $metaData = $form->AddChild(new FormEngine\Elements\Fieldset(array('name' => 'meta_data', 'label' => _('TXT_META_INFORMATION'))));
     $metaData->AddChild(new FormEngine\Elements\Tip(array('tip' => '<p align="center">W przypadku braku informacji META system wygeneruje je automatycznie. W każdej chwili możesz je zmienić edytując dane poniżej.</p>', 'direction' => FormEngine\Elements\Tip::DOWN)));
     $languageData = $metaData->AddChild(new FormEngine\Elements\FieldsetLanguage(array('name' => 'language_data', 'label' => _('TXT_LANGUAGE_DATA'))));
     $languageData->AddChild(new FormEngine\Elements\TextField(array('name' => 'keyword_title', 'label' => _('TXT_KEYWORD_TITLE'))));
     $languageData->AddChild(new FormEngine\Elements\Textarea(array('name' => 'keyword_description', 'label' => _('TXT_KEYWORD_DESCRIPTION'), 'comment' => _('TXT_MAX_LENGTH') . ' 1000', 'max_length' => 1000)));
     $languageData->AddChild(new FormEngine\Elements\Textarea(array('name' => 'keyword', 'label' => _('TXT_KEYWORDS'), 'comment' => _('TXT_KEYWORDS_HELP'))));
     $photosPane = $form->AddChild(new FormEngine\Elements\Fieldset(array('name' => 'photos_pane', 'label' => _('TXT_SINGLE_PHOTO'))));
     $photosPane->AddChild(new FormEngine\Elements\Image(array('name' => 'photo', 'label' => _('TXT_SINGLE_PHOTO'), 'repeat_min' => 0, 'repeat_max' => 1, 'upload_url' => App::getURLAdressWithAdminPane() . 'files/add')));
     $layerData = $form->AddChild(new FormEngine\Elements\Fieldset(array('name' => 'view_data', 'label' => _('TXT_STORES'))));
     $layerData->AddChild(new FormEngine\Elements\LayerSelector(array('name' => 'view', 'label' => _('TXT_VIEW'), 'default' => Helper::getViewIdsDefault())));
     $Data = Event::dispatch($this, 'admin.producer.initForm', array('form' => $form, 'id' => (int) $this->registry->core->getParam(), 'data' => $this->populateData));
     if (!empty($Data)) {
         $form->Populate($Data);
     }
     $form->AddFilter(new FormEngine\Filters\Trim());
     $form->AddFilter(new FormEngine\Filters\Secure());
     return $form;
 }
Ejemplo n.º 6
0
 public function add()
 {
     $form = new FormEngine\Elements\Form(array('name' => 'promotion', 'action' => '', 'method' => 'post'));
     $requiredData = $form->AddChild(new FormEngine\Elements\Fieldset(array('name' => 'required_data', 'label' => _('TXT_SELECT_PRODUCTS'))));
     $productid = $requiredData->AddChild(new FormEngine\Elements\ProductSelect(array('name' => 'productid', 'label' => _('TXT_SELECT_PRODUCTS'), 'rules' => array(new FormEngine\Rules\Required(_('TXT_SELECT_PRODUCTS'))), 'repeat_min' => 1, 'repeat_max' => FormEngine\FE::INFINITE)));
     $pricePane = $form->AddChild(new FormEngine\Elements\Fieldset(array('name' => 'discount_pane', 'label' => _('TXT_DISCOUNT'))));
     $standardPrice = $pricePane->AddChild(new FormEngine\Elements\Fieldset(array('name' => 'standard_price', 'label' => _('TXT_STANDARD_SELLPRICE'))));
     $enablePromotion = $standardPrice->AddChild(new FormEngine\Elements\Checkbox(array('name' => 'promotion', 'label' => _('TXT_ENABLE_PROMOTION'), 'default' => '0')));
     $standardPrice->AddChild(new FormEngine\Elements\TextField(array('name' => 'discount', 'label' => _('TXT_DISCOUNT'), 'rules' => array(new FormEngine\Rules\Format(_('ERR_VALUE_INVALID'), '/^([0-9]*\\.*([0-9]{1,2})|(\\0)?)$/')), 'default' => '0.00', 'suffix' => '%', 'filters' => array(new FormEngine\Filters\CommaToDotChanger()), 'dependencies' => array(new FormEngine\Dependency(FormEngine\Dependency::SHOW, $enablePromotion, new FormEngine\Conditions\Equals(1))))));
     $standardPrice->AddChild(new FormEngine\Elements\Date(array('name' => 'promotionstart', 'label' => _('TXT_START_DATE'), 'dependencies' => array(new FormEngine\Dependency(FormEngine\Dependency::SHOW, $enablePromotion, new FormEngine\Conditions\Equals(1))))));
     $standardPrice->AddChild(new FormEngine\Elements\Date(array('name' => 'promotionend', 'label' => _('TXT_END_DATE'), 'dependencies' => array(new FormEngine\Dependency(FormEngine\Dependency::SHOW, $enablePromotion, new FormEngine\Conditions\Equals(1))))));
     $clientGroups = App::getModel('clientgroup/clientgroup')->getClientGroupAll();
     foreach ($clientGroups as $clientGroup) {
         $pricePane->AddChild(new FormEngine\Elements\Fieldset(array('name' => 'field_' . $clientGroup['id'], 'label' => $clientGroup['name'])));
         $promotion[$clientGroup['id']] = $pricePane->AddChild(new FormEngine\Elements\Checkbox(array('name' => 'promotion_' . $clientGroup['id'], 'label' => _('TXT_ENABLE_CLIENTGROUP_PROMOTION'), 'default' => '0')));
         $pricePane->AddChild(new FormEngine\Elements\TextField(array('name' => 'discount_' . $clientGroup['id'], 'label' => _('TXT_DISCOUNT'), 'rules' => array(new FormEngine\Rules\Format(_('ERR_VALUE_INVALID'), '/^([0-9]*\\.*([0-9]{1,2})|(\\0)?)$/')), 'default' => '0.00', 'suffix' => '%', 'filters' => array(new FormEngine\Filters\CommaToDotChanger()), 'dependencies' => array(new FormEngine\Dependency(FormEngine\Dependency::HIDE, $promotion[$clientGroup['id']], new FormEngine\Conditions\Not(new FormEngine\Conditions\Equals(1)))))));
         $pricePane->AddChild(new FormEngine\Elements\Date(array('name' => 'promotionstart_' . $clientGroup['id'], 'label' => _('TXT_START_DATE'), 'dependencies' => array(new FormEngine\Dependency(FormEngine\Dependency::SHOW, $promotion[$clientGroup['id']], new FormEngine\Conditions\Equals(1))))));
         $pricePane->AddChild(new FormEngine\Elements\Date(array('name' => 'promotionend_' . $clientGroup['id'], 'label' => _('TXT_END_DATE'), 'dependencies' => array(new FormEngine\Dependency(FormEngine\Dependency::SHOW, $promotion[$clientGroup['id']], new FormEngine\Conditions\Equals(1))))));
     }
     $form->AddFilter(new FormEngine\Filters\NoCode());
     $form->AddFilter(new FormEngine\Filters\Trim());
     $form->AddFilter(new FormEngine\Filters\Secure());
     if ($form->Validate(FormEngine\FE::SubmittedData())) {
         $Data = $form->getSubmitValues(FormEngine\Elements\Form::FORMAT_FLAT);
         $this->model->addPromotion($Data);
         App::getModel('product')->updateProductAttributesetPricesAll();
         App::redirect(__ADMINPANE__ . '/productpromotion');
     }
     $this->registry->template->assign('form', $form->Render());
     $this->registry->template->assign('xajax', $this->registry->xajax->getJavascript());
     $this->registry->xajax->processRequest();
     $this->registry->template->display($this->loadTemplate('add.tpl'));
 }
Ejemplo n.º 7
0
 public function initForm()
 {
     $form = new FormEngine\Elements\Form(array('name' => 'contentcategory', 'action' => '', 'method' => 'post'));
     $requiredData = $form->AddChild(new FormEngine\Elements\Fieldset(array('name' => 'required_data', 'label' => _('TXT_MAIN_DATA'))));
     $languageData = $requiredData->AddChild(new FormEngine\Elements\FieldsetLanguage(array('name' => 'language_data', 'label' => _('TXT_LANGUAGE_DATA'))));
     $languageData->AddChild(new FormEngine\Elements\TextField(array('name' => 'name', 'label' => _('TXT_NAME'), 'rules' => array(new FormEngine\Rules\Required(_('ERR_EMPTY_NAME'))))));
     $languageData->AddChild(new FormEngine\Elements\RichTextEditor(array('name' => 'description', 'label' => _('TXT_CONTENT'))));
     $requiredData->AddChild(new FormEngine\Elements\Checkbox(array('name' => 'header', 'label' => _('TXT_ENABLE_IN_HEADER'), 'default' => '1')));
     $requiredData->AddChild(new FormEngine\Elements\Checkbox(array('name' => 'footer', 'label' => _('TXT_ENABLE_IN_FOOTER'), 'default' => '1')));
     $requiredData->AddChild(new FormEngine\Elements\Tip(array('direction' => FormEngine\Elements\Tip::DOWN, 'tip' => '<p>' . _('TXT_PARENT_CATEGORY_EXAMPLE') . '</p>')));
     $requiredData->AddChild(new FormEngine\Elements\Tree(array('name' => 'contentcategoryid', 'label' => _('TXT_CATEGORY'), 'choosable' => true, 'selectable' => false, 'sortable' => false, 'clickable' => false, 'restrict' => (int) $this->registry->core->getParam(), 'items' => App::getModel('contentcategory')->getContentCategoryALL($this->registry->core->getParam()))));
     $metaData = $form->AddChild(new FormEngine\Elements\Fieldset(array('name' => 'meta_data', 'label' => _('TXT_META_INFORMATION'))));
     $metaData->AddChild(new FormEngine\Elements\Tip(array('tip' => '<p align="center">W przypadku braku informacji META system wygeneruje je automatycznie. W każdej chwili możesz je zmienić edytując dane poniżej.</p>', 'direction' => FormEngine\Elements\Tip::DOWN)));
     $languageData = $metaData->AddChild(new FormEngine\Elements\FieldsetLanguage(array('name' => 'language_data', 'label' => _('TXT_LANGUAGE_DATA'))));
     $languageData->AddChild(new FormEngine\Elements\TextField(array('name' => 'keyword_title', 'label' => _('TXT_KEYWORD_TITLE'))));
     $languageData->AddChild(new FormEngine\Elements\Textarea(array('name' => 'keyword_description', 'label' => _('TXT_KEYWORD_DESCRIPTION'))));
     $languageData->AddChild(new FormEngine\Elements\Textarea(array('name' => 'keyword', 'label' => _('TXT_KEYWORDS'), 'comment' => _('TXT_KEYWORDS_HELP'))));
     $redirectData = $form->AddChild(new FormEngine\Elements\Fieldset(array('name' => 'redirect_data', 'label' => _('TXT_CONTENTCATEGORY_REDIRECT'))));
     $redirect = $redirectData->AddChild(new FormEngine\Elements\Select(array('name' => 'redirect', 'label' => _('TXT_REDIRECT_TYPE'), 'options' => array(new FormEngine\Option(0, _('TXT_REDIRECT_NONE')), new FormEngine\Option(1, _('TXT_REDIRECT_INTERNAL')), new FormEngine\Option(2, _('TXT_REDIRECT_EXTERNAL'))), 'default' => 1)));
     $redirectData->AddChild(new FormEngine\Elements\Select(array('name' => 'redirect_route', 'label' => _('TXT_REDIRECT_INTERNAL_URL'), 'options' => array(new FormEngine\Option('frontend.mainside', _('TXT_CONTROLLER_MAINSIDE')), new FormEngine\Option('frontend.conditions', _('TXT_CONDITIONS')), new FormEngine\Option('frontend.clientlogin', _('TXT_CONTROLLER_CLIENTLOGIN')), new FormEngine\Option('frontend.registration', _('TXT_CONTROLLER_REGISTRATION')), new FormEngine\Option('frontend.contact', _('TXT_CONTROLLER_CONTACT')), new FormEngine\Option('frontend.sitemap', _('TXT_CONTROLLER_SITEMAP')), new FormEngine\Option('frontend.news', _('TXT_CONTROLLER_NEWS')), new FormEngine\Option('frontend.forgotpassword', _('TXT_CONTROLLER_FORGOTPASSWORD')), new FormEngine\Option('frontend.producerlist', _('TXT_CONTROLLER_PRODUCERLIST')), new FormEngine\Option('frontend.categorylist', _('TXT_CONTROLLER_CATEGORYLIST'))), 'dependencies' => array(new FormEngine\Dependency(FormEngine\Dependency::SHOW, $redirect, new FormEngine\Conditions\Equals(1))), 'default' => 1)));
     $redirectData->AddChild(new FormEngine\Elements\TextField(array('name' => 'redirect_url', 'label' => _('TXT_REDIRECT_EXTERNAL_URL'), 'dependencies' => array(new FormEngine\Dependency(FormEngine\Dependency::SHOW, $redirect, new FormEngine\Conditions\Equals(2))))));
     $layerData = $form->AddChild(new FormEngine\Elements\Fieldset(array('name' => 'view_data', 'label' => _('TXT_STORES'))));
     $layerData->AddChild(new FormEngine\Elements\LayerSelector(array('name' => 'view', 'label' => _('TXT_VIEW'), 'default' => Helper::getViewIdsDefault())));
     $Data = Event::dispatch($this, 'admin.contentcategory.initForm', array('form' => $form, 'id' => (int) $this->registry->core->getParam(), 'data' => $this->populateData));
     if (!empty($Data)) {
         $form->Populate($Data);
     }
     $form->AddFilter(new FormEngine\Filters\Trim());
     $form->AddFilter(new FormEngine\Filters\Secure());
     return $form;
 }
Ejemplo n.º 8
0
 public function edit()
 {
     // dodawanie zdjec
     $form = new FormEngine\Elements\Form(array('name' => 'edit_file', 'action' => '', 'method' => 'post'));
     $photosPane = $form->AddChild(new FormEngine\Elements\Fieldset(array('name' => 'photos_pane', 'label' => _('TXT_PHOTOS'))));
     $photosPane->AddChild(new FormEngine\Elements\Image(array('name' => 'photo', 'label' => _('TXT_PHOTOS'), 'repeat_min' => 0, 'repeat_max' => FormEngine\FE::INFINITE, 'upload_url' => App::getURLAdressWithAdminPane() . 'files/add')));
     $form->AddFilter(new FormEngine\Filters\Trim());
     if ($form->Validate(FormEngine\FE::SubmittedData())) {
         App::redirect(__ADMINPANE__ . '/files');
     }
     $this->renderLayout(array('form' => $form->Render()));
 }
Ejemplo n.º 9
0
 public function initForm()
 {
     $form = new FormEngine\Elements\Form(array('name' => 'contact', 'action' => '', 'method' => 'post'));
     $requiredData = $form->AddChild(new FormEngine\Elements\Fieldset(array('name' => 'required_data', 'label' => _('TXT_MAIN_DATA'))));
     $languageData = $requiredData->AddChild(new FormEngine\Elements\FieldsetLanguage(array('name' => 'language_data', 'label' => _('TXT_LANGUAGE_DATA'))));
     $languageData->AddChild(new FormEngine\Elements\TextField(array('name' => 'name', 'label' => _('TXT_NAME'), 'rules' => array(new FormEngine\Rules\Required(_('ERR_EMPTY_NAME')), new FormEngine\Rules\LanguageUnique(_('ERR_NAME_ALREADY_EXISTS'), 'contacttranslation', 'name', null, array('column' => 'contactid', 'values' => (int) $this->registry->core->getParam()))))));
     $languageData->AddChild(new FormEngine\Elements\TextField(array('name' => 'email', 'label' => _('TXT_EMAIL'), 'comment' => _('TXT_EMAIL_FORM'), 'rules' => array(new FormEngine\Rules\Required(_('ERR_EMPTY_EMAIL')), new FormEngine\Rules\Email(_('ERR_WRONG_EMAIL'))))));
     $languageData->AddChild(new FormEngine\Elements\TextField(array('name' => 'phone', 'label' => _('TXT_PHONE'), 'rules' => array(new FormEngine\Rules\Format(_('ERR_WRONG_FORMAT_PHONE'), '/^(\\d{1,}(-|\\s)?\\d{1,})*$/')))));
     $languageData->AddChild(new FormEngine\Elements\TextField(array('name' => 'fax', 'label' => _('TXT_FAX'), 'comment' => _('TXT_FAX_FORM'), 'rules' => array(new FormEngine\Rules\Format(_('ERR_WRONG_FORMAT_FAX'), '/^(\\d{1,}(-|\\s)?\\d{1,})*$/')))));
     $languageData->AddChild(new FormEngine\Elements\TextField(array('name' => 'businesshours', 'label' => _('TXT_BUSINESS_HOURS'))));
     $requiredData->AddChild(new FormEngine\Elements\Select(array('name' => 'publish', 'label' => _('TXT_PUBLISH'), 'options' => array(new FormEngine\Option('1', _('TXT_YES')), new FormEngine\Option('0', _('TXT_NO'))), 'default' => '1')));
     $addressData = $form->AddChild(new FormEngine\Elements\Fieldset(array('name' => 'address_data', 'label' => _('TXT_CONTACT_ADDRESS_DATA'))));
     $addressLanguageData = $addressData->AddChild(new FormEngine\Elements\FieldsetLanguage(array('name' => 'language_data', 'label' => _('TXT_LANGUAGE_DATA'))));
     $addressLanguageData->AddChild(new FormEngine\Elements\TextField(array('name' => 'street', 'label' => _('TXT_STREET'), 'rules' => array(new FormEngine\Rules\Required(_('ERR_EMPTY_STREET'))))));
     $addressLanguageData->AddChild(new FormEngine\Elements\TextField(array('name' => 'streetno', 'label' => _('TXT_STREETNO'))));
     $addressLanguageData->AddChild(new FormEngine\Elements\TextField(array('name' => 'placeno', 'label' => _('TXT_PLACENO'))));
     $place = $addressLanguageData->AddChild(new FormEngine\Elements\TextField(array('name' => 'placename', 'label' => _('TXT_PLACE'), 'rules' => array(new FormEngine\Rules\Required(_('ERR_EMPTY_PLACE'))))));
     $addressLanguageData->AddChild(new FormEngine\Elements\TextField(array('name' => 'postcode', 'label' => _('TXT_POSTCODE'), 'comment' => _('TXT_POSTCODE_FORM'), 'rules' => array(new FormEngine\Rules\Required(_('ERR_EMPTY_POSTCODE')), new FormEngine\Rules\Format(_('ERR_WRONG_FORMAT_POSTCODE'), '/^\\d{2}-\\d{3}?$/')))));
     $addressLanguageData->AddChild(new FormEngine\Elements\Select(array('name' => 'countryid', 'label' => _('TXT_NAME_OF_COUNTRY'), 'options' => FormEngine\Option::Make($this->registry->core->getDefaultValueToSelect() + App::getModel('countrieslist')->getCountryForSelect()), 'default' => 0, 'rules' => array(new FormEngine\Rules\Required(_('ERR_EMPTY_NAME_OF_COUNTRY'))))));
     $layerData = $form->AddChild(new FormEngine\Elements\Fieldset(array('name' => 'view_data', 'label' => _('TXT_STORES'))));
     $layerData->AddChild(new FormEngine\Elements\LayerSelector(array('name' => 'view', 'label' => _('TXT_VIEW'), 'default' => Helper::getViewIdsDefault())));
     $Data = Event::dispatch($this, 'admin.contact.initForm', array('form' => $form, 'id' => (int) $this->registry->core->getParam(), 'data' => $this->populateData));
     if (!empty($Data)) {
         $form->Populate($Data);
     }
     $form->AddFilter(new FormEngine\Filters\Trim());
     $form->AddFilter(new FormEngine\Filters\Secure());
     return $form;
 }
Ejemplo n.º 10
0
 public function index()
 {
     if (Session::getActiveUserid() != null) {
         App::redirect(__ADMINPANE__ . '/mainside');
     }
     $form = new FormEngine\Elements\Form(array('name' => 'forgotlogin', 'action' => '', 'method' => 'post', 'class' => 'login-form'));
     $form->AddChild(new FormEngine\Elements\TextField(array('name' => 'login', 'label' => _('TXT_EMAIL_FORM_LOGIN'), 'rules' => array(new FormEngine\Rules\Required(_('ERR_EMPTY_LOGIN_FORM_LOGIN'))))));
     $form->AddChild(new FormEngine\Elements\Submit(array('name' => 'log_in', 'label' => _('TXT_FORGOT_PASSWORD'))));
     $form->AddFilter(new FormEngine\Filters\Trim());
     $form->AddFilter(new FormEngine\Filters\NoCode());
     if ($form->Validate(FormEngine\FE::SubmittedData())) {
         $loginValues = $form->getSubmitValues(FormEngine\Elements\Form::FORMAT_FLAT);
         $result = App::getModel('login')->checkUsers($loginValues['login']);
         if ($result == 0) {
             Session::setVolatileLoginError(1, false);
         } else {
             $password = Core::passwordGenerate();
             App::getModel('login')->changeUsersPassword($result, $password);
             $this->registry->template->assign('password', $password);
             App::getModel('mailer')->sendEmail(array('template' => 'forgotUsers', 'email' => array($_POST['login']), 'bcc' => false, 'subject' => _('TXT_FORGOT_PASSWORD'), 'viewid' => Helper::getViewId()));
             Session::setVolatileMessage("Nowe hasło zostało wysłane na podany adres e-mail.");
             App::redirect('login');
         }
     }
     $error = Session::getVolatileLoginError();
     if ($error[0] == 1) {
         $this->registry->template->assign('error', _('ERR_BAD_EMAIL'));
     }
     $languages = App::getModel('language')->getLanguages();
     $this->registry->xajax->processRequest();
     $this->registry->template->assign('xajax', $this->registry->xajax->getJavascript());
     $this->registry->template->assign('form', $form->Render());
     $this->registry->template->assign('languages', json_encode($languages));
     $this->registry->template->display($this->loadTemplate('index.tpl'));
 }
Ejemplo n.º 11
0
 public function initForm()
 {
     $form = new FormEngine\Elements\Form(array('name' => 'currencieslist', 'action' => '', 'method' => 'post'));
     $requiredData = $form->AddChild(new FormEngine\Elements\Fieldset(array('name' => 'required_data', 'label' => _('TXT_MAIN_DATA'))));
     $requiredData->AddChild(new FormEngine\Elements\TextField(array('name' => 'name', 'label' => _('TXT_CURRENCY_NAME'), 'rules' => array(new FormEngine\Rules\Required(_('ERR_EMPTY_NAME'))))));
     $requiredData->AddChild(new FormEngine\Elements\Select(array('name' => 'symbol', 'label' => _('TXT_CURRENCY_SYMBOL'), 'options' => FormEngine\Option::Make(App::getModel('currencieslist')->getCurrenciesALLToSelect()), 'rules' => array(new FormEngine\Rules\Required(_('ERR_EMPTY_CURRENCY_SYMBOL'))))));
     $requiredData->AddChild(new FormEngine\Elements\TextField(array('name' => 'decimalseparator', 'label' => _('TXT_CURRENCY_DECIMAL_SEPARATOR'), 'rules' => array(new FormEngine\Rules\Required(_('ERR_EMPTY_CURRENCY_DECIMAL_SEPARATOR'))))));
     $requiredData->AddChild(new FormEngine\Elements\TextField(array('name' => 'decimalcount', 'label' => _('TXT_CURRENCY_DECIMAL_COUNT'), 'rules' => array(new FormEngine\Rules\Required(_('ERR_EMPTY_CURRENCY_DECIMAL_COUNT'))))));
     $requiredData->AddChild(new FormEngine\Elements\TextField(array('name' => 'thousandseparator', 'label' => _('TXT_CURRENCY_THOUSAND_SEPARATOR'))));
     $requiredData->AddChild(new FormEngine\Elements\TextField(array('name' => 'positivepreffix', 'label' => _('TXT_CURRENCY_POSITIVE_PREFFIX'))));
     $requiredData->AddChild(new FormEngine\Elements\TextField(array('name' => 'positivesuffix', 'label' => _('TXT_CURRENCY_POSITIVE_SUFFIX'))));
     $requiredData->AddChild(new FormEngine\Elements\TextField(array('name' => 'negativepreffix', 'label' => _('TXT_CURRENCY_NEGATIVE_PREFFIX'))));
     $requiredData->AddChild(new FormEngine\Elements\TextField(array('name' => 'negativesuffix', 'label' => _('TXT_CURRENCY_NEGATIVE_SUFFIX'))));
     $exchangeData = $form->AddChild(new FormEngine\Elements\Fieldset(array('name' => 'exchange_data', 'label' => _('TXT_CURRENCY_EXCHANGE'))));
     $currencies = App::getModel('currencieslist')->getCurrencies();
     foreach ($currencies as $key => $currency) {
         $exchangeData->AddChild(new FormEngine\Elements\TextField(array('name' => 'currency_' . $currency['idcurrency'], 'label' => $currency['currencysymbol'], 'filters' => array(new FormEngine\Filters\CommaToDotChanger()))));
     }
     $layerData = $form->AddChild(new FormEngine\Elements\Fieldset(array('name' => 'view_data', 'label' => _('TXT_STORES'))));
     $layerData->AddChild(new FormEngine\Elements\LayerSelector(array('name' => 'view', 'label' => _('TXT_VIEW'), 'default' => Helper::getViewIdsDefault())));
     $Data = Event::dispatch($this, 'admin.currencieslist.initForm', array('form' => $form, 'id' => (int) $this->registry->core->getParam(), 'data' => $this->populateData));
     if (!empty($Data)) {
         $form->Populate($Data);
     }
     $form->AddFilter(new FormEngine\Filters\NoCode());
     $form->AddFilter(new FormEngine\Filters\Secure());
     return $form;
 }
Ejemplo n.º 12
0
 public function initForm()
 {
     $form = new FormEngine\Elements\Form(array('name' => 'sitemaps', 'action' => '', 'method' => 'post'));
     $requiredData = $form->AddChild(new FormEngine\Elements\Fieldset(array('name' => 'required_data', 'label' => _('TXT_MAIN_DATA'))));
     $requiredData->AddChild(new FormEngine\Elements\TextField(array('name' => 'name', 'label' => _('TXT_SITEMAPS_NAME'), 'rules' => array(new FormEngine\Rules\Required(_('ERR_EMPTY_SITEMAPS_NAME'))))));
     $requiredData->AddChild(new FormEngine\Elements\TextField(array('name' => 'pingserver', 'label' => _('TXT_SITEMAPS_PINGSERVER'), 'rules' => array(new FormEngine\Rules\Required(_('ERR_EMPTY_SITEMAPS_PINGSERVER')), new FormEngine\Rules\Format(_('ERR_WRONG_FORMAT'), '/http:\\/\\/[a-zA-Z0-9]+/')))));
     $settingsData = $form->AddChild(new FormEngine\Elements\Fieldset(array('name' => 'settings_data', 'label' => _('TXT_SETTINGS'))));
     $publishforcategories = $settingsData->AddChild(new FormEngine\Elements\Checkbox(array('name' => 'publishforcategories', 'label' => _('TXT_PUBLISH_FOR_CATEGORIES'), 'default' => '1')));
     $settingsData->AddChild(new FormEngine\Elements\TextField(array('name' => 'priorityforcategories', 'label' => _('TXT_PRIORITY_FOR_CATEGORIES'), 'rules' => array(new FormEngine\Rules\Format(_('ERR_NUMERIC_INVALID'), '/[0-9]{1,}/'), new FormEngine\Rules\Required(_('ERR_EMPTY_TXT_PRIORITY_FOR_CATEGORIES'))), 'filters' => array(new FormEngine\Filters\CommaToDotChanger()), 'default' => '0.5', 'dependencies' => array(new FormEngine\Dependency(FormEngine\Dependency::HIDE, $publishforcategories, new FormEngine\Conditions\Not(new FormEngine\Conditions\Equals('1')))))));
     $publishforproducts = $settingsData->AddChild(new FormEngine\Elements\Checkbox(array('name' => 'publishforproducts', 'label' => _('TXT_PUBLISH_FOR_PRODUCTS'), 'default' => '1')));
     $settingsData->AddChild(new FormEngine\Elements\TextField(array('name' => 'priorityforproducts', 'label' => _('TXT_PRIORITY_FOR_PRODUCTS'), 'rules' => array(new FormEngine\Rules\Format(_('ERR_NUMERIC_INVALID'), '/[0-9]{1,}/'), new FormEngine\Rules\Required(_('ERR_EMPTY_PRIORITY_FOR_PRODUCTS'))), 'filters' => array(new FormEngine\Filters\CommaToDotChanger()), 'default' => '0.5', 'dependencies' => array(new FormEngine\Dependency(FormEngine\Dependency::HIDE, $publishforproducts, new FormEngine\Conditions\Not(new FormEngine\Conditions\Equals('1')))))));
     $publishforproducers = $settingsData->AddChild(new FormEngine\Elements\Checkbox(array('name' => 'publishforproducers', 'label' => _('TXT_PUBLISH_FOR_PRODUCERS'), 'default' => '1')));
     $settingsData->AddChild(new FormEngine\Elements\TextField(array('name' => 'priorityforproducers', 'label' => _('TXT_PRIORITY_FOR_PRODUCERS'), 'rules' => array(new FormEngine\Rules\Format(_('ERR_NUMERIC_INVALID'), '/[0-9]{1,}/'), new FormEngine\Rules\Required(_('ERR_EMPTY_PRIORITY_FOR_PRODUCERS'))), 'filters' => array(new FormEngine\Filters\CommaToDotChanger()), 'default' => '0.5', 'dependencies' => array(new FormEngine\Dependency(FormEngine\Dependency::HIDE, $publishforproducers, new FormEngine\Conditions\Not(new FormEngine\Conditions\Equals('1')))))));
     $publishfornews = $settingsData->AddChild(new FormEngine\Elements\Checkbox(array('name' => 'publishfornews', 'label' => _('TXT_PUBLISH_FOR_NEWS'), 'default' => '1')));
     $settingsData->AddChild(new FormEngine\Elements\TextField(array('name' => 'priorityfornews', 'label' => _('TXT_PRIORITY_FOR_NEWS'), 'rules' => array(new FormEngine\Rules\Format(_('ERR_NUMERIC_INVALID'), '/[0-9]{1,}/'), new FormEngine\Rules\Required(_('ERR_EMPTY_PRIORITY_FOR_NEWS'))), 'filters' => array(new FormEngine\Filters\CommaToDotChanger()), 'default' => '0.5', 'dependencies' => array(new FormEngine\Dependency(FormEngine\Dependency::HIDE, $publishfornews, new FormEngine\Conditions\Not(new FormEngine\Conditions\Equals('1')))))));
     $publishforpages = $settingsData->AddChild(new FormEngine\Elements\Checkbox(array('name' => 'publishforpages', 'label' => _('TXT_PUBLISH_FOR_PAGES'), 'default' => '1')));
     $settingsData->AddChild(new FormEngine\Elements\TextField(array('name' => 'priorityforpages', 'label' => _('TXT_PRIORITY_FOR_PAGES'), 'rules' => array(new FormEngine\Rules\Format(_('ERR_NUMERIC_INVALID'), '/[0-9]{1,}/'), new FormEngine\Rules\Required(_('ERR_EMPTY_PRIORITY_FOR_PAGES'))), 'filters' => array(new FormEngine\Filters\CommaToDotChanger()), 'default' => '0.5', 'dependencies' => array(new FormEngine\Dependency(FormEngine\Dependency::HIDE, $publishforpages, new FormEngine\Conditions\Not(new FormEngine\Conditions\Equals('1')))))));
     $Data = Event::dispatch($this, 'admin.sitemaps.initForm', array('form' => $form, 'id' => (int) $this->registry->core->getParam(), 'data' => $this->populateData));
     if (!empty($Data)) {
         $form->Populate($Data);
     }
     $form->AddFilter(new FormEngine\Filters\NoCode());
     $form->AddFilter(new FormEngine\Filters\Trim());
     $form->AddFilter(new FormEngine\Filters\Secure());
     return $form;
 }
Ejemplo n.º 13
0
    public function index()
    {
        if (App::getConfig('devmode') == 0) {
            App::redirect(__ADMINPANE__ . '/mainside');
        }
        if ((int) $this->getParam() == 0) {
            $form = new FormEngine\Elements\Form(array('name' => 'exchange', 'action' => '', 'method' => 'post'));
            $requiredData = $form->AddChild(new FormEngine\Elements\Fieldset(array('name' => 'type_pane', 'label' => _('TXT_EXCHANGE_TYPE_MIGRATION_SETTINGS'))));
            $requiredData->AddChild(new FormEngine\Elements\Tip(array('tip' => '<p>Podaj adres URL wtyczki integracyjnej.</p>', 'direction' => FormEngine\Elements\Tip::DOWN)));
            $requiredData->AddChild(new FormEngine\Elements\TextField(array('name' => 'apiurl', 'label' => _('TXT_MIGRATION_API_URL'))));
            $requiredData->AddChild(new FormEngine\Elements\Tip(array('tip' => '<p>Podaj klucz jaki został ustawiony w pliku integracyjnym ($key)</p>', 'direction' => FormEngine\Elements\Tip::DOWN)));
            $requiredData->AddChild(new FormEngine\Elements\TextField(array('name' => 'apikey', 'label' => _('TXT_MIGRATION_API_KEY'))));
            $requiredData->AddChild(new FormEngine\Elements\Tip(array('tip' => '<p>Wybierz rodzaj importowanych danych.Sugerujemy import w następującej kolejności:
							<ul>
							<li>Zdjęcia</li>
							<li>Producenci</li>
							<li>Kategorie</li>
							<li>Wartości cech</li>
							<li>Produkty</li>
							</ul></p>', 'direction' => FormEngine\Elements\Tip::DOWN)));
            $requiredData->AddChild(new FormEngine\Elements\Select(array('name' => 'entity', 'label' => _('TXT_EXCHANGE_ENTITY'), 'options' => array(new FormEngine\Option(1, _('TXT_PRODUCTS')), new FormEngine\Option(2, _('TXT_CATEGORIES')), new FormEngine\Option(3, _('TXT_PRODUCERS')), new FormEngine\Option(4, _('TXT_PHOTOS')), new FormEngine\Option(5, _('TXT_ATTRIBUTES')), new FormEngine\Option(6, _('TXT_ORDERS')), new FormEngine\Option(7, _('TXT_SIMILARPRODUCT'))), 'default' => 1)));
            $form->AddFilter(new FormEngine\Filters\Trim());
            $form->AddFilter(new FormEngine\Filters\Secure());
            if ($form->Validate(FormEngine\FE::SubmittedData())) {
                $Data = $form->getSubmitValues(FormEngine\Elements\Form::FORMAT_FLAT);
                Session::setActiveMigrationData(json_encode($Data));
                App::redirect(__ADMINPANE__ . '/migration/index/' . $Data['entity']);
            }
            $this->registry->template->assign('form', $form->Render());
            $this->registry->xajax->processRequest();
            $this->registry->template->assign('xajax', $this->registry->xajax->getJavascript());
            $this->registry->template->display($this->loadTemplate('index.tpl'));
        } else {
            if (Session::getActiveMigrationData() == NULL) {
                App::redirect(__ADMINPANE__ . '/migration/');
            }
            $form = new FormEngine\Elements\Form(array('name' => 'add_migration', 'action' => '', 'method' => 'post'));
            $progress = $form->AddChild(new FormEngine\Elements\Fieldset(array('name' => 'progres_data', 'label' => 'Aktualizacja')));
            $progress->AddChild(new FormEngine\Elements\ProgressIndicator(array('name' => 'progress', 'label' => 'Postęp migracji', 'chunks' => 1, 'load' => array(App::getModel('migration'), 'doLoadQueque'), 'process' => array(App::getModel('migration'), 'doProcessQueque'), 'success' => array(App::getModel('migration'), 'doSuccessQueque'), 'preventSubmit' => true)));
            $form->AddFilter(new FormEngine\Filters\Trim());
            $form->AddFilter(new FormEngine\Filters\Secure());
            $this->registry->template->assign('form', $form->Render());
            $this->registry->xajax->processRequest();
            $this->registry->template->assign('xajax', $this->registry->xajax->getJavascript());
            $this->registry->template->display($this->loadTemplate('index.tpl'));
        }
    }
Ejemplo n.º 14
0
 public function initForm()
 {
     $controllers = array();
     $controllersRaw = App::getModel('groups')->getFullPermission();
     foreach ($controllersRaw as $controller) {
         $controllers[] = array('name' => $controller['name'], 'id' => $controller['id']);
     }
     $actions = array();
     $actionsRaw = $this->registry->right->getRightsToSmarty();
     foreach ($actionsRaw as $right) {
         $actions[] = array('name' => $right['name'], 'id' => $right['value']);
     }
     $form = new FormEngine\Elements\Form(array('name' => 'group', 'action' => '', 'method' => 'post'));
     $basicData = $form->AddChild(new FormEngine\Elements\Fieldset(array('name' => 'basic_data', 'label' => _('TXT_BASIC_GROUP_DATA'))));
     $basicData->AddChild(new FormEngine\Elements\TextField(array('name' => 'name', 'label' => _('TXT_GROUP_NAME'), 'rules' => array(new FormEngine\Rules\Required(_('ERR_EMPTY_GROUP_NAME')), new FormEngine\Rules\Unique(_('ERR_DUPLICATE_GROUP_NAME'), '`group`', 'name', null, array('column' => 'idgroup', 'values' => (int) $this->registry->core->getParam()))))));
     $rightsData = $form->AddChild(new FormEngine\Elements\Fieldset(array('name' => 'rights_data', 'label' => _('TXT_RIGHTS'))));
     $rightsData->AddChild(new FormEngine\Elements\RightsTable(array('name' => 'rights', 'label' => _('TXT_GROUP_RIGHTS'), 'controllers' => $controllers, 'actions' => $actions)));
     $Data = Event::dispatch($this, 'admin.groups.initForm', array('form' => $form, 'id' => (int) $this->registry->core->getParam(), 'data' => $this->populateData));
     if (!empty($Data)) {
         $form->Populate($Data);
     }
     $form->AddFilter(new FormEngine\Filters\Trim());
     $form->AddFilter(new FormEngine\Filters\Secure());
     return $form;
 }
Ejemplo n.º 15
0
 public function edit()
 {
     $tree = new FormEngine\Elements\Form(array('name' => 'category_tree', 'class' => 'category-select', 'action' => '', 'method' => 'post'));
     $categories = $this->model->getContentCategoryALL();
     $rawContentcategoryData = $this->model->getContentCategoryView($this->id);
     $tree->AddChild(new FormEngine\Elements\Tree(array('name' => 'categories', 'add_item_prompt' => _('TXT_NAME'), 'sortable' => true, 'selectable' => false, 'clickable' => true, 'deletable' => true, 'addable' => true, 'prevent_duplicates' => false, 'items' => $categories, 'onClick' => 'openCategoryEditor', 'onAdd' => 'xajax_AddCategory', 'addLabel' => _('TXT_ADD'), 'onAfterAdd' => 'openCategoryEditor', 'onDelete' => 'xajax_DeleteCategory', 'onAfterDelete' => 'openCategoryEditor', 'onSaveOrder' => 'xajax_ChangeCategoryOrder', 'active' => $this->registry->core->getParam(), 'onAfterDeleteId' => $rawContentcategoryData['next'])));
     $populateData = array('required_data' => array('footer' => $rawContentcategoryData['footer'], 'header' => $rawContentcategoryData['header'], 'contentcategoryid' => $rawContentcategoryData['contentcategory'], 'language_data' => $rawContentcategoryData['language']), 'meta_data' => array('language_data' => $rawContentcategoryData['language']), 'redirect_data' => array('redirect' => $rawContentcategoryData['redirect'], 'redirect_route' => $rawContentcategoryData['redirect_route'], 'redirect_url' => $rawContentcategoryData['redirect_url']), 'view_data' => array('view' => $rawContentcategoryData['view']));
     $this->formModel->setPopulateData($populateData);
     $form = $this->formModel->initForm();
     if ($form->Validate(FormEngine\FE::SubmittedData())) {
         try {
             $this->model->editContentCategory($form->getSubmitValues(FormEngine\Elements\Form::FORMAT_FLAT), $this->id);
         } catch (Exception $e) {
             $this->registry->template->assign('error', $e->getMessage());
         }
         Session::setVolatileMessage("Zapisano zmiany w stronie statycznej.");
         App::redirect(__ADMINPANE__ . '/contentcategory/edit/' . $this->id);
     }
     $this->renderLayout(array('form' => $form->Render(), 'tree' => $tree->Render()));
 }
Ejemplo n.º 16
0
 public function edit()
 {
     $data = $this->model->getOpinion($this->id);
     $form = new FormEngine\Elements\Form(array('name' => 'productrange', 'action' => '', 'method' => 'post'));
     $requiredData = $form->AddChild(new FormEngine\Elements\Fieldset(array('name' => 'data', 'label' => _('TXT_OPINION'))));
     $requiredData->AddChild(new FormEngine\Elements\StaticText(array('text' => '<p>' . $data['nick'] . '</p>')));
     $requiredData->AddChild(new FormEngine\Elements\Textarea(array('name' => 'review', 'label' => _('TXT_CONTENT'), 'rules' => array(new FormEngine\Rules\Required(_('ERR_FILL_AN_OPINION'))))));
     $requiredData->AddChild(new FormEngine\Elements\Checkbox(array('name' => 'enable', 'label' => _('TXT_PUBLISH'))));
     $form->Populate(array('data' => array('review' => $data['review'], 'enable' => (int) $data['enable'])));
     $form->AddFilter(new FormEngine\Filters\NoCode());
     $form->AddFilter(new FormEngine\Filters\Trim());
     $form->AddFilter(new FormEngine\Filters\Secure());
     if ($form->Validate(FormEngine\FE::SubmittedData())) {
         $this->model->editOpinion($form->getSubmitValues(), $this->registry->core->getParam());
         App::redirect(__ADMINPANE__ . '/productrange');
     }
     $this->renderLayout(array('form' => $form->Render()));
 }
Ejemplo n.º 17
0
 public function initForm()
 {
     $form = new FormEngine\Elements\Form(array('name' => 'attributeproduct', 'action' => '', 'method' => 'post'));
     $requiredData = $form->AddChild(new FormEngine\Elements\Fieldset(array('name' => 'required_data', 'label' => Translation::get('TXT_MAIN_DATA'))));
     $requiredData->AddChild(new FormEngine\Elements\TextField(array('name' => 'attributeproductname', 'label' => Translation::get('TXT_ATTRIBUTE_PRODUCT_GROUP_NAME'), 'rules' => array(new FormEngine\Rules\Required(Translation::get('ERR_EMPTY_ATTRIBUTE_PRODUCT_GROUP')), new FormEngine\Rules\Unique(Translation::get('ERR_ATTRIBUTE_PRODUCT_GROUP_ALREADY_EXISTS'), 'attributeproduct', 'name', null, array('column' => 'idattributeproduct', 'values' => $this->registry->core->getParam()))))));
     $attributesData = $form->AddChild(new FormEngine\Elements\Fieldset(array('name' => 'attributes_data', 'label' => Translation::get('TXT_ATTRIBUTES_DATA'))));
     $attributesData->AddChild(new FormEngine\Elements\TextField(array('name' => 'attributeproductvalues', 'label' => Translation::get('TXT_ATTRIBUTE_PRODUCT'), 'repeat_min' => 1, 'repeat_max' => FormEngine\FE::INFINITE, 'rules' => array(new FormEngine\Rules\Required(Translation::get('ERR_EMPTY_ATTRIBUTE_PRODUCT'))))));
     $Data = Event::dispatch($this, 'admin.attributeproduct.initForm', array('form' => $form, 'id' => (int) $this->registry->core->getParam(), 'data' => $this->populateData));
     if (!empty($Data)) {
         $form->Populate($Data);
     }
     $form->AddFilter(new FormEngine\Filters\Trim());
     $form->AddFilter(new FormEngine\Filters\NoCode());
     $form->AddFilter(new FormEngine\Filters\Secure());
     return $form;
 }
Ejemplo n.º 18
0
 public function initForm()
 {
     $form = new FormEngine\Elements\Form(array('name' => 'globalsettings', 'action' => '', 'method' => 'post'));
     $requiredData = $form->AddChild(new FormEngine\Elements\Fieldset(array('name' => 'config_data', 'label' => _('TXT_SYSTEM_CONFIGURATION'))));
     $requiredData->AddChild(new FormEngine\Elements\Tip(array('tip' => '<p>' . _('TXT_ATTENTION_AFTER_CHANGING_ADMINLINK') . '</p>', 'direction' => FormEngine\Elements\Tip::DOWN)));
     $requiredData->AddChild(new FormEngine\Elements\TextField(array('name' => 'admin_panel_link', 'label' => _('TXT_ADMIN_PANEL_LINK'), 'rules' => array(new FormEngine\Rules\Required(_('ERR_EMPTY_ADMIN_PANEL_LINK'))), 'default' => __ADMINPANE__)));
     $requiredData->AddChild(new FormEngine\Elements\Tip(array('tip' => '<p>' . _('TXT_SSL_HELP') . '</p>', 'direction' => FormEngine\Elements\Tip::DOWN)));
     $requiredData->AddChild(new FormEngine\Elements\Checkbox(array('name' => 'ssl', 'label' => _('TXT_ENABLE_SSL'))));
     $gallerySettings = $form->AddChild(new FormEngine\Elements\Fieldset(array('name' => 'gallerysettings_data', 'label' => _('TXT_GALLERY_SETTINGS'))));
     $gallerySettings->AddChild(new FormEngine\Elements\ColourSchemePicker(array('name' => 'colour', 'label' => _('TXT_GALLERY_BGCOLOUR'), 'type_colour' => true, 'type_gradient' => false, 'type_image' => false, 'file_source' => 'upload/')));
     $gallerySettings->AddChild(new FormEngine\Elements\Tip(array('tip' => '<p>' . _('TXT_GALLERY_SMALLEST_IMAGE_SETTINGS') . '</p>', 'direction' => FormEngine\Elements\Tip::DOWN)));
     $gallerySettings->AddChild(new FormEngine\Elements\TextField(array('name' => 'smallest_width', 'label' => _('TXT_WIDTH'), 'rules' => array(new FormEngine\Rules\Required(_('ERR_EMPTY_MAIL_FROMEMAIL'))), 'suffix' => 'px')));
     $gallerySettings->AddChild(new FormEngine\Elements\TextField(array('name' => 'smallest_height', 'label' => _('TXT_HEIGHT'), 'rules' => array(new FormEngine\Rules\Required(_('ERR_EMPTY_MAIL_FROMEMAIL'))), 'suffix' => 'px')));
     $gallerySettings->AddChild(new FormEngine\Elements\Checkbox(array('name' => 'smallest_keepproportion', 'label' => _('TXT_KEEP_PROPORTION'))));
     $gallerySettings->AddChild(new FormEngine\Elements\Tip(array('tip' => '<p>' . _('TXT_GALLERY_SMALL_IMAGE_SETTINGS') . '</p>', 'direction' => FormEngine\Elements\Tip::DOWN)));
     $gallerySettings->AddChild(new FormEngine\Elements\TextField(array('name' => 'small_width', 'label' => _('TXT_WIDTH'), 'rules' => array(new FormEngine\Rules\Required(_('ERR_EMPTY_MAIL_FROMEMAIL'))), 'suffix' => 'px')));
     $gallerySettings->AddChild(new FormEngine\Elements\TextField(array('name' => 'small_height', 'label' => _('TXT_HEIGHT'), 'rules' => array(new FormEngine\Rules\Required(_('ERR_EMPTY_MAIL_FROMEMAIL'))), 'suffix' => 'px')));
     $gallerySettings->AddChild(new FormEngine\Elements\Checkbox(array('name' => 'small_keepproportion', 'label' => _('TXT_KEEP_PROPORTION'))));
     $gallerySettings->AddChild(new FormEngine\Elements\Tip(array('tip' => '<p>' . _('TXT_GALLERY_MEDIUM_IMAGE_SETTINGS') . '</p>', 'direction' => FormEngine\Elements\Tip::DOWN)));
     $gallerySettings->AddChild(new FormEngine\Elements\TextField(array('name' => 'medium_width', 'label' => _('TXT_WIDTH'), 'rules' => array(new FormEngine\Rules\Required(_('ERR_EMPTY_MAIL_FROMEMAIL'))), 'suffix' => 'px')));
     $gallerySettings->AddChild(new FormEngine\Elements\TextField(array('name' => 'medium_height', 'label' => _('TXT_HEIGHT'), 'rules' => array(new FormEngine\Rules\Required(_('ERR_EMPTY_MAIL_FROMEMAIL'))), 'suffix' => 'px')));
     $gallerySettings->AddChild(new FormEngine\Elements\Checkbox(array('name' => 'medium_keepproportion', 'label' => _('TXT_KEEP_PROPORTION'))));
     $gallerySettings->AddChild(new FormEngine\Elements\Tip(array('tip' => '<p>' . _('TXT_GALLERY_NORMAL_IMAGE_SETTINGS') . '</p>', 'direction' => FormEngine\Elements\Tip::DOWN)));
     $gallerySettings->AddChild(new FormEngine\Elements\TextField(array('name' => 'normal_width', 'label' => _('TXT_WIDTH'), 'rules' => array(new FormEngine\Rules\Required(_('ERR_EMPTY_MAIL_FROMEMAIL'))), 'suffix' => 'px')));
     $gallerySettings->AddChild(new FormEngine\Elements\TextField(array('name' => 'normal_height', 'label' => _('TXT_HEIGHT'), 'rules' => array(new FormEngine\Rules\Required(_('ERR_EMPTY_MAIL_FROMEMAIL'))), 'suffix' => 'px')));
     $gallerySettings->AddChild(new FormEngine\Elements\Checkbox(array('name' => 'normal_keepproportion', 'label' => _('TXT_KEEP_PROPORTION'))));
     $gallerySettings->AddChild(new FormEngine\Elements\Tip(array('tip' => '<p>' . _('TXT_GALLERY_LARGE_IMAGE_SETTINGS') . '</p>', 'direction' => FormEngine\Elements\Tip::DOWN)));
     $gallerySettings->AddChild(new FormEngine\Elements\TextField(array('name' => 'large_width', 'label' => _('TXT_WIDTH'), 'rules' => array(new FormEngine\Rules\Required(_('ERR_EMPTY_MAIL_FROMEMAIL'))), 'suffix' => 'px')));
     $gallerySettings->AddChild(new FormEngine\Elements\TextField(array('name' => 'large_height', 'label' => _('TXT_HEIGHT'), 'rules' => array(new FormEngine\Rules\Required(_('ERR_EMPTY_MAIL_FROMEMAIL'))), 'suffix' => 'px')));
     $gallerySettings->AddChild(new FormEngine\Elements\Checkbox(array('name' => 'large_keepproportion', 'label' => _('TXT_KEEP_PROPORTION'))));
     $interfaceSettings = $form->AddChild(new FormEngine\Elements\Fieldset(array('name' => 'interface', 'label' => _('TXT_INTERFACE_SETTINGS'))));
     $interfaceSettings->AddChild(new FormEngine\Elements\TextField(array('name' => 'datagrid_rows_per_page', 'label' => _('TXT_DATAGRID_ROWS_PER_PAGE'), 'rules' => array(new FormEngine\Rules\Required(_('ERR_EMPTY_DATAGRID_ROWS_PER_PAGE'))), 'default' => 50)));
     $interfaceSettings->AddChild(new FormEngine\Elements\Select(array('name' => 'datagrid_click_row_action', 'label' => _('TXT_DATAGRID_CLICK_ROW_ACTION'), 'options' => FormEngine\Option::Make(array('edit' => _('TXT_DATAGRID_EDIT_ROW'), 'contextmenu' => _('TXT_SHOW_CONTEXT_MENU'))))));
     $Data = Event::dispatch($this, 'admin.globalsettings.initForm', array('form' => $form, 'id' => (int) $this->registry->core->getParam(), 'data' => $this->populateData));
     if (!empty($Data)) {
         $form->Populate($Data);
     }
     $form->AddFilter(new FormEngine\Filters\NoCode());
     $form->AddFilter(new FormEngine\Filters\Trim());
     $form->AddFilter(new FormEngine\Filters\Secure());
     return $form;
 }
Ejemplo n.º 19
0
 public function edit()
 {
     $form = new FormEngine\Elements\Form(array('name' => 'recipientlist', 'action' => '', 'method' => 'post'));
     $requiredData = $form->AddChild(new FormEngine\Elements\Fieldset(array('name' => 'required_data', 'label' => _('TXT_MAIN_DATA'))));
     $requiredData->AddChild(new FormEngine\Elements\TextField(array('name' => 'name', 'label' => _('TXT_NAME'), 'rules' => array(new FormEngine\Rules\Required(_('ERR_EMPTY_NAME')), new FormEngine\Rules\Unique(_('ERR_NAME_ALREADY_EXISTS'), 'recipientlist', 'name', null, array('column' => 'idrecipientlist', 'values' => (int) $this->registry->core->getParam()))))));
     $clientgroupData = $form->AddChild(new FormEngine\Elements\Fieldset(array('name' => 'clientgroup_data', 'label' => _('TXT_CLIENT_GROUPS_LIST'))));
     $clientgroupData->AddChild(new FormEngine\Elements\DatagridSelect(array('name' => 'clientgroup', 'label' => _('TXT_CLIENTGROUPS'), 'key' => 'idclientgroup', 'datagrid_init_function' => array(App::getModel('clientgroup'), 'initDatagrid'), 'repeat_max' => FormEngine\FE::INFINITE, 'columns' => $this->getClientGroupDatagridColumns())));
     $clientData = $form->AddChild(new FormEngine\Elements\Fieldset(array('name' => 'client_data', 'label' => _('TXT_CLIENTS_LIST'))));
     $clientData->AddChild(new FormEngine\Elements\DatagridSelect(array('name' => 'clients', 'label' => _('TXT_CLIENT'), 'key' => 'idclient', 'datagrid_init_function' => array(App::getModel('client'), 'initDatagrid'), 'repeat_max' => FormEngine\FE::INFINITE, 'columns' => $this->getClientDatagridColumns())));
     $clientnewsletterData = $form->AddChild(new FormEngine\Elements\Fieldset(array('name' => 'clientnewsletter_data', 'label' => _('TXT_CLIENT_NEWSLETTER_LIST'))));
     $clientnewsletterData->AddChild(new FormEngine\Elements\DatagridSelect(array('name' => 'clientnewsletter', 'label' => _('TXT_CLIENT_NEWSLETTER'), 'key' => 'idclientnewsletter', 'datagrid_init_function' => array(App::getModel('clientnewsletter'), 'initDatagrid'), 'repeat_max' => FormEngine\FE::INFINITE, 'columns' => $this->getClientNewsletterDatagridColumns())));
     $form->AddFilter(new FormEngine\Filters\NoCode());
     $form->AddFilter(new FormEngine\Filters\Trim());
     $form->AddFilter(new FormEngine\Filters\Secure());
     $rawRecipientListData = $this->model->getRecipientListView($this->registry->core->getParam());
     $groups = array();
     foreach ($rawRecipientListData['clientgrouplist'] as $groupKey => $groupValue) {
         array_push($groups, $groupValue['clientgroupid']);
     }
     $clients = array();
     foreach ($rawRecipientListData['clientlist'] as $clientKey => $clientValue) {
         array_push($clients, $clientValue['clientid']);
     }
     $clientnewsletter = array();
     foreach ($rawRecipientListData['clientnewsletterlist'] as $clientnewsletterKey => $clientnewsletterValue) {
         array_push($clientnewsletter, $clientnewsletterValue['clientnewsletterid']);
     }
     $RecipientListData = array('required_data' => array('name' => $rawRecipientListData['name']), 'clientgroup_data' => array('clientgroup' => $groups), 'client_data' => array('clients' => $clients), 'clientnewsletter_data' => array('clientnewsletter' => $clientnewsletter));
     $form->Populate($RecipientListData);
     if ($form->Validate(FormEngine\FE::SubmittedData())) {
         try {
             $this->model->editRecipientList($form->getSubmitValues(FormEngine\Elements\Form::FORMAT_FLAT), $this->registry->core->getParam());
         } catch (Exception $e) {
             $this->registry->template->assign('error', $e->getMessage());
         }
         App::redirect(__ADMINPANE__ . '/recipientlist');
     }
     $this->registry->xajax->processRequest();
     $this->registry->template->assign('xajax', $this->registry->xajax->getJavascript());
     $this->registry->template->assign('form', $form->Render());
     $this->registry->template->display($this->loadTemplate('edit.tpl'));
 }
Ejemplo n.º 20
0
 public function initForm()
 {
     $form = new FormEngine\Elements\Form(array('name' => 'clientgroup', 'action' => '', 'method' => 'post'));
     $requiredData = $form->AddChild(new FormEngine\Elements\Fieldset(array('name' => 'required_data', 'label' => _('TXT_MAIN_DATA'))));
     $languageData = $requiredData->AddChild(new FormEngine\Elements\FieldsetLanguage(array('name' => 'language_data', 'label' => _('TXT_LANGUAGE_DATA'))));
     $languageData->AddChild(new FormEngine\Elements\TextField(array('name' => 'name', 'label' => _('TXT_GROUP_NAME'), 'rules' => array(new FormEngine\Rules\Required(_('ERR_EMPTY_GROUP_NAME')), new FormEngine\Rules\LanguageUnique(_('ERR_GROUP_NAME_ALREADY_EXISTS'), 'clientgrouptranslation', 'name', null, array('column' => 'clientgroupid', 'values' => (int) $this->registry->core->getParam()))))));
     $clientsData = $form->AddChild(new FormEngine\Elements\Fieldset(array('name' => 'clients_data', 'label' => _('TXT_CLIENTS_SELECTION'))));
     $clientsData->AddChild(new FormEngine\Elements\DatagridSelect(array('name' => 'clients', 'label' => _('TXT_SELECT_CLIENTS'), 'key' => 'idclient', 'datagrid_init_function' => array(App::getModel('client/client'), 'initDatagrid'), 'repeat_max' => FormEngine\FE::INFINITE, 'columns' => $this->getClientDatagridColumns())));
     $Data = Event::dispatch($this, 'admin.clientgroup.initForm', array('form' => $form, 'id' => (int) $this->registry->core->getParam(), 'data' => $this->populateData));
     if (!empty($Data)) {
         $form->Populate($Data);
     }
     $form->AddFilter(new FormEngine\Filters\Trim());
     $form->AddFilter(new FormEngine\Filters\NoCode());
     $form->AddFilter(new FormEngine\Filters\Secure());
     return $form;
 }
Ejemplo n.º 21
0
 public function initForm()
 {
     $form = new FormEngine\Elements\Form(array('name' => 'attributegroup', 'action' => '', 'method' => 'post', 'class' => 'attributeGroupEditor'));
     $groupData = $form->AddChild(new FormEngine\Elements\Fieldset(array('name' => 'group_data', 'class' => 'group-data', 'label' => _('TXT_ATTRIBUTE_GROUP_DATA'))));
     $groupData->AddChild(new FormEngine\Elements\TextField(array('name' => 'attributegroupname', 'label' => _('TXT_ATTRIBUTE_GROUP_NAME'), 'rules' => array(new FormEngine\Rules\Required(_('ERR_EMPTY_ATTRIBUTE_GROUP_NAME')), new FormEngine\Rules\Unique(_('ERR_ATTRIBUTE_PRODUCT_GROUP_ALREADY_EXISTS'), 'attributegroupname', 'name', null, array('column' => 'idattributegroupname', 'values' => (int) $this->registry->core->getParam()))))));
     $category = $groupData->AddChild(new FormEngine\Elements\Tree(array('name' => 'category', 'label' => _('TXT_CATEGORY'), 'choosable' => false, 'selectable' => true, 'sortable' => false, 'clickable' => false, 'items' => App::getModel('category')->getChildCategories(), 'load_children' => array(App::getModel('category'), 'getChildCategories'))));
     $attributeData = $form->AddChild(new FormEngine\Elements\Fieldset(array('name' => 'attribute_data', 'class' => 'attribute-data', 'label' => _('TXT_ATTRIBUTES'))));
     $attributeData->AddChild(new FormEngine\Elements\AttributeEditor(array('name' => 'attributes', 'label' => _('TXT_ATTRIBUTES'), 'set' => $this->registry->core->getParam())));
     $Data = Event::dispatch($this, 'admin.attributegroup.initForm', array('form' => $form, 'id' => (int) $this->registry->core->getParam(), 'data' => $this->populateData));
     if (!empty($Data)) {
         $form->Populate($Data);
     }
     $form->AddFilter(new FormEngine\Filters\Trim());
     $form->AddFilter(new FormEngine\Filters\NoCode());
     $form->AddFilter(new FormEngine\Filters\Secure());
     return $form;
 }
Ejemplo n.º 22
0
 public function initForm()
 {
     $form = new FormEngine\Elements\Form(array('name' => 'deliverer', 'action' => '', 'method' => 'post'));
     $requiredData = $form->AddChild(new FormEngine\Elements\Fieldset(array('name' => 'required_data', 'label' => _('TXT_MAIN_DATA'))));
     $languageData = $requiredData->AddChild(new FormEngine\Elements\FieldsetLanguage(array('name' => 'language_data', 'label' => _('TXT_LANGUAGE_DATA'))));
     $languageData->AddChild(new FormEngine\Elements\TextField(array('name' => 'name', 'label' => _('TXT_NAME'), 'rules' => array(new FormEngine\Rules\Required(_('ERR_EMPTY_NAME')), new FormEngine\Rules\LanguageUnique(_('ERR_NAME_ALREADY_EXISTS'), 'deliverertranslation', 'name', null, array('column' => 'delivererid', 'values' => (int) $this->registry->core->getParam()))))));
     $languageData->AddChild(new FormEngine\Elements\TextField(array('name' => 'www', 'label' => _('TXT_WWW'))));
     $languageData->AddChild(new FormEngine\Elements\TextField(array('name' => 'email', 'label' => _('TXT_EMAIL'), 'comment' => _('TXT_EXAMPLE') . ': gekosale@gekosale.pl', 'rules' => array(new FormEngine\Rules\Required(_('ERR_EMPTY_EMAIL')), new FormEngine\Rules\Email(_('ERR_WRONG_EMAIL'))))));
     $relatedProducts = $form->AddChild(new FormEngine\Elements\Fieldset(array('name' => 'related_products', 'label' => _('TXT_SELECT_PRODUCTS'))));
     $relatedProducts->AddChild(new FormEngine\Elements\ProductSelect(array('name' => 'products', 'label' => _('TXT_SELECT_PRODUCTS'), 'repeat_min' => 1, 'repeat_max' => FormEngine\FE::INFINITE)));
     $photosPane = $form->AddChild(new FormEngine\Elements\Fieldset(array('name' => 'photos_pane', 'label' => _('TXT_SINGLE_PHOTO'))));
     $photosPane->AddChild(new FormEngine\Elements\Image(array('name' => 'photo', 'label' => _('TXT_SINGLE_PHOTO'), 'repeat_min' => 0, 'repeat_max' => 1, 'upload_url' => App::getURLAdressWithAdminPane() . 'files/add')));
     $Data = Event::dispatch($this, 'admin.deliverer.initForm', array('form' => $form, 'id' => (int) $this->registry->core->getParam(), 'data' => $this->populateData));
     if (!empty($Data)) {
         $form->Populate($Data);
     }
     $form->AddFilter(new FormEngine\Filters\NoCode());
     $form->AddFilter(new FormEngine\Filters\Trim());
     $form->AddFilter(new FormEngine\Filters\Secure());
     return $form;
 }
Ejemplo n.º 23
0
 public function add()
 {
     $form = new FormEngine\Elements\Form(array('name' => 'productnews', 'action' => '', 'method' => 'post'));
     $requiredData = $form->AddChild(new FormEngine\Elements\Fieldset(array('name' => 'required_data', 'label' => _('TXT_SELECT_PRODUCTS'))));
     $productid = $requiredData->AddChild(new FormEngine\Elements\ProductSelect(array('name' => 'productid', 'label' => _('TXT_SELECT_PRODUCTS'), 'rules' => array(new FormEngine\Rules\Required(_('TXT_SELECT_PRODUCTS'))), 'exclude' => $this->model->getExcludeProducts(), 'repeat_min' => 1, 'repeat_max' => FormEngine\FE::INFINITE)));
     $newData = $form->AddChild(new FormEngine\Elements\Fieldset(array('name' => 'new_data', 'label' => _('TXT_NEW_DATA'))));
     $newData->AddChild(new FormEngine\Elements\Date(array('name' => 'adddate', 'label' => _('TXT_ADDDATE'))));
     $newData->AddChild(new FormEngine\Elements\Date(array('name' => 'startnew', 'label' => _('TXT_START_DATE'))));
     $newData->AddChild(new FormEngine\Elements\Date(array('name' => 'endnew', 'label' => _('TXT_END_DATE'))));
     $form->AddFilter(new FormEngine\Filters\NoCode());
     $form->AddFilter(new FormEngine\Filters\Trim());
     $form->AddFilter(new FormEngine\Filters\Secure());
     if ($form->Validate(FormEngine\FE::SubmittedData())) {
         $Data = $form->getSubmitValues(FormEngine\Elements\Form::FORMAT_FLAT);
         $this->model->addProductNews($Data);
         App::redirect(__ADMINPANE__ . '/productnews');
     }
     $this->registry->template->assign('form', $form->Render());
     $this->registry->template->assign('xajax', $this->registry->xajax->getJavascript());
     $this->registry->xajax->processRequest();
     $this->registry->template->display($this->loadTemplate('add.tpl'));
 }
Ejemplo n.º 24
0
 public function initForm()
 {
     $form = new FormEngine\Elements\Form(array('name' => 'crosssell', 'action' => '', 'method' => 'post'));
     $requiredData = $form->AddChild(new FormEngine\Elements\Fieldset(array('name' => 'required_data', 'label' => _('TXT_BASE_PRODUCT'))));
     if ((int) $this->registry->core->getParam() > 0) {
         $requiredData->AddChild(new FormEngine\Elements\Constant(array('name' => 'name', 'label' => _('TXT_BASE_PRODUCT'))));
         $relatedProducts = $form->AddChild(new FormEngine\Elements\Fieldset(array('name' => 'related_products', 'label' => _('TXT_SIMILAR_PRODUCTS'))));
         $relatedProducts->AddChild(new FormEngine\Elements\ProductSelectRelated(array('name' => 'products', 'label' => _('TXT_SIMILAR_PRODUCTS'), 'rules' => array(new FormEngine\Rules\Required(_('ERR_EMPTY_SIMILAR_PRODUCTS'))), 'repeat_min' => 1, 'repeat_max' => FormEngine\FE::INFINITE, 'exclude' => array((int) $this->registry->core->getParam()))));
     } else {
         $productid = $requiredData->AddChild(new FormEngine\Elements\ProductSelect(array('name' => 'productid', 'label' => _('TXT_BASE_PRODUCT'), 'rules' => array(new FormEngine\Rules\Required(_('ERR_EMPTY_BASE_PRODUCT'))))));
         $relatedProducts = $form->AddChild(new FormEngine\Elements\Fieldset(array('name' => 'related_products', 'label' => _('TXT_SIMILAR_PRODUCTS'))));
         $relatedProducts->AddChild(new FormEngine\Elements\ProductSelectRelated(array('name' => 'products', 'label' => _('TXT_SIMILAR_PRODUCTS'), 'rules' => array(new FormEngine\Rules\Required(_('ERR_EMPTY_SIMILAR_PRODUCTS'))), 'repeat_min' => 1, 'repeat_max' => FormEngine\FE::INFINITE, 'exclude_from' => $productid)));
     }
     $Data = Event::dispatch($this, 'admin.upsell.initForm', array('form' => $form, 'id' => (int) $this->registry->core->getParam(), 'data' => $this->populateData));
     if (!empty($Data)) {
         $form->Populate($Data);
     }
     $form->AddFilter(new FormEngine\Filters\NoCode());
     $form->AddFilter(new FormEngine\Filters\Trim());
     $form->AddFilter(new FormEngine\Filters\Secure());
     return $form;
 }
Ejemplo n.º 25
0
 public function initForm()
 {
     $form = new FormEngine\Elements\Form(array('name' => 'productstatus', 'action' => '', 'method' => 'post'));
     $requiredData = $form->AddChild(new FormEngine\Elements\Fieldset(array('name' => 'required_data', 'label' => _('TXT_MAIN_DATA'))));
     $requiredData->AddChild(new FormEngine\Elements\TextField(array('name' => 'name', 'label' => _('TXT_NAME'), 'rules' => array(new FormEngine\Rules\Required(_('ERR_EMPTY_NAME'))))));
     $requiredData->AddChild(new FormEngine\Elements\TextField(array('name' => 'symbol', 'label' => _('Status symbol'), 'comment' => 'Symbol wykorzystywany np. w szablonach CSS. Dozwolone znaki alfanumeryczne.', 'rules' => array(new FormEngine\Rules\Format(_('ERR_WRONG_FORMAT'), '/^([A-Za-z0-9-])*$/')))));
     $Data = Event::dispatch($this, 'admin.productstatus.initForm', array('form' => $form, 'id' => (int) $this->registry->core->getParam(), 'data' => $this->populateData));
     if (!empty($Data)) {
         $form->Populate($Data);
     }
     $form->AddFilter(new FormEngine\Filters\NoCode());
     $form->AddFilter(new FormEngine\Filters\Trim());
     $form->AddFilter(new FormEngine\Filters\Secure());
     return $form;
 }
Ejemplo n.º 26
0
 public function initForm()
 {
     $form = new FormEngine\Elements\Form(array('name' => 'buyalso', 'action' => '', 'method' => 'post'));
     $requiredData = $form->AddChild(new FormEngine\Elements\Fieldset(array('name' => 'required_data', 'label' => _('TXT_BASE_PRODUCT'))));
     $requiredData->AddChild(new FormEngine\Elements\Constant(array('name' => 'name', 'label' => _('TXT_BASE_PRODUCT'))));
     $requiredData->AddChild(new FormEngine\Elements\MultiSelect(array('name' => 'products', 'label' => _('TXT_BUY_ALSO_LIST'), 'options' => FormEngine\Option::Make(App::getModel('buyalso')->getProductAlsoToSelect()))));
     $Data = Event::dispatch($this, 'admin.buyalso.initForm', array('form' => $form, 'id' => (int) $this->registry->core->getParam(), 'data' => $this->populateData));
     if (!empty($Data)) {
         $form->Populate($Data);
     }
     $form->AddFilter(new FormEngine\Filters\Trim());
     $form->AddFilter(new FormEngine\Filters\NoCode());
     $form->AddFilter(new FormEngine\Filters\Secure());
     return $form;
 }
Ejemplo n.º 27
0
 public function initForm()
 {
     $form = new FormEngine\Elements\Form(array('name' => 'vat', 'action' => '', 'method' => 'post'));
     $requiredData = $form->AddChild(new FormEngine\Elements\Fieldset(array('name' => 'required_data', 'label' => _('TXT_MAIN_DATA'))));
     $languageData = $requiredData->AddChild(new FormEngine\Elements\FieldsetLanguage(array('name' => 'language_data', 'label' => _('TXT_LANGUAGE_DATA'))));
     $languageData->AddChild(new FormEngine\Elements\TextField(array('name' => 'name', 'label' => _('TXT_NAME'), 'rules' => array(new FormEngine\Rules\Required(_('ERR_EMPTY_NAME')), new FormEngine\Rules\Unique(_('ERR_VAT_ALREADY_EXISTS'), 'vattranslation', 'name', null, array('column' => 'vatid', 'values' => (int) $this->registry->core->getParam()))))));
     $requiredData->AddChild(new FormEngine\Elements\TextField(array('name' => 'value', 'label' => _('TXT_VALUE'), 'comment' => _('TXT_VALUE_IN_PERCENT'), 'rules' => array(new FormEngine\Rules\Required(_('ERR_EMPTY_VALUE')), new FormEngine\Rules\Unique(_('ERR_VALUE_ALREADY_EXISTS'), 'vat', 'value', null, array('column' => 'idvat', 'values' => (int) $this->registry->core->getParam()))), 'suffix' => '%', 'filters' => array(new FormEngine\Filters\CommaToDotChanger()))));
     $Data = Event::dispatch($this, 'admin.vat.initForm', array('form' => $form, 'id' => (int) $this->registry->core->getParam(), 'data' => $this->populateData));
     if (!empty($Data)) {
         $form->Populate($Data);
     }
     $form->AddFilter(new FormEngine\Filters\NoCode());
     $form->AddFilter(new FormEngine\Filters\Trim());
     $form->AddFilter(new FormEngine\Filters\Secure());
     return $form;
 }
Ejemplo n.º 28
0
 public function initForm()
 {
     $form = new FormEngine\Elements\Form(array('name' => 'controllerseo', 'action' => '', 'method' => 'post'));
     $requiredData = $form->AddChild(new FormEngine\Elements\Fieldset(array('name' => 'required_data', 'label' => _('TXT_MAIN_DATA'))));
     $requiredData->AddChild(new FormEngine\Elements\TextField(array('name' => 'controller', 'label' => _('TXT_CONTROLLER'), 'rules' => array(new FormEngine\Rules\Required(_('ERR_EMPTY_CONTROLLER')), new FormEngine\Rules\Format(_('ERR_WRONG_FORMAT'), '/^[a-zA-Z]+$/')))));
     $languageData = $requiredData->AddChild(new FormEngine\Elements\FieldsetLanguage(array('name' => 'language_data', 'label' => _('TXT_LANGUAGE_DATA'))));
     $languageData->AddChild(new FormEngine\Elements\TextField(array('name' => 'translation', 'label' => _('TXT_TRANSLATION'), 'rules' => array(new FormEngine\Rules\Required(_('ERR_EMPTY_TRANSLATION'))))));
     $Data = Event::dispatch($this, 'admin.controllerseo.initForm', array('form' => $form, 'id' => (int) $this->registry->core->getParam(), 'data' => $this->populateData));
     if (!empty($Data)) {
         $form->Populate($Data);
     }
     $form->AddFilter(new FormEngine\Filters\Trim());
     $form->AddFilter(new FormEngine\Filters\Secure());
     $form->AddFilter(new FormEngine\Filters\NoCode());
     return $form;
 }
Ejemplo n.º 29
0
 public function initForm()
 {
     $form = new FormEngine\Elements\Form(array('name' => 'orderstatusgroups', 'action' => '', 'method' => 'post'));
     $requiredData = $form->AddChild(new FormEngine\Elements\Fieldset(array('name' => 'required_data', 'label' => _('TXT_MAIN_DATA'))));
     $languageData = $requiredData->AddChild(new FormEngine\Elements\FieldsetLanguage(array('name' => 'language_data', 'label' => _('TXT_LANGUAGE_DATA'))));
     $languageData->AddChild(new FormEngine\Elements\TextField(array('name' => 'name', 'label' => _('TXT_NAME'), 'rules' => array(new FormEngine\Rules\Required(_('ERR_EMPTY_NAME')), new FormEngine\Rules\LanguageUnique(_('ERR_TOPIC_ALREADY_EXISTS'), 'orderstatusgroupstranslation', 'name', null, array('column' => 'orderstatusgroupsid', 'values' => (int) $this->registry->core->getParam()))))));
     $requiredData->AddChild(new FormEngine\Elements\MultiSelect(array('name' => 'orderstatus', 'label' => _('TXT_ORDERSTATUS'), 'options' => FormEngine\Option::Make(App::getModel('orderstatus')->getOrderStatusToSelect()))));
     $requiredData->AddChild(new FormEngine\Elements\ColourSchemePicker(array('name' => 'colour', 'label' => 'Kolor statusów zamówień', 'type_colour' => true, 'type_gradient' => false, 'type_image' => false)));
     $Data = Event::dispatch($this, 'admin.orderstatusgroups.initForm', array('form' => $form, 'id' => (int) $this->registry->core->getParam(), 'data' => $this->populateData));
     if (!empty($Data)) {
         $form->Populate($Data);
     }
     $form->AddFilter(new FormEngine\Filters\NoCode());
     $form->AddFilter(new FormEngine\Filters\Trim());
     $form->AddFilter(new FormEngine\Filters\Secure());
     return $form;
 }
Ejemplo n.º 30
0
 public function initForm()
 {
     $form = new FormEngine\Elements\Form(array('name' => 'orderstatus', 'action' => '', 'method' => 'post'));
     $requiredData = $form->AddChild(new FormEngine\Elements\Fieldset(array('name' => 'required_data', 'label' => _('TXT_MAIN_DATA'))));
     $languageData = $requiredData->AddChild(new FormEngine\Elements\FieldsetLanguage(array('name' => 'language_data', 'label' => _('TXT_LANGUAGE_DATA'))));
     $languageData->AddChild(new FormEngine\Elements\TextField(array('name' => 'name', 'label' => _('TXT_NAME'), 'rules' => array(new FormEngine\Rules\Required(_('ERR_EMPTY_NAME')), new FormEngine\Rules\LanguageUnique(_('ERR_NAME_ALREADY_EXISTS'), 'orderstatustranslation', 'name', null, array('column' => 'orderstatusid', 'values' => (int) $this->registry->core->getParam()))))));
     $languageData->AddChild(new FormEngine\Elements\Textarea(array('name' => 'comment', 'label' => _('TXT_DEFAULT_ORDER_COMMENT'))));
     $requiredData->AddChild(new FormEngine\Elements\Select(array('name' => 'orderstatusgroupsid', 'label' => _('TXT_ORDER_STATUS_GROUPS'), 'rules' => array(new FormEngine\Rules\Required(_('ERR_EMPTY_ORDER_STATUS_GROUPS'))), 'options' => FormEngine\Option::Make(App::getModel('orderstatusgroups/orderstatusgroups')->getOrderStatusGroupsAllToSelect(), $this->registry->core->getDefaultValueToSelect()))));
     $Data = Event::dispatch($this, 'admin.orderstatus.initForm', array('form' => $form, 'id' => (int) $this->registry->core->getParam(), 'data' => $this->populateData));
     if (!empty($Data)) {
         $form->Populate($Data);
     }
     $form->AddFilter(new FormEngine\Filters\NoCode());
     $form->AddFilter(new FormEngine\Filters\Trim());
     $form->AddFilter(new FormEngine\Filters\Secure());
     return $form;
 }