function outputMoveHref()
 {
     $request = new Request();
     $request->setView('MoveProducts');
     $request->setAction('MoveToProducts');
     return $request->getURL();
 }
 /**
  * @ describe the function ->getTag.
  */
 function getTag($tag)
 {
     global $application;
     $value = null;
     switch ($tag) {
         case 'EditLink':
             $request = new Request();
             $request->setAction('SetCurrentProductType');
             $request->setView('EditProductType');
             $request->setKey('type_id', $this->_type['id']);
             $value = $request->getURL();
             break;
         case 'TypeName':
             $value = $this->_type['name'];
             break;
         case 'TypeDescription':
             $value = '';
             if ($this->_type['description'] != '') {
                 $value = ' - ' . $this->_type['description'];
             }
             break;
         case 'ProductTypes':
             $value = $this->outputProductTypes();
             break;
         default:
             break;
     }
     return $value;
 }
 /**
  * Processes tags in the templates for the given view.
  *
  * @return string tag value, if tag has been processed. NULL, otherwise.
  */
 function getTag($tag)
 {
     global $application;
     $value = null;
     switch ($tag) {
         case 'Local_SearchFormAction':
             $_request = new Request();
             $_request->setView('SearchResult');
             $value = $_request->getURL();
             break;
         case 'Local_SearchFormName':
             $value = 'CatalogSearchForm';
             break;
         case 'Local_ActionName':
             $value = 'asc_action';
             break;
         case 'Local_ActionValue':
             $value = 'SearchProducts';
             break;
         case 'Local_SearchTextFieldName':
             $value = 'search_pattern';
             break;
         case 'Local_SearchText':
             if (modApiFunc('Session', 'is_Set', 'search_result_id')) {
                 $search_id = modApiFunc('Session', 'get', 'search_result_id');
                 $value = modApiFunc('CatalogSearch', 'getSearchPatternInSearchResult', $search_id);
                 $value = prepareHTMLDisplay($value);
             } else {
                 $value = '';
             }
             break;
     }
     return $value;
 }
 /**
  * Returns Review info tag value
  */
 function getReviewTagValue($tag)
 {
     $output = '';
     // if productid is incorrect returns '' in any case
     if ($this->_productid_invalid) {
         return '';
     }
     switch ($tag) {
         case 'number':
             $output = modApiFunc('Customer_Reviews', 'getProductCustomerReviewNumber', $this->_productid);
             if (!$this->checkReviewAvail(6, 7)) {
                 $output = 0;
             }
             break;
         case 'averagerating':
             $output = modApiFunc('Customer_Reviews', 'getTotalProductRating', $this->_productid);
             $output = $output['total_rating'];
             if (!$this->checkReviewAvail(7)) {
                 $output = 0;
             }
             break;
         case 'link':
             $cid = modApiFunc('CProductListFilter', 'getCurrentCategoryId');
             $r = new Request();
             $r->setView('ProductInfo');
             $r->setAction('SetCurrentProduct');
             $r->setKey('prod_id', $this->_productid);
             $r->setProductID($this->_productid);
             $r->setCategoryID($cid);
             $r->setAnchor('customer_reviews_' . $this->_productid);
             return $r->getURL();
     }
     return $output;
 }
 /**
  *
  */
 function output()
 {
     global $application;
     $request = new Request();
     $request->setView('AdminBackupDeleteProgress');
     $request->setAction('BackupDeleteAction');
     $ProgressBarFormAction = $request->getURL();
     $ImgQtyTotal = modApiFunc("Tools", "getImgQtyTotal");
     $DeletedImgQty = modApiFunc("Tools", "getDeletedImgQty");
     if ($ImgQtyTotal) {
         if ($ImgQtyTotal == $DeletedImgQty + 3) {
             $ProgressBarWidth = 400;
             modApiFunc("Tools", "unsetDeletedImgQty");
             modApiFunc("Tools", "unsetImgQtyTotal");
         } else {
             $ProgressBarWidth = floor($DeletedImgQty / $ImgQtyTotal * 400);
         }
     } else {
         $ProgressBarWidth = 0;
     }
     if (!is_dir($application->getAppIni('PATH_BACKUP_DIR') . modApiFunc("Tools", "getCurrentBackupFile") . "/")) {
         $ProgressBarWidth = 400;
         modApiFunc("Tools", "unsetDeletedImgQty");
         modApiFunc("Tools", "unsetImgQtyTotal");
     }
     modApiFunc("Tools", "saveState");
     $template_contents = array('ProgressBarFormAction' => $ProgressBarFormAction, 'ProgressBarWidth' => $ProgressBarWidth);
     $this->_Template_Contents = $template_contents;
     $application->registerAttributes($this->_Template_Contents);
     return modApiFunc('TmplFiller', 'fill', "tools/backup_delete_progress/", "container.tpl.html", array());
 }
