本文整理汇总了PHP中Gekosale\App类的典型用法代码示例。如果您正苦于以下问题:PHP App类的具体用法?PHP App怎么用?PHP App使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了App类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _addFieldsContentTypeProducerBox
public function _addFieldsContentTypeProducerBox($form, $boxContent)
{
$ct_ProducerBox = $form->AddChild(new FormEngine\Elements\Fieldset(array('name' => 'ct_ProducerBox', 'label' => _('TXT_LAYOUT_BOX_CONTENT_SETTINGS'))));
$ct_ProducerBox->AddDependency(new FormEngine\Dependency(FormEngine\Dependency::SHOW, $boxContent, new FormEngine\Conditions\Equals('ProducerBox')));
$ct_ProducerBox->AddChild(new FormEngine\Elements\Select(array('name' => 'view', 'label' => 'Domyślny widok', 'options' => array(new FormEngine\Option('0', 'Lista'), new FormEngine\Option('1', 'Select')))));
$ct_ProducerBox->AddChild(new FormEngine\Elements\MultiSelect(array('name' => 'producers', 'label' => _('TXT_AVAILABLE_PRODUCERS'), 'options' => FormEngine\Option::Make(App::getModel('producer')->getProducerToSelect()))));
}
示例2: initForm
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;
}
示例3: initForm
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;
}
示例4: importPagescheme
public function importPagescheme($file)
{
$file = ROOTPATH . 'themes' . DS . $file;
require_once ROOTPATH . 'lib' . DS . 'zip' . DS . 'zip.php';
$archive = new PclZip($file);
$this->targetFolder = 'temp' . date('YmdHis');
$archive->extract(PCLZIP_OPT_PATH, ROOTPATH . 'themes' . DS . $this->targetFolder);
$info = $this->getMainInfo();
$seo = Core::clearUTF(trim($info['name']));
$seo = preg_replace('/[^A-Za-z0-9\\-\\s\\s+]/', '', $seo);
$seo = Core::clearSeoUTF($seo);
$this->templateFolder = str_replace('/', '', strtolower($seo));
if (is_dir(ROOTPATH . 'themes' . DS . $this->templateFolder)) {
$this->templateFolder = $this->templateFolder . date('YmdHis');
$info['name'] = $info['name'] . ' (Kopia ' . date('Y-m-d H:i:s') . ')';
}
rename(ROOTPATH . 'themes' . DS . $this->targetFolder, ROOTPATH . 'themes' . DS . $this->templateFolder);
$this->getImportData();
Db::getInstance()->beginTransaction();
if (!empty($this->importData)) {
$this->pageSchemeId = App::getModel('pagescheme')->addPageScheme(array('name' => $info['name'], 'templatefolder' => $this->templateFolder));
$this->saveBoxes($this->importData['boxes'], $this->pageSchemeId);
$this->saveSubpages($this->importData['layouts'], $this->pageSchemeId);
}
Db::getInstance()->commit();
$this->clearCache(ROOTPATH . DS . 'serialization', false);
$this->clearCache(ROOTPATH . DS . 'cache', false);
}
示例5: __construct
public function __construct($type, $field, $condition, $argument = null)
{
$this->_argument = $argument;
$this->type = $type;
$this->registry = App::getRegistry();
if (is_object($condition) && is_subclass_of($condition, 'FormEngine\\Condition')) {
$this->_condition = $condition;
} else {
$this->_srcFunction = $condition;
$this->_id = self::$_nextId++;
switch ($this->type) {
case self::EXCHANGE_OPTIONS:
$this->_jsFunction = 'GetOptions_' . $this->_id;
$this->registry->xajax->registerFunction(array($this->_jsFunction, $this, 'doAjaxOptionsRequest_' . $this->_id));
break;
case self::INVOKE_CUSTOM_FUNCTION:
$this->_jsFunction = $condition;
break;
case self::SUGGEST:
$this->_jsFunction = 'GetSuggestions_' . $this->_id;
$this->registry->xajax->registerFunction(array($this->_jsFunction, $this, 'doAjaxSuggestionRequest_' . $this->_id));
}
}
$this->_field = $field;
}
示例6: index
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'));
}
示例7: edit
public function edit()
{
$rawAttributeGroupData = $this->model->getGroup($this->id);
if (empty($rawAttributeGroupData)) {
App::redirect(__ADMINPANE__ . '/attributegroup/');
}
$this->registry->xajaxInterface->registerFunction(array('AddGroup', $this->model, 'addEmptyGroup'));
$this->registry->xajaxInterface->registerFunction(array('DeleteGroup', $this->model, 'deleteGroup'));
$populateData = array('group_data' => array('attributegroupname' => $rawAttributeGroupData['name'], 'category' => $rawAttributeGroupData['category']), 'attribute_data' => array('attributes' => $rawAttributeGroupData['attributes']));
$error = Session::getVolatileErrorMessage();
if ($error) {
$this->registry->template->assign('errormessage', print_r($error, 1));
}
$this->formModel->setPopulateData($populateData);
$form = $this->formModel->initForm();
if ($form->Validate(FormEngine\FE::SubmittedData())) {
try {
$this->model->editAttributeGroup($form->getSubmitValues(FormEngine\Elements\Form::FORMAT_FLAT), $this->id);
} catch (Exception $e) {
$this->registry->template->assign('error', $e->getMessage());
}
App::redirect(__ADMINPANE__ . '/attributegroup/edit/' . $this->id);
}
$this->renderLayout(array('form' => $form->Render(), 'existingGroups' => $this->model->getAllAttributeGroupName(), 'currentGroup' => $rawAttributeGroupData));
}
示例8: initForm
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;
}
示例9: confirm
public function confirm()
{
$param = base64_decode($this->registry->core->getParam());
$Data = App::getModel('mainside')->search($param);
$html = '<div class="livesearch-results">';
if (isset($Data['orders'])) {
$html .= '<h3>Zamówienia:</h3>';
$html .= '<ul>';
foreach ($Data['orders'] as $key => $result) {
$html .= $result;
}
$html .= '</ul>';
}
if (isset($Data['clients'])) {
$html .= '<h3>Klienci:</h3>';
$html .= '<ul>';
foreach ($Data['clients'] as $key => $result) {
$html .= $result;
}
$html .= '</ul>';
}
if (isset($Data['products'])) {
$html .= '<h3>Produkty:</h3>';
$html .= '<ul>';
foreach ($Data['products'] as $key => $result) {
$html .= $result;
}
$html .= '</ul>';
}
$html .= '</div>';
echo $html;
}
示例10: getPaymentMethodConfigurationForm
public function getPaymentMethodConfigurationForm($event, $request)
{
if ($request['data']['paymentmethodmodel'] != $this->getName()) {
return false;
}
$payu =& $request['form']->AddChild(new FormEngine\Elements\Fieldset(array('name' => 'payu_data', 'label' => 'Konfiguracja')));
$payu->AddChild(new FormEngine\Elements\Tip(array('tip' => '<p>Wprowadź dane punktu płatności. Adresy konieczne do ustawienia przy jego tworzeniu to:</p>
<ul>
<li>Adres powrotu - błąd: <strong>' . $this->registry->router->generate('frontend.payment', true, array('action' => 'cancel', 'param' => 'platnosci')) . '</strong></li>
<li>Adres powrotu - poprawnie: <strong>' . $this->registry->router->generate('frontend.payment', true, array('action' => 'confirm', 'param' => 'platnosci')) . '</strong></li>
<li>Adres raportów: <strong>' . $this->registry->router->generate('frontend.payment', true, array('action' => 'report', 'param' => 'platnosci')) . '</strong></li>
</ul>')));
$payu->AddChild(new FormEngine\Elements\TextField(array('name' => 'idpos', 'label' => 'Id punktu płatności (pos_id)')));
$payu->AddChild(new FormEngine\Elements\Password(array('name' => 'firstmd5', 'label' => 'Klucz (MD5)')));
$payu->AddChild(new FormEngine\Elements\TextField(array('name' => 'secondmd5', 'label' => 'Drugi klucz (MD5)')));
$payu->AddChild(new FormEngine\Elements\TextField(array('name' => 'authkey', 'label' => 'Klucz autoryzacji płatności (pos_auth_key)')));
$statuses = App::getModel('orderstatus')->getOrderStatusToSelect();
$payu->AddChild(new FormEngine\Elements\Tip(array('tip' => '<p>Ustaw powiązania statusów PayU ze sklepem</p>')));
foreach ($this->_statusMap as $id => $name) {
$payu->AddChild(new FormEngine\Elements\Select(array('name' => 'payu_status_' . $id, 'label' => $name, 'options' => FormEngine\Option::Make($statuses))));
}
$settings = $this->registry->core->loadModuleSettings('payu', Helper::getViewId());
if (!empty($settings)) {
$populate = array('payu_data' => array('idpos' => $settings['idpos'], 'firstmd5' => $settings['firstmd5'], 'secondmd5' => $settings['secondmd5'], 'authkey' => $settings['authkey']));
foreach ($this->_statusMap as $id => $name) {
if (isset($settings['payu_status_' . $id])) {
$populate['payu_data']['payu_status_' . $id] = $settings['payu_status_' . $id];
}
}
$event->setReturnValues($populate);
}
}
示例11: index
public function index()
{
if (Session::getActiveClientid() == NULL) {
$form = new SimpleForm\Form(array('name' => 'order', 'action' => '', 'method' => 'post'));
$form->AddChild(new SimpleForm\Elements\TextField(array('name' => 'email', 'label' => _('TXT_EMAIL'), 'rules' => array(new SimpleForm\Rules\Required(_('ERR_EMPTY_EMAIL')), new SimpleForm\Rules\Email(_('ERR_WRONG_EMAIL'))))));
$form->AddChild(new SimpleForm\Elements\TextField(array('name' => 'orderid', 'label' => _('TXT_ORDER_NUMER'), 'rules' => array(new SimpleForm\Rules\Required(_('ERR_EMPTY_ORDER_ID'))))));
if ($form->Validate()) {
$formData = $form->getSubmitValues();
$order = App::getModel('order')->getOrderStatusByEmailAndId($formData['email'], $formData['orderid']);
if ($order != NULL) {
$this->registry->template->assign('status', array('orderid' => $formData['orderid'], 'name' => $order));
} else {
$this->registry->template->assign('status', NULL);
}
}
$this->registry->template->assign('form', $form->getForm());
return $this->registry->template->fetch($this->loadTemplate('check.tpl'));
} else {
if ((int) $this->registry->core->getParam() > 0) {
$order = App::getModel('order')->getOrderByClient((int) $this->registry->core->getParam());
if (empty($order)) {
App::redirectUrl($this->registry->router->generate('frontend.clientorder', true));
}
$this->registry->template->assign('order', $order);
$this->registry->template->assign('orderproductlist', App::getModel('order')->getOrderProductListByClient((int) $this->registry->core->getParam()));
return $this->registry->template->fetch($this->loadTemplate('view.tpl'));
} else {
$this->registry->template->assign('orderlist', App::getModel('order')->getOrderListByClient());
return $this->registry->template->fetch($this->loadTemplate('index.tpl'));
}
}
}
示例12: edit
public function edit()
{
$rawGroupData = $this->model->getGroupsView((int) $this->id);
if (empty($rawGroupData)) {
App::redirect(__ADMINPANE__ . '/groups');
}
$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']);
}
$rightsData = array();
foreach ($controllersRaw as $controller) {
$mask = 1;
$rights = array();
for ($i = 0; $i < count($actions); $i++) {
$rights[$actions[$i]['id']] = $controller['permission'] & $mask ? 1 : 0;
$mask = $mask << 1;
}
$rightsData[$controller['id']] = $rights;
}
$populateData = array('basic_data' => array('name' => $rawGroupData['name']), 'rights_data' => array('rights' => $rightsData));
$this->formModel->setPopulateData($populateData);
$form = $this->formModel->initForm();
if ($form->Validate(FormEngine\FE::SubmittedData())) {
$this->model->editPermission($form->getSubmitValues(), $this->id);
App::redirect(__ADMINPANE__ . '/groups');
}
$this->renderLayout(array('form' => $form->Render()));
}
示例13: initForm
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;
}
示例14: initForm
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;
}
示例15: __construct
public function __construct($registry, $designPath = NULL)
{
$this->registry = $registry;
$this->id = $this->registry->core->getParam();
$this->model = \Gekosale\App::getModel($this->getName());
$this->formModel = \Gekosale\App::getFormModel($this->getName());
}