Esempio n. 6
0
 /**
  * @param	Huxtable\Web\Request	$request
  * @return	Huxtable\Web\Response
  */
 public function route(Request $request)
 {
     $url = $request->getURL();
     $method = $request->getMethod();
     // Default response
     $response = new Response();
     $response->setStatusCode(404);
     $response->setContents('Not Found :(');
     if (isset($this->routes[$url])) {
         $routes = $this->routes[$url];
         // Route pattern + method match found
         if (isset($this->routes[$url][$method])) {
             $routeObject = $this->routes[$url][$method];
             $routeObject->setRequest($request);
             // Call authenticatiion callback if defined
             $authenticationClosure = $routeObject->getAuthenticationClosure();
             if ($authenticationClosure != false) {
                 try {
                     call_user_func($authenticationClosure);
                 } catch (Request\UnauthorizedException $e) {
                     $routeObject->response->setStatusCode(401);
                     $routeObject->response->setContents($routeObject->response->getStatusMessage());
                     return $routeObject->response;
                 }
             }
             // Confirm required headers were sent
             foreach ($routeObject->getRequiredHeaders() as $header) {
                 if ($request->getHeader($header) === false) {
                     $response->setStatusCode(400);
                     $response->setContents($routeObject->response->getContents());
                     return $response;
                 }
             }
             // Confirm required arguments were passed
             foreach ($routeObject->getRequiredArguments() as $argument) {
                 if ($request->getArgument($argument) === false) {
                     $response = new Response();
                     $response->setStatusCode(400);
                     $response->setContents("Missing required argument '{$argument}'");
                     return $response;
                 }
             }
             try {
                 // Call the main routing closure
                 $contents = call_user_func($routeObject->getClosure());
             } catch (\Exception $e) {
                 $response = new Response();
                 $response->setStatusCode(500);
                 $response->setContents($e->getMessage());
                 return $response;
             }
             $routeObject->response->setContents($contents);
             return $routeObject->response;
         }
         // No route pattern + method match found
         $response->setStatusCode(405);
         $response->setContents('Method Not Allowed :(');
     }
     return $response;
 }
 /**
  * MailInfo constructor
  */
 function MailInfo()
 {
     global $application;
     $MR =& $application->getInstance('MessageResources');
     //initialize form data with null values when adding a new notification
     $this->currentNotificationId = modApiFunc("Notifications", "getCurrentNotificationId");
     if ($this->currentNotificationId == 'Add') {
         $this->notificationInfo = array('Id' => '', 'Name' => '', 'Subject' => '', 'Body' => '', 'JavascriptBody' => '', 'From_addr' => '', 'Email_Code' => '', 'Active' => 'checked', 'Action_id' => 1);
         $request = new Request();
         $request->setView('NotificationInfo');
         $request->setAction('AddNotification');
         $formAction = $request->getURL();
         $this->properties = array('SubmitButton' => $MR->getMessage('BTN_ADD'), 'FormAction' => $formAction);
     } else {
         //initialize form data with database values when editing the notification
         $this->notificationInfo = modApiFunc("Notifications", "getNotificationInfo", $this->currentNotificationId);
         if (sizeof($this->notificationInfo) == 1) {
             $this->notificationInfo = $this->notificationInfo[0];
             $this->notificationInfo['JavascriptBody'] = addcslashes(addslashes($this->notificationInfo['Body']), "..");
             $this->notificationInfo['Body'] = prepareHTMLDisplay($this->notificationInfo['Body']);
         } else {
             $this->currentNotificationId = 'Add';
             $this->notificationInfo = array('Id' => '', 'Name' => '', 'Subject' => '', 'Body' => '', 'JavascriptBody' => '', 'From_addr' => '', 'Email_Code' => '', 'Active' => 'checked', 'Action_id' => 1);
         }
         $request = new Request();
         $request->setView('NotificationInfo');
         $request->setAction('SaveNotification');
         $formAction = $request->getURL();
         $this->properties = array('SubmitButton' => $MR->getMessage('BTN_SAVE'), 'FormAction' => $formAction);
     }
     $this->actionsList = modApiFunc("Notifications", "getActionsList");
     $this->InfoTags = modApiFunc("Notifications", "getAvailableTagsList", $this->actionsList);
 }
 function output()
 {
     global $application;
     loadCoreFile('html_form.php');
     $this->_messageResources =& Subscriptions::getMessageResources();
     $this->_tmplFiller = new TmplFiller(dirname(dirname(__FILE__)) . '/templates_az/');
     $this->_topic_id = modApiFunc('Request', 'getValueByKey', 'topic');
     if (!empty($this->_topic_id)) {
         $this->_mode = SM_EDIT_TOPIC;
     } else {
         $this->_mode = SM_NEW_TOPIC;
     }
     $this->initFormData();
     if (@$this->ViewState['hasCloseScript'] == 'true') {
         modApiFunc("application", "closeChild_UpdateParent");
         return;
     }
     $this->_templateContents = array('ErrorsBox', 'AscAction');
     $application->registerAttributes($this->_templateContents);
     if ($this->_mode == SM_EDIT_TOPIC && empty($this->_topic)) {
         return $this->_tmplFiller->fill('', 'errors/no_topic_edit.tpl.html', array('Message' => $this->_messageResources->getMessage(new ActionMessage(array('TOPIC_DOESNT_EXISTS', $this->_topic_id)))));
     }
     $request = new Request();
     $request->setView(CURRENT_REQUEST_URL);
     $vars = array('FormAction' => $request->getURL(), 'AscAction' => $this->_mode == SM_NEW_TOPIC ? 'create_topic' : 'update_topic', 'TopicId' => $this->_topic_id, 'WinTitle' => $this->_messageResources->getMessage($this->_mode == SM_NEW_TOPIC ? 'TITLE_ADD_TOPIC' : 'TITLE_EDIT_TOPIC'), 'TopicName' => @$this->POST['topic_name'], 'TopicStatusSelect' => $this->getTopicStatusSelect('topic_status', @$this->POST['topic_status']), 'TopicAccessSelect' => $this->getTopicAccessSelect('topic_access', @$this->POST['topic_access']), 'TopicAutosubscribeSelect' => $this->getTopicAutoSubscribeSelect('topic_auto', @$this->POST['topic_auto']));
     $result = $this->_tmplFiller->fill('', 'edit_topic.tpl.html', $vars);
     return $result;
 }
 function output($group_id_range_from = 0, $group_id_range_to = 999999, $group_title)
 {
     $groups = modApiFunc('Reports', 'getReportGroups');
     $current_group_id = (int) modApiFunc('Request', 'getValueByKey', 'report_group_id');
     if ($current_group_id !== null and isset($groups[$current_group_id])) {
         $current_group_id = (int) $current_group_id;
     } else {
         reset($groups);
         $current_group_id = array_keys($groups);
         $current_group_id = $current_group_id[0];
     }
     $links = '';
     foreach ($groups as $grp_id => $grp) {
         if ($grp_id < $group_id_range_from or $grp_id > $group_id_range_to) {
             continue;
         }
         $data = array();
         $data['LinkName'] = $grp['GROUP_NAME'];
         $data['LinkDescription'] = $grp['GROUP_DESCRIPTION'];
         $request = new Request();
         $request->setView(CURRENT_REQUEST_URL);
         $request->setKey('report_group_id', $grp_id);
         $data['LinkHref'] = $request->getURL();
         if ($current_group_id === $grp_id and $current_group_id >= $group_id_range_from and $current_group_id <= $group_id_range_to) {
             $links .= $this->_TmplFiller->fill("", "group-link-selected.tpl.html", $data);
         } else {
             $links .= $this->_TmplFiller->fill("", "group-link.tpl.html", $data);
         }
     }
     return $this->_TmplFiller->fill("", "container.tpl.html", array('ReportGroupLinks' => $links, 'Title' => getMsg('RPTS', $group_title)));
 }
 /**
  * Returns the Select box view with possible variants of rows
  * per page.
  *
  * @return Select box with possible page values outputted on the page.
  * @ finish the functions on this page
  */
 function output($pag_name, $viewname, $items_name = 'PGNTR_REC_ITEMS', $add_keys = null)
 {
     global $application;
     $obj =& $application->getInstance('MessageResources');
     $retval = '';
     $rows_per_page = modAPIFunc('Paginator', 'getPaginatorRowsPerPage', $pag_name);
     if (!$rows_per_page) {
         $rows_per_page = ROWS_PER_PAGE;
     }
     $currentrows = $rows_per_page;
     $rows_per_page = modApiFunc('Paginator', 'getRowsPerPage');
     $Row_Options = '';
     for ($i = 0; $i < sizeof($rows_per_page); $i++) {
         if ($rows_per_page[$i] == $currentrows) {
             $Row_Options .= '<option selected="selected" value="' . $rows_per_page[$i] . '">' . $rows_per_page[$i] . '</option>';
         } else {
             $Row_Options .= '<option value="' . $rows_per_page[$i] . '">' . $rows_per_page[$i] . '</option>';
         }
     }
     $request = new Request();
     $request->setView(CURRENT_REQUEST_URL);
     $url = $request->getURL();
     $this->paginator_rows = array('ViewName' => $url, 'AdditionalKeyList' => $this->getAdditionalKeyList($add_keys), 'Items_Name' => $obj->getMessage($items_name), 'Row_Options' => $Row_Options, 'pgname' => $pag_name);
     $application->registerAttributes($this->paginator_rows);
     if (modAPIFunc('Paginator', 'getCurrentPaginatorTotalRows') > MIN_ROWS_PER_PAGE) {
         $retval = modApiFunc('TmplFiller', 'fill', "paginator/", "container_rows.tpl.html", array());
     }
     return $retval;
 }
 function formAction()
 {
     global $application;
     $request = new Request();
     $request->setView('AddTaxClass');
     $request->setAction('AddProdTaxClass');
     return $request->getURL();
 }
 function formAction()
 {
     global $application;
     $request = new Request();
     $request->setView('EditTaxRate');
     $request->setAction($this->ViewState["TaxRateAction"]);
     return $request->getURL();
 }
 function formAction()
 {
     global $application;
     $request = new Request();
     $request->setView('EditTaxName');
     $request->setAction('UpdateTaxNameAction');
     return $request->getURL();
 }
 /**
  *
  */
 function output()
 {
     global $application;
     $request = new Request();
     $request->setView('AdminBackupDeleteProgress');
     $Delete_Start_Link = $request->getURL();
     $template_contents = array('DeleteStartLink' => $Delete_Start_Link, 'BackupName' => modApiFunc("Tools", "getCurrentBackupFile"));
     $this->_Template_Contents = $template_contents;
     $application->registerAttributes($this->_Template_Contents);
     return modApiFunc('TmplFiller', 'fill', "tools/backup_delete/", "container.tpl.html", array());
 }
 function outputViewAllLink()
 {
     $value = '';
     if ($this->was_randomized) {
         $request = new Request();
         $request->setView(CURRENT_REQUEST_URL);
         $request->setKey('bs_no_rand', 1);
         $url = $request->getURL();
         $msg = cz_getMsg('VIEW_ALL_LABEL');
         $value = str_replace('{URL}', $url, $msg);
     }
     return $value;
 }
 function getTag($tag)
 {
     $value = null;
     switch ($tag) {
         case 'Local_FormActionURL':
             $r = new Request();
             $r->setView('CustomerChangePassword');
             $r->setAction('change_account_password');
             $value = $r->getURL();
             break;
     }
     return $value;
 }
 /**
  *
  */
 function output()
 {
     global $application;
     loadCoreFile('html_form.php');
     $HtmlForm = new HtmlForm();
     $request = new Request();
     $request->setView('DateTimeFormat');
     $request->setAction('UpdateDateTimeFormat');
     $formAction = $request->getURL();
     $template_contents = array("FORM" => $HtmlForm->genForm($formAction, "POST", "DateTimeForm"), "DateFormats" => $this->outputDateTimeFormats("date"), "TimeFormats" => $this->outputDateTimeFormats("time"), "ResultMessage" => $this->outputResultMessage());
     $this->_Template_Contents = $template_contents;
     $application->registerAttributes($this->_Template_Contents);
     return modApiFunc('TmplFiller', 'fill', "localization/date_settings/", "container.tpl.html", array());
 }
 function output($report_settings)
 {
     //        $res =  modApiFunc( "Charts",
     //        "getStockChartAmchart",
     //        'http://localhost/~af/trunk/avactis-system/admin/amcharts/stock/examples/data_at_irregular_intervals/data.csv',
     //        array('title 1', 'title 2'),
     //        460 // width
     //            );
     // $this->__render_settings->getReportID();
     // http://localhost/~af/trunk/avactis-system/admin/reports.php?asc_action=getReportContent&type=Excel&reportName=ChartOrdersByDay&format=csv
     global $application;
     $this->__report_settings = $report_settings;
     //                 ,                ,      -
     $report_rows = $this->__report_settings->getReportData();
     //                            ,
     $report_columns = $this->__report_settings->getColumnList();
     //                     ,          -                             ,          -                           .
     $report_column_headers = $this->__report_settings->getColumnHeaders();
     $report_column_units = $this->__report_settings->getColumnUnits();
     if (count($report_columns) < 2) {
         return "<br><br><br><br>" . getMsg('RPTS', 'CHART_ERROR') . "<br><br><br><br>";
     }
     if (empty($report_rows)) {
         return "<br><br><br><br>" . getMsg('RPTS', 'EMPTY_REPORT') . "<br><br><br><br>";
     }
     $report_id = $this->__report_settings->getReportID();
     $request = new Request();
     $request->setView(CURRENT_REQUEST_URL);
     $request->setKey('asc_action', 'getReportContent');
     $request->setKey('type', 'Excel');
     $request->setKey('format', 'csv');
     $request->setKey('csv-header', 'false');
     $request->setKey('reportName', $report_id);
     $url_csv = $request->getURL();
     $chart_width = $this->__report_settings->getReportPlaceholderWidth() - 20;
     $series = array();
     $units = array();
     //                             ,              ,
     for ($i = 1; $i < count($report_columns); $i++) {
         $series[] = $report_column_headers[$report_columns[$i]];
         $units[] = isset($report_column_units[$report_columns[$i]]) ? $report_column_units[$report_columns[$i]] : '';
     }
     $res = modApiFunc("Charts", "getStockChartAmchart", $url_csv, $series, $chart_width, 450, $units);
     return $res['html'];
     //        echo $url_csv;
     //        echo "<br>";
     //        _print($series);
     //        echo $chart_width;
     //        return '';
 }
 /**
  *
  */
 function output()
 {
     global $application;
     loadCoreFile('html_form.php');
     $HtmlForm = new HtmlForm();
     $request = new Request();
     $request->setView('WeightUnit');
     $request->setAction('UpdateWeightUnit');
     $formAction = $request->getURL();
     $template_contents = array("FORM" => $HtmlForm->genForm($formAction, "POST", "WeightForm"), "WeightUnit" => modApiFunc("Localization", "getValue", "WEIGHT_UNIT"), "WeightCoeff" => modApiFunc("Localization", "FloatToFormatStr", modApiFunc("Localization", "getValue", "WEIGHT_COEFF"), "weight_coeff"), "CoeffFormat" => modApiFunc("Localization", "format_settings_for_js", "weight_coeff"), "ResultMessage" => $this->outputResultMessage());
     $this->_Template_Contents = $template_contents;
     $application->registerAttributes($this->_Template_Contents);
     return modApiFunc('TmplFiller', 'fill', "localization/weight_settings/", "container.tpl.html", array());
 }
 /**
  * Outputs references to the category.
  */
 function getLinkToView($cid, $view_name, &$cat_info)
 {
     $_request = new Request();
     $_request->setView($view_name);
     $_request->setAction("SetCurrCat");
     $_request->setKey("category_id", $cid);
     $res = $_request->getURL();
     if ($cat_info->getCategoryTagValue('RecursiveStatus') == CATEGORY_STATUS_ONLINE) {
     } else {
         $res = $res . '" style="color: rgb(175, 175, 175);';
     }
     return $res;
     //@ check, whether last parameter was ever used
     //$application->href($_request, -1, -1, 'AdminZone');
 }
 /**
  *
  */
 function output()
 {
     global $application;
     $this->_tmplFiller =& $application->getInstance('TmplFiller');
     $request = new Request();
     $request->setView(CURRENT_REQUEST_URL);
     $request->setAction('do_newsletter_delete');
     $self_url = $request->getURL();
     $self_url = "{$self_url}&letter_id=";
     $templateContents = array('MessagesList' => $this->outputMessagesList(), 'SelfUrl' => $self_url);
     $this->_templateContents = $templateContents;
     $application->registerAttributes($this->_templateContents);
     $result = $this->_tmplFiller->fill('newsletter/', 'list.tpl.html', array());
     return $result;
 }
 function output()
 {
     global $application;
     $request = new Request();
     $request->setView(CURRENT_REQUEST_URL);
     $request->setKey("page_view", "TaxRateByZip_AddNewSet");
     $request->setAction('TaxRatesRedirectToImportAction');
     $formAction = $request->getURL();
     $title = getMsg('TAX_ZIP', 'ADD_NEW_SET_PAGE_TITLE');
     $descr_value = '';
     $updateSid = $request->getValueByKey("updateSid", 0);
     if ($updateSid) {
         $set_to_update = modApiFunc("TaxRateByZip", "getSet", $updateSid);
         if (isset($set_to_update[0]["name"])) {
             $descr_value = $set_to_update[0]["name"];
             $title = getMsg('TAX_ZIP', 'UPDATE_SET_PAGE_TITLE');
             $title = str_replace("%1%", $descr_value, $title);
             $request->setKey("updateSid", $updateSid);
             $formAction = $request->getURL();
         }
     }
     $ptypes_select = array('select_name' => 'TargetPType', 'id' => 'TargetPType', 'selected_value' => '0', 'values' => array());
     $ptypes = modApiFunc('Catalog', 'getProductTypes');
     foreach ($ptypes as $ptype) {
         $ptypes_select['values'][] = array('value' => $ptype['id'], 'contents' => $ptype['name']);
     }
     $cats_select = array('select_name' => 'TargetCategory', 'id' => 'TargetCategory', 'selected_value' => 1, 'values' => array());
     $cats = modApiFunc("Catalog", "getSubcategoriesFullListWithParent", 1, false);
     foreach ($cats as $cat) {
         $cats_select['values'][] = array('value' => $cat['id'], 'contents' => str_repeat('&nbsp;&nbsp;', $cat['level']) . $cat['name']);
     }
     $template_contents = array("FormAction" => $formAction, "DescriptionValue" => $descr_value, "Title" => $title, "Errors" => $this->outputResultMessage(), 'PTypesList' => HtmlForm::genDropdownSingleChoice($ptypes_select, ' style="width: 290px;"'), 'CategoriesList' => HtmlForm::genDropdownSingleChoice($cats_select, ' style="width: 290px;"'));
     $this->_Template_Contents = $template_contents;
     $application->registerAttributes($this->_Template_Contents);
     return $this->mTmplFiller->fill("", "container.tpl.html", array());
 }
 function outFilesByOne()
 {
     global $application;
     $html_code = '';
     foreach ($this->PFiles as $k => $pf_info) {
         $r = new Request();
         $r->setAction('direct_download_file');
         $r->setKey('file_id', $pf_info['file_id']);
         $template_contents = array('CycleColor' => $k % 2 == 0 ? '#FFFFFF' : '#EEF2F8', 'FileID' => $pf_info['file_id'], 'FileName' => $pf_info['file_name'], 'FSize' => modApiFunc('Product_Files', 'formatFileSize', $pf_info['file_size']), 'FileDescr' => prepareHTMLDisplay($pf_info['file_descr']), 'DirectFileLink' => $r->getURL());
         $this->_Template_Contents = $template_contents;
         $application->registerAttributes($this->_Template_Contents);
         $this->mTmplFiller =& $application->getInstance('TmplFiller');
         $html_code .= $this->mTmplFiller->fill("product_files/files_list/", "one-file.tpl.html", array());
     }
     return $html_code;
 }
 /**
  *
  */
 function output()
 {
     global $application;
     $request = new Request();
     $request->setView('AdminBackupProgress');
     $request->setAction('DBStat');
     $Backup_Start_Link = $request->getURL();
     $request = new Request();
     $request->setView('AdminBackup');
     $request->setAction('BackupCancel');
     $Backup_Cancel_Link = $request->getURL();
     $template_contents = array('BackupStartLink' => $Backup_Start_Link, 'BackupCancelLink' => $Backup_Cancel_Link);
     $this->_Template_Contents = $template_contents;
     $application->registerAttributes($this->_Template_Contents);
     return modApiFunc('TmplFiller', 'fill', $this->container_template_folder_name, "container.tpl.html", array());
 }
Esempio n. 25
0
 /**
  * Detects the current environment
  *
  * @return mixed
  */
 public static function detect()
 {
     $uri = Request::getURL();
     // get configured environments
     $environments = Config::get("_environments");
     if (is_array($environments)) {
         foreach ($environments as $environment => $patterns) {
             foreach ($patterns as $pattern) {
                 if (Pattern::matches($pattern, $uri)) {
                     return $environment;
                 }
             }
         }
     }
     return NULL;
 }
 function getTag($tag)
 {
     $value = null;
     switch ($tag) {
         case 'CustomerAccountName':
             $value = $this->customer_obj->getDisplayAccountName();
             break;
         case 'Local_FormActionURL':
             $r = new Request();
             $r->setView('CustomerNewPassword');
             $r->setAction('save_account_password');
             $r->setKey('key', $this->key);
             $value = $r->getURL();
             break;
     }
     return $value;
 }
 function gen_bmOnClick($bm_location)
 {
     $code = "window.location='";
     $request = new Request();
     $request->setView($bm_location['view']);
     if (isset($bm_location['action'])) {
         $request->setAction($bm_location['action']);
     }
     if (isset($bm_location['keys'])) {
         foreach ($bm_location['keys'] as $key => $value) {
             $request->setKey($key, $value);
         }
     }
     $code .= $request->getURL();
     $code .= "';";
     return $code;
 }
 /**
  *
  */
 function output()
 {
     global $application;
     $request = new Request();
     $request->setView('AdminBackupInfo');
     $request->setAction('UpdateBackupInfo');
     $FormAction = $request->getURL();
     $backup_name = modApiFunc("Tools", "getCurrentBackupFile");
     $backup_dir = $application->getAppIni('PATH_BACKUP_DIR');
     $backup_info = _parse_ini_file($backup_dir . $backup_name . "/info/backup.ini");
     $log_file_content = @file_get_contents($backup_dir . $backup_name . "/info/backup.log");
     //        $txt_file_content = @file_get_contents($backup_dir.$backup_name."/info/backup.txt");
     $template_contents = array('FormAction' => $FormAction, 'BackupName' => $backup_name, 'BackupSQLSize' => modApiFunc("Localization", "num_format", $backup_info['sql_file_size'] / 1024) . " Kb", 'BackupImgSize' => modApiFunc("Localization", "num_format", $backup_info['img_dir_size'] / 1024) . " Kb", 'BackupCreationDate' => modApiFunc("Localization", "timestamp_date_format", $backup_info['backup_start_time']), 'BackupCreationStartTime' => modApiFunc("Localization", "timestamp_time_format", $backup_info['backup_start_time']), 'BackupCreationFinishTime' => modApiFunc("Localization", "timestamp_time_format", $backup_info['backup_end_time']), 'History' => $log_file_content, 'Comments' => "", 'CommentsHash' => "", 'ResultMessage' => $this->outputResultMessage());
     $this->_Template_Contents = $template_contents;
     $application->registerAttributes($this->_Template_Contents);
     return modApiFunc('TmplFiller', 'fill', "tools/backup_info/", "container.tpl.html", array());
 }
 function getTag($tag)
 {
     global $application;
     $value = null;
     switch ($tag) {
         case 'Local_FormActionURL':
             $r = new Request();
             $r->setView(CURRENT_REQUEST_URL);
             $r->setAction('FindUpdatedFileAction');
             $value = $r->getURL();
             break;
         case 'Local_FormSendMailActionURL':
             $r = new Request();
             $r->setView(CURRENT_REQUEST_URL);
             $r->setAction('SendResultMailAction');
             $value = $r->getURL();
             break;
         case 'Local_ErrorMessage':
             $value = modApiFunc('SecureStore', 'CheckErrorMessage');
             break;
         case 'Local_MailResultMessage':
             $value = modApiFunc('SecureStore', 'checkSessionForMailSendResultMessage');
             if (modApiFunc('Session', 'is_set', 'MailSendResultMessage')) {
                 modApiFunc('Session', 'set', 'MailSendResultMessage', "");
             }
             break;
         case 'Local_CheckShellEnabled':
             $chk = modApiFunc('SecureStore', 'CheckShellEnabled');
             if ($chk == 'Y') {
                 $value = "";
             } else {
                 $value = getMsg('SS', 'SHELL_NOT_ENABLED');
             }
             break;
         case 'Local_ModifiedResultOutput':
             $value = modApiFunc('SecureStore', 'checkSessionForModifiedFile');
             break;
         case 'Local_NewlyAddedResultOutput':
             $value = modApiFunc('SecureStore', 'checkSessionForNewlyAddedFile');
             break;
         default:
             break;
     }
     return $value;
 }
 /**
  * Outputs the cart contents view.
  */
 function output()
 {
     $cc = modApiFunc('Cart', 'getCartContent');
     $unit_values = '';
     $unit_id = '';
     if (NULL == $cc) {
         $items = modApiFunc('TmplFiller', 'fill', "cart/cart_thumbnail/", "list_empty.tpl.html", array());
         $retval = modApiFunc('TmplFiller', 'fill', "cart/cart_thumbnail/", "list.tpl.html", array('{ListItems}' => $items, '{ListFooter}' => ''));
     } else {
         $items = "";
         $col = 1;
         $item_color = COLOR1_IN_CART_THUMBNAIL;
         foreach ($cc as $productInfo) {
             $request = new Request();
             $request->setView('Catalog_ProdInfo');
             $request->setAction('SetCurrentProduct');
             $request->setKey('prod_id', $productInfo['{ID}']);
             $productInfo['{Info_Link}'] = $request->getURL();
             $unit_values = $productInfo['attributes']['{Unit_Price}']['attr_unit_type_values'];
             $unit_id = $productInfo['attributes']['{Unit_Price}']['attr_unit_type_value'];
             $productInfo['{Item_Color}'] = $item_color;
             if (USE_TWO_COLORS_IN_CART_THUMBNAIL) {
                 if ($item_color == COLOR1_IN_CART_THUMBNAIL) {
                     $item_color = COLOR2_IN_CART_THUMBNAIL;
                 } else {
                     $item_color = COLOR1_IN_CART_THUMBNAIL;
                 }
             }
             if ($col == 1) {
                 $items .= '<tr><td>';
                 $col++;
             } else {
                 $items .= '<td>';
                 $col++;
             }
             if ($col > COLS_IN_CART_THUMBNAIL) {
                 $col = 1;
             }
             $items .= modApiFunc('TmplFiller', 'fill', "cart/cart_thumbnail/", "list_item.tpl.html", $productInfo);
         }
         $footer = modApiFunc('TmplFiller', 'fill', "cart/cart_thumbnail/", "list_footer.tpl.html", array('{SubTotal}' => modApiFunc('Cart', 'getCartSubtotal') . ' ' . $unit_values[$unit_id]));
         $retval = modApiFunc('TmplFiller', 'fill', "cart/cart_thumbnail/", "list.tpl.html", array('{ListItems}' => $items, '{ListFooter}' => $footer));
     }
     return $retval;
 }