本文整理汇总了PHP中Cx\Core\Html\Sigma::hideBlock方法的典型用法代码示例。如果您正苦于以下问题:PHP Sigma::hideBlock方法的具体用法?PHP Sigma::hideBlock怎么用?PHP Sigma::hideBlock使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Cx\Core\Html\Sigma
的用法示例。
在下文中一共展示了Sigma::hideBlock方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getLocationTable
function getLocationTable($jobID)
{
global $objDatabase, $_ARRAYLANG;
$query = "\n SELECT `value`\n FROM `" . DBPREFIX . "module_jobs_settings`\n WHERE name='show_location_fe'";
$objResult = $objDatabase->Execute($query);
//return if location fields are not activated in the backend
if ($objResult && !$objResult->EOF) {
if (intval($objResult->fields['value']) == 0) {
$this->_objTpl->hideBlock('modify_location');
return;
}
}
$AssociatedLocations = '';
$notAssociatedLocations = '';
$this->_objTpl->setVariable(array('TXT_GENERAL' => $_ARRAYLANG['TXT_JOBS_GENERAL'], 'TXT_LOCATION' => $_ARRAYLANG['TXT_LOCATION'], 'TXT_AVAILABLE_LOCATIONS' => $_ARRAYLANG['TXT_JOBS_AVAILABLE_LOCATIONS'], 'TXT_ASSOCIATED_LOCATIONS' => $_ARRAYLANG['TXT_JOBS_ASSOCIATED_LOCATIONS'], 'TXT_CHECK_ALL' => $_ARRAYLANG['TXT_CHECK_ALL'], 'TXT_UNCHECK_ALL' => $_ARRAYLANG['TXT_REMOVE_SELECTION'], 'FORM_ONSUBMIT' => "onsubmit=\"SelectAllLocations(document.getElementById('associated_locations'))\""));
if (empty($jobID)) {
$query = "SELECT DISTINCT l.name as name,\n l.id as id\n FROM `" . DBPREFIX . "module_jobs_location` l\n WHERE 1;";
} else {
$query = "SELECT DISTINCT l.name as name,\n l.id as id,\n j.job as jobid ,\n j.location as location\n FROM `" . DBPREFIX . "module_jobs_location` l\n LEFT JOIN `" . DBPREFIX . "module_jobs_rel_loc_jobs` as j on j.location=l.id\n AND j.job = {$jobID}";
}
$objResult = $objDatabase->Execute($query);
while ($objResult !== false && !$objResult->EOF) {
if (empty($jobID) or $objResult->fields['jobid'] != $jobID) {
$notAssociatedLocations .= "<option value=\"" . $objResult->fields['id'] . "\">" . htmlentities($objResult->fields['name'], ENT_QUOTES, CONTREXX_CHARSET) . "</option>\n";
} else {
$AssociatedLocations .= "<option value=\"" . $objResult->fields['id'] . "\">" . htmlentities($objResult->fields['name'], ENT_QUOTES, CONTREXX_CHARSET) . "</option>\n";
}
$objResult->MoveNext();
}
$this->_objTpl->setVariable('ASSOCIATED_LOCATIONS', $AssociatedLocations);
$this->_objTpl->setVariable('NOT_ASSOCIATED_LOCATIONS', $notAssociatedLocations);
}
示例2: shadowbox
/**
* Show the shadowbox
*/
function shadowbox()
{
global $objDatabase, $_ARRAYLANG, $objInit;
$id = intval($_GET['id']);
$lang = intval($_GET['lang']);
$entries = $this->createEntryArray();
$entry = $entries[$id];
$settings = $this->createSettingsArray();
$title = $entry['translation'][$lang]['subject'];
$content = $entry['translation'][$lang]['content'];
$picture = !empty($entry['translation'][$lang]['image']) ? $entry['translation'][$lang]['image'] : "none";
$this->_objTpl = new \Cx\Core\Html\Sigma(ASCMS_THEMES_PATH);
\Cx\Core\Csrf\Controller\Csrf::add_placeholder($this->_objTpl);
$this->_objTpl->setCurrentBlock("shadowbox");
$objResult = $objDatabase->SelectLimit("\n SELECT foldername\n FROM " . DBPREFIX . "skins\n WHERE id='{$objInit->currentThemesId}'", 1);
if ($objResult !== false) {
$themesPath = $objResult->fields['foldername'];
}
$template = preg_replace('/\\[\\[([A-Z_]+)\\]\\]/', '{$1}', $settings['data_template_shadowbox']);
$this->_objTpl->setTemplate($template);
if ($entry['translation'][$lang]['attachment']) {
$this->_objTpl->setVariable(array("HREF" => $entry['translation'][$lang]['attachment'], "TXT_DOWNLOAD" => empty($entry['translation'][$lang]['attachment_desc']) ? $_ARRAYLANG['TXT_DATA_DOWNLOAD_ATTACHMENT'] : $entry['translation'][$lang]['attachment_desc']));
$this->_objTpl->parse("attachment");
}
$this->_objTpl->setVariable(array("TITLE" => $title, "CONTENT" => $content, "PICTURE" => $picture, "THEMES_PATH" => $themesPath));
if ($picture != "none") {
$this->_objTpl->parse("image");
} else {
$this->_objTpl->hideBlock("image");
}
$this->_objTpl->parse("shadowbox");
$this->_objTpl->show();
die;
}
示例3: parseNewsletterLists
/**
* Parse a user's newsletter-list subscription interface
* @param User User object of whoem the newsletter-list subscriptions shall be parsed
*/
protected function parseNewsletterLists($objUser)
{
global $_CONFIG, $objDatabase, $objInit;
if (!$this->_objTpl->blockExists('access_newsletter')) {
return;
}
if (\Cx\Core_Modules\License\License::getCached($_CONFIG, $objDatabase)->isInLegalComponents('Newsletter')) {
$arrSubscribedNewsletterListIDs = $objUser->getSubscribedNewsletterListIDs();
$arrNewsletterLists = \Cx\Modules\Newsletter\Controller\NewsletterLib::getLists();
if (!count($arrNewsletterLists)) {
$this->_objTpl->hideBlock('access_newsletter_list');
return;
}
$row = 0;
foreach ($arrNewsletterLists as $listId => $arrList) {
if ($objInit->mode != 'backend' && !$arrList['status'] && !in_array($listId, $arrSubscribedNewsletterListIDs)) {
continue;
}
$this->_objTpl->setVariable(array($this->modulePrefix . 'NEWSLETTER_ID' => $listId, $this->modulePrefix . 'NEWSLETTER_NAME' => contrexx_raw2xhtml($arrList['name']), $this->modulePrefix . 'NEWSLETTER_SELECTED' => in_array($listId, $arrSubscribedNewsletterListIDs) ? 'checked="checked"' : '', $this->modulePrefix . 'NEWSLETTER_ROW_CLASS' => $row++ % 2 + 1));
$this->_objTpl->parse('access_newsletter_list');
}
$this->_objTpl->touchBlock('access_newsletter');
if ($this->_objTpl->blockExists('access_newsletter_tab')) {
$this->_objTpl->touchBlock('access_newsletter_tab');
}
} else {
$this->_objTpl->hideBlock('access_newsletter');
if ($this->_objTpl->blockExists('access_newsletter_tab')) {
$this->_objTpl->hideBlock('access_newsletter_tab');
}
}
}
示例4: renderTheme
/**
* Render the option in the frontend.
*
* @param Sigma $template
*/
public function renderTheme($template)
{
$blockName = strtolower('TEMPLATE_EDITOR_' . $this->name);
if (!$template->blockExists($blockName)) {
return;
}
if ($this->active) {
$template->touchBlock($blockName);
} else {
$template->hideBlock($blockName);
}
}
示例5: foreach
/**
* Show NewsML categories page
* @access private
* @global object $objDatabase
*/
function _newsMLOverview()
{
global $_ARRAYLANG;
$this->_objTpl->loadTemplateFile('module_feed_newsml_overview.html');
$this->pageTitle = 'NewsML';
$rowNr = 0;
$this->_objTpl->setVariable(array('TXT_FEED_MARKED' => $_ARRAYLANG['TXT_FEED_MARKED'], 'TXT_FEED_MARK_ALL' => $_ARRAYLANG['TXT_FEED_MARK_ALL'], 'TXT_FEED_REMOVE_CHOICE' => $_ARRAYLANG['TXT_FEED_REMOVE_CHOICE'], 'TXT_FEED_DELETE_MARKED' => $_ARRAYLANG['TXT_FEED_DELETE_MARKED'], 'TXT_FEED_NEWSML_CATEGORIES' => $_ARRAYLANG['TXT_FEED_NEWSML_CATEGORIES'], 'TXT_FEED_CATEGORY' => $_ARRAYLANG['TXT_FEED_CATEGORY'], 'TXT_FEED_TEMPLATE_PLACEHOLDER' => $_ARRAYLANG['TXT_FEED_TEMPLATE_PLACEHOLDER'], 'TXT_FEED_NEWSML_PROVIDER' => $_ARRAYLANG['TXT_FEED_NEWSML_PROVIDER'], 'TXT_FEED_FUNCTIONS' => $_ARRAYLANG['TXT_FEED_FUNCTIONS'], 'TXT_FEED_SHOW_DETAILS' => $_ARRAYLANG['TXT_FEED_SHOW_DETAILS'], 'TXT_FEED_EDIT_CATEGORY' => $_ARRAYLANG['TXT_FEED_EDIT_CATEGORY'], 'TXT_FEED_INSERT_CATEGORY' => $_ARRAYLANG['TXT_FEED_INSERT_CATEGORY'], 'TXT_FEED_INFO' => $_ARRAYLANG['TXT_FEED_INFO'], 'TXT_FEED_WHAT_IS_NEWSML' => $_ARRAYLANG['TXT_FEED_WHAT_IS_NEWSML'], 'TXT_FEED_NEWSML_DESCRIPTION' => $_ARRAYLANG['TXT_FEED_NEWSML_DESCRIPTION'], 'TXT_FEED_CONFIRM_DELETE_CATEGORY' => $_ARRAYLANG['TXT_FEED_CONFIRM_DELETE_CATEGORY'], 'TXT_FEED_CONFIRM_DELETE_CATEGORIES' => $_ARRAYLANG['TXT_FEED_CONFIRM_DELETE_CATEGORIES'], 'TXT_FEED_ACTION_COULD_NOT_BE_UNDONE' => $_ARRAYLANG['TXT_FEED_ACTION_COULD_NOT_BE_UNDONE']));
$this->_objTpl->setGlobalVariable(array('TXT_FEED_SHOW_DETAILS' => $_ARRAYLANG['TXT_FEED_SHOW_DETAILS'], 'TXT_FEED_EDIT_CATEGORY' => $_ARRAYLANG['TXT_FEED_EDIT_CATEGORY'], 'TXT_FEED_DELETE_CATEGORY' => $_ARRAYLANG['TXT_FEED_DELETE_CATEGORY']));
if (empty($this->_objNewsML->arrCategories)) {
$this->_objTpl->hideBlock('feed_newsml_list');
return;
}
foreach ($this->_objNewsML->arrCategories as $newsMLProviderId => $arrNewsMLProvider) {
$this->_objTpl->setVariable(array('FEED_NEWSML_CATEGORY_ID' => $newsMLProviderId, 'FEED_NEWSML_ID' => $newsMLProviderId, 'FEED_NEWSML_LIST_ROW_CLASS' => ++$rowNr % 2 ? 'row1' : 'row2', 'FEED_NEWSML_NAME' => $arrNewsMLProvider['name'], 'FEED_NEWSML_PLACEHOLDER' => 'NEWSML_' . strtoupper(preg_replace('/\\s/', '_', $arrNewsMLProvider['name'])), 'FEED_NEWSML_PROVIDER' => $arrNewsMLProvider['providerName']));
$this->_objTpl->parse('feed_newsml_list');
}
}
示例6: chooseReservationProduct
function chooseReservationProduct()
{
global $objDatabase, $_ARRAYLANG;
$this->objTemplate->loadTemplateFile('module_gov_choose_product.html');
$this->_pageTitle = $_ARRAYLANG['TXT_EGOV_PRODUCT_FOR_RESERVATION'];
$this->objTemplate->setVariable(array('TXT_PRODUCT' => $_ARRAYLANG['TXT_PRODUCT'], 'TXT_EGOV_CHOOSE_PRODUCT_FOR_RESERVATION' => $_ARRAYLANG['TXT_EGOV_CHOOSE_PRODUCT_FOR_RESERVATION']));
$query = "\n SELECT *\n FROM " . DBPREFIX . "module_egov_products\n ORDER BY product_orderby, product_name\n ";
$objResult = $objDatabase->Execute($query);
$i = 0;
while (!$objResult->EOF) {
$StatusImg = '<img src="../core/Core/View/Media/icons/status_green.gif" width="10" height="10" border="0" alt="" />';
if ($objResult->fields["product_status"] != 1) {
$StatusImg = '<img src="../core/Core/View/Media/icons/status_red.gif" width="10" height="10" border="0" alt="" />';
}
$this->objTemplate->setVariable(array('ROWCLASS' => ++$i % 2 ? 'row2' : 'row1', 'PRODUCT_ID' => $objResult->fields['product_id'], 'PRODUCT_NAME' => $objResult->fields['product_name'], 'PRODUCT_STATUS' => $StatusImg));
$this->objTemplate->parse('products_list');
$objResult->MoveNext();
}
if ($i == 0) {
$this->objTemplate->hideBlock('products_list');
}
}
示例7: parseCurrentNavItem
/**
* Parse the current navigation item
*
* @global array $_ARRAYLANG
*
* @param \Cx\Core\Html\Sigma $navigation
* @param string $blockName
* @param string $currentCmd
* @param string $mainCmd
* @param boolean $isActiveNav
* @param boolean $isSubNav
*/
protected function parseCurrentNavItem(\Cx\Core\Html\Sigma $navigation, $blockName, $currentCmd, $mainCmd, $isActiveNav, $isSubNav)
{
global $_ARRAYLANG;
if (empty($blockName)) {
return;
}
$isActiveNav ? $navigation->touchBlock($blockName . '_active') : $navigation->hideBlock($blockName . '_active');
if (empty($isSubNav)) {
$act = empty($currentCmd) ? '' : '&act=' . $currentCmd;
$txt = empty($currentCmd) ? 'DEFAULT' : $currentCmd;
} else {
$act = '&act=' . $mainCmd . '/' . $currentCmd;
$txt = (empty($mainCmd) ? 'DEFAULT' : $mainCmd) . '_';
$txt .= empty($currentCmd) ? 'DEFAULT' : strtoupper($currentCmd);
}
$actTxtKey = 'TXT_' . strtoupper($this->getType()) . '_' . strtoupper($this->getName() . '_ACT_' . $txt);
$actTitle = isset($_ARRAYLANG[$actTxtKey]) ? $_ARRAYLANG[$actTxtKey] : $actTxtKey;
$navigation->setVariable(array('HREF' => 'index.php?cmd=' . $this->getName() . $act, 'TITLE' => $actTitle));
$navigation->parse($blockName . '_entry');
}
示例8: parseRelatedDownloads
private function parseRelatedDownloads($objDownload, $currentCategoryId)
{
global $_LANGID, $_ARRAYLANG;
if (!$this->objTemplate->blockExists('downloads_related_file_list')) {
return;
}
$sortOrder = $this->downloadsSortingOptions[$this->arrConfig['downloads_sorting_order']];
$objRelatedDownload = $objDownload->getDownloads(array('download_id' => $objDownload->getId()), null, $sortOrder);
if ($objRelatedDownload) {
$row = 1;
while (!$objRelatedDownload->EOF) {
$description = $objRelatedDownload->getDescription($_LANGID);
if (strlen($description) > 100) {
$shortDescription = substr($description, 0, 97) . '...';
} else {
$shortDescription = $description;
}
$imageSrc = $objRelatedDownload->getImage();
if (!empty($imageSrc) && file_exists(\Cx\Core\Core\Controller\Cx::instanciate()->getWebsiteDocumentRootPath() . $imageSrc)) {
$thumb_name = \ImageManager::getThumbnailFilename($imageSrc);
if (file_exists(\Cx\Core\Core\Controller\Cx::instanciate()->getWebsiteDocumentRootPath() . $thumb_name)) {
$thumbnailSrc = $thumb_name;
} else {
$thumbnailSrc = \ImageManager::getThumbnailFilename($this->defaultCategoryImage['src']);
}
$image = $this->getHtmlImageTag($imageSrc, htmlentities($objRelatedDownload->getName($_LANGID), ENT_QUOTES, CONTREXX_CHARSET));
$thumbnail = $this->getHtmlImageTag($thumbnailSrc, htmlentities($objRelatedDownload->getName($_LANGID), ENT_QUOTES, CONTREXX_CHARSET));
} else {
$imageSrc = $this->defaultCategoryImage['src'];
$thumbnailSrc = \ImageManager::getThumbnailFilename($this->defaultCategoryImage['src']);
$image = '';
$thumbnail = '';
}
$arrAssociatedCategories = $objRelatedDownload->getAssociatedCategoryIds();
if (in_array($currentCategoryId, $arrAssociatedCategories)) {
$categoryId = $currentCategoryId;
} else {
$arrPublicCategories = array();
$arrProtectedCategories = array();
foreach ($arrAssociatedCategories as $categoryId) {
$objCategory = Category::getCategory($categoryId);
if (!$objCategory->EOF) {
if ($objCategory->getVisibility() || \Permission::checkAccess($objCategory->getReadAccessId(), 'dynamic', true) || $objCategory->getOwnerId() == $this->userId) {
$arrPublicCategories[] = $categoryId;
break;
} else {
$arrProtectedCategories[] = $categoryId;
}
}
}
if (count($arrPublicCategories)) {
$categoryId = $arrPublicCategories[0];
} elseif (count($arrProtectedCategories)) {
$categoryId = $arrProtectedCategories[0];
} else {
$objRelatedDownload->next();
continue;
}
}
$this->objTemplate->setVariable(array('DOWNLOADS_RELATED_FILE_ID' => $objRelatedDownload->getId(), 'DOWNLOADS_RELATED_FILE_DETAIL_SRC' => CONTREXX_SCRIPT_PATH . $this->moduleParamsHtml . '&category=' . $categoryId . '&id=' . $objRelatedDownload->getId(), 'DOWNLOADS_RELATED_FILE_NAME' => htmlentities($objRelatedDownload->getName($_LANGID), ENT_QUOTES, CONTREXX_CHARSET), 'DOWNLOADS_RELATED_FILE_DESCRIPTION' => nl2br(htmlentities($description, ENT_QUOTES, CONTREXX_CHARSET)), 'DOWNLOADS_RELATED_FILE_SHORT_DESCRIPTION' => htmlentities($shortDescription, ENT_QUOTES, CONTREXX_CHARSET), 'DOWNLOADS_RELATED_FILE_IMAGE' => $image, 'DOWNLOADS_RELATED_FILE_IMAGE_SRC' => $imageSrc, 'DOWNLOADS_RELATED_FILE_THUMBNAIL' => $thumbnail, 'DOWNLOADS_RELATED_FILE_THUMBNAIL_SRC' => $thumbnailSrc, 'DOWNLOADS_RELATED_FILE_ICON' => $this->getHtmlImageTag($objRelatedDownload->getIcon(), htmlentities($objRelatedDownload->getName($_LANGID), ENT_QUOTES, CONTREXX_CHARSET)), 'DOWNLOADS_RELATED_FILE_ROW_CLASS' => 'row' . ($row++ % 2 + 1)));
$this->objTemplate->parse('downloads_related_file');
$objRelatedDownload->next();
}
$this->objTemplate->setVariable('TXT_DOWNLOADS_RELATED_DOWNLOADS', $_ARRAYLANG['TXT_DOWNLOADS_RELATED_DOWNLOADS']);
$this->objTemplate->parse('downloads_related_file_list');
} else {
$this->objTemplate->hideBlock('downloads_related_file_list');
}
}
示例9: process
/**
* Processes the Order
*
* Verifies all data, updates and stores it in the database, and
* initializes payment
* @return boolean True on successs, false otherwise
*/
static function process()
{
global $objDatabase, $_ARRAYLANG;
// FOR TESTING ONLY (repeatedly process/store the order, also disable self::destroyCart())
//$_SESSION['shop']['order_id'] = NULL;
// Verify that the order hasn't yet been saved
// (and has thus not yet been confirmed)
if (isset($_SESSION['shop']['order_id'])) {
return \Message::error($_ARRAYLANG['TXT_ORDER_ALREADY_PLACED']);
}
// No more confirmation
self::$objTemplate->hideBlock('shopConfirm');
// Store the customer, register the order
$customer_ip = $_SERVER['REMOTE_ADDR'];
$customer_host = substr(@gethostbyaddr($_SERVER['REMOTE_ADDR']), 0, 100);
$customer_browser = substr(getenv('HTTP_USER_AGENT'), 0, 100);
$new_customer = false;
//\DBG::log("Shop::process(): E-Mail: ".$_SESSION['shop']['email']);
if (self::$objCustomer) {
//\DBG::log("Shop::process(): Existing User username ".$_SESSION['shop']['username'].", email ".$_SESSION['shop']['email']);
} else {
// Registered Customers are required to be logged in!
self::$objCustomer = Customer::getRegisteredByEmail($_SESSION['shop']['email']);
if (self::$objCustomer) {
\Message::error($_ARRAYLANG['TXT_SHOP_CUSTOMER_REGISTERED_EMAIL']);
\Cx\Core\Csrf\Controller\Csrf::redirect(\Cx\Core\Routing\Url::fromModuleAndCmd('Shop', 'login') . '?redirect=' . base64_encode(\Cx\Core\Routing\Url::fromModuleAndCmd('Shop', 'confirm')));
}
// Unregistered Customers are stored as well, as their information is needed
// nevertheless. Their active status, however, is set to false.
self::$objCustomer = Customer::getUnregisteredByEmail($_SESSION['shop']['email']);
if (!self::$objCustomer) {
self::$objCustomer = new Customer();
// Currently, the e-mail address is set as the user name
$_SESSION['shop']['username'] = $_SESSION['shop']['email'];
//\DBG::log("Shop::process(): New User username ".$_SESSION['shop']['username'].", email ".$_SESSION['shop']['email']);
self::$objCustomer->username($_SESSION['shop']['username']);
self::$objCustomer->email($_SESSION['shop']['email']);
// Note that the password is unset when the Customer chooses
// to order without registration. The generated one
// defaults to length 8, fulfilling the requirements for
// complex passwords. And it's kept absolutely secret.
$password = empty($_SESSION['shop']['password']) ? \User::make_password() : $_SESSION['shop']['password'];
//\DBG::log("Password: $password (session: {$_SESSION['shop']['password']})");
if (!self::$objCustomer->password($password)) {
\Message::error($_ARRAYLANG['TXT_INVALID_PASSWORD']);
\Cx\Core\Csrf\Controller\Csrf::redirect(\Cx\Core\Routing\Url::fromModuleAndCmd('Shop', 'account'));
}
self::$objCustomer->active(empty($_SESSION['shop']['dont_register']));
$new_customer = true;
}
}
// Update the Customer object from the session array
// (whether new or not -- it may have been edited)
self::$objCustomer->gender($_SESSION['shop']['gender']);
self::$objCustomer->firstname($_SESSION['shop']['firstname']);
self::$objCustomer->lastname($_SESSION['shop']['lastname']);
self::$objCustomer->company($_SESSION['shop']['company']);
self::$objCustomer->address($_SESSION['shop']['address']);
self::$objCustomer->city($_SESSION['shop']['city']);
self::$objCustomer->zip($_SESSION['shop']['zip']);
self::$objCustomer->country_id($_SESSION['shop']['countryId']);
self::$objCustomer->phone($_SESSION['shop']['phone']);
self::$objCustomer->fax($_SESSION['shop']['fax']);
$arrGroups = self::$objCustomer->getAssociatedGroupIds();
$usergroup_id = \Cx\Core\Setting\Controller\Setting::getValue('usergroup_id_reseller', 'Shop');
if (empty($usergroup_id)) {
//\DBG::log("Shop::process(): ERROR: Missing reseller group");
\Message::error($_ARRAYLANG['TXT_SHOP_ERROR_USERGROUP_INVALID']);
\Cx\Core\Csrf\Controller\Csrf::redirect(\Cx\Core\Routing\Url::fromModuleAndCmd('Shop', ''));
}
if (!in_array($usergroup_id, $arrGroups)) {
//\DBG::log("Shop::process(): Customer is not in Reseller group (ID $usergroup_id)");
// Not a reseller. See if she's a final customer
$usergroup_id = \Cx\Core\Setting\Controller\Setting::getValue('usergroup_id_customer', 'Shop');
if (empty($usergroup_id)) {
//\DBG::log("Shop::process(): ERROR: Missing final customer group");
\Message::error($_ARRAYLANG['TXT_SHOP_ERROR_USERGROUP_INVALID']);
\Cx\Core\Csrf\Controller\Csrf::redirect(\Cx\Core\Routing\Url::fromModuleAndCmd('Shop', ''));
}
if (!in_array($usergroup_id, $arrGroups)) {
//\DBG::log("Shop::process(): Customer is not in final customer group (ID $usergroup_id), either");
// Neither one, add to the final customer group (default)
$arrGroups[] = $usergroup_id;
self::$objCustomer->setGroups($arrGroups);
//\DBG::log("Shop::process(): Added Customer to final customer group (ID $usergroup_id): ".var_export(self::$objCustomer->getAssociatedGroupIds(), true));
} else {
//\DBG::log("Shop::process(): Customer is a final customer (ID $usergroup_id) already: ".var_export(self::$objCustomer->getAssociatedGroupIds(), true));
}
} else {
//\DBG::log("Shop::process(): Customer is a Reseller (ID $usergroup_id) already: ".var_export(self::$objCustomer->getAssociatedGroupIds(), true));
}
// Insert or update the customer
//\DBG::log("Shop::process(): Storing Customer: ".var_export(self::$objCustomer, true));
//.........这里部分代码省略.........
示例10: parseRegistrationPlaceholders
/**
* Parse the registration related palceholders
* $hostUri and $hostTarget should be set before calling this method
*
* @param \Cx\Core\Html\Sigma $objTpl Template instance
* @param \Cx\Modules\Calendar\Controller\CalendarEvent $event Event instance
* @param string $hostUri Host uri of the event(internal/external)
* @param string $hostTarget Host uri target type (_blank/null)
*
* @return null
*/
public function parseRegistrationPlaceholders(\Cx\Core\Html\Sigma $objTpl, CalendarEvent $event, $hostUri = '', $hostTarget = '')
{
global $_ARRAYLANG;
$numRegistrations = contrexx_input2int($event->getRegistrationCount());
$numDeregistration = contrexx_input2int($event->getCancellationCount());
$objEscortManager = new \Cx\Modules\Calendar\Controller\CalendarRegistrationManager($event, true, false);
$objTpl->setVariable(array($this->moduleLangVar . '_EVENT_COUNT_REG' => $numRegistrations, $this->moduleLangVar . '_EVENT_COUNT_SIGNOFF' => $numDeregistration, $this->moduleLangVar . '_EVENT_COUNT_SUBSCRIBER' => $objEscortManager->getEscortData(), $this->moduleLangVar . '_REGISTRATIONS_SUBSCRIBER' => $event->numSubscriber));
// Only link to registration form if event registration is set up and event lies in the future
if (!$event->registration || time() > $event->startDate->getTimestamp()) {
$objTpl->hideBlock('calendarEventRegistration');
return;
}
// Only show registration form if event accepts registrations.
// Event accepts registrations, if
// - no attendee limit is set
// - or if there are still free places available
$registrationOpen = true;
$regLinkTarget = '_self';
if ($event->registration == CalendarEvent::EVENT_REGISTRATION_EXTERNAL && !$event->registrationExternalFullyBooked || $event->registration == CalendarEvent::EVENT_REGISTRATION_INTERNAL && (empty($event->numSubscriber) || !\FWValidator::isEmpty($event->getFreePlaces()))) {
if ($event->registration == CalendarEvent::EVENT_REGISTRATION_EXTERNAL) {
$regLinkSrc = \FWValidator::getUrl($event->registrationExternalLink);
$regLinkTarget = '_blank';
} elseif ($hostUri) {
$regLinkSrc = $hostUri . '/' . CONTREXX_DIRECTORY_INDEX . '?section=' . $this->moduleName . '&cmd=register&id=' . $event->id . '&date=' . $event->startDate->getTimestamp();
} else {
$params = array('id' => $event->id, 'date' => $event->startDate->getTimestamp());
$regLinkSrc = \Cx\Core\Routing\Url::fromModuleAndCmd($this->moduleName, 'register', FRONTEND_LANG_ID, $params)->toString();
}
$regLink = '<a href="' . $regLinkSrc . '" ' . $hostTarget . '>' . $_ARRAYLANG['TXT_CALENDAR_REGISTRATION'] . '</a>';
} else {
$regLink = '<i>' . $_ARRAYLANG['TXT_CALENDAR_EVENT_FULLY_BLOCKED'] . '</i>';
$regLinkSrc = '';
$registrationOpen = false;
}
$objTpl->setVariable(array($this->moduleLangVar . '_EVENT_REGISTRATION_LINK' => $regLink, $this->moduleLangVar . '_EVENT_REGISTRATION_LINK_SRC' => $regLinkSrc, $this->moduleLangVar . '_EVENT_REGISTRATION_LINK_TARGET' => $regLinkTarget));
if ($objTpl->blockExists('calendarEventRegistrationOpen')) {
if ($registrationOpen) {
$objTpl->touchBlock('calendarEventRegistrationOpen');
} else {
$objTpl->hideBlock('calendarEventRegistrationOpen');
}
}
if ($objTpl->blockExists('calendarEventRegistrationClosed')) {
if (!$registrationOpen) {
$objTpl->touchBlock('calendarEventRegistrationClosed');
} else {
$objTpl->hideBlock('calendarEventRegistrationClosed');
}
}
$objTpl->parse('calendarEventRegistration');
}
示例11: view
/**
* The Cart view
*
* Mind that the Cart needs to be {@see update()}d before calling this
* method.
* @global array $_ARRAYLANG Language array
* @param \Cx\Core\Html\Sigma $objTemplate The optional Template
*/
static function view($objTemplate = null)
{
global $_ARRAYLANG;
if (!$objTemplate) {
// TODO: Handle missing or empty Template, load one
die("Cart::view(): ERROR: No template");
// return false;
}
$objTemplate->setGlobalVariable($_ARRAYLANG);
$i = 0;
if (count(self::$products)) {
foreach (self::$products as $arrProduct) {
$groupCountId = $arrProduct['group_id'];
$groupArticleId = $arrProduct['article_id'];
$groupCustomerId = 0;
if (Shop::customer()) {
$groupCustomerId = Shop::customer()->group_id();
}
Shop::showDiscountInfo($groupCustomerId, $groupArticleId, $groupCountId, $arrProduct['quantity']);
// product image
$arrProductImg = Products::get_image_array_from_base64($arrProduct['product_images']);
$shopImagesWebPath = \Cx\Core\Core\Controller\Cx::instanciate()->getWebsiteImagesWebPath() . '/Shop/';
$thumbnailPath = $shopImagesWebPath . ShopLibrary::noPictureName;
foreach ($arrProductImg as $productImg) {
if (!empty($productImg['img']) && $productImg['img'] != ShopLibrary::noPictureName) {
$thumbnailPath = $shopImagesWebPath . \ImageManager::getThumbnailFilename($productImg['img']);
break;
}
}
/* UNUSED (and possibly obsolete, too)
if (isset($arrProduct['discount_string'])) {
//DBG::log("Shop::view_cart(): Product ID ".$arrProduct['id'].": ".$arrProduct['discount_string']);
$objTemplate->setVariable(
'SHOP_DISCOUNT_COUPON_STRING',
$arrProduct['coupon_string']
);
}*/
// The fields that don't apply have been set to ''
// (empty string) already -- see update().
$objTemplate->setVariable(array('SHOP_PRODUCT_ROW' => 'row' . (++$i % 2 + 1), 'SHOP_PRODUCT_ID' => $arrProduct['id'], 'SHOP_PRODUCT_CODE' => $arrProduct['product_id'], 'SHOP_PRODUCT_THUMBNAIL' => $thumbnailPath, 'SHOP_PRODUCT_CART_ID' => $arrProduct['cart_id'], 'SHOP_PRODUCT_TITLE' => str_replace('"', '"', contrexx_raw2xhtml($arrProduct['title'])), 'SHOP_PRODUCT_PRICE' => $arrProduct['price'], 'SHOP_PRODUCT_PRICE_UNIT' => Currency::getActiveCurrencySymbol(), 'SHOP_PRODUCT_QUANTITY' => $arrProduct['quantity'], 'SHOP_PRODUCT_ITEMPRICE' => $arrProduct['itemprice'], 'SHOP_PRODUCT_ITEMPRICE_UNIT' => Currency::getActiveCurrencySymbol(), 'SHOP_REMOVE_PRODUCT' => $_ARRAYLANG['TXT_SHOP_REMOVE_ITEM']));
//DBG::log("Attributes String: {$arrProduct['options_long']}");
if ($arrProduct['options_long']) {
$objTemplate->setVariable('SHOP_PRODUCT_OPTIONS', $arrProduct['options_long']);
}
if (\Cx\Core\Setting\Controller\Setting::getValue('weight_enable', 'Shop')) {
$objTemplate->setVariable(array('SHOP_PRODUCT_WEIGHT' => Weight::getWeightString($arrProduct['weight']), 'TXT_WEIGHT' => $_ARRAYLANG['TXT_TOTAL_WEIGHT']));
}
if (Vat::isEnabled()) {
$objTemplate->setVariable(array('SHOP_PRODUCT_TAX_RATE' => $arrProduct['vat_rate'] ? Vat::format($arrProduct['vat_rate']) : '', 'SHOP_PRODUCT_TAX_AMOUNT' => $arrProduct['vat_amount'] . ' ' . Currency::getActiveCurrencySymbol()));
}
if (intval($arrProduct['minimum_order_quantity']) > 0) {
$objTemplate->setVariable(array('SHOP_PRODUCT_MINIMUM_ORDER_QUANTITY' => $arrProduct['minimum_order_quantity']));
} else {
if ($objTemplate->blockExists('orderQuantity')) {
$objTemplate->hideBlock('orderQuantity');
}
if ($objTemplate->blockExists('minimumOrderQuantity')) {
$objTemplate->hideBlock('minimumOrderQuantity');
}
}
$objTemplate->parse('shopCartRow');
}
} else {
$objTemplate->hideBlock('shopCart');
if ($objTemplate->blockExists('shopCartEmpty')) {
$objTemplate->touchBlock('shopCartEmpty');
$objTemplate->parse('shopCartEmpty');
}
if ($_SESSION['shop']['previous_product_ids']) {
$ids = $_SESSION['shop']['previous_product_ids']->toArray();
Shop::view_product_overview($ids);
}
}
$objTemplate->setGlobalVariable(array('TXT_PRODUCT_ID' => $_ARRAYLANG['TXT_ID'], 'SHOP_PRODUCT_TOTALITEM' => self::get_item_count(), 'SHOP_PRODUCT_TOTALPRICE' => Currency::formatPrice(self::get_price()), 'SHOP_PRODUCT_TOTALPRICE_PLUS_VAT' => Currency::formatPrice(self::get_price() + (Vat::isEnabled() && !Vat::isIncluded() ? self::get_vat_amount() : 0)), 'SHOP_PRODUCT_TOTALPRICE_UNIT' => Currency::getActiveCurrencySymbol(), 'SHOP_TOTAL_WEIGHT' => Weight::getWeightString(self::get_weight()), 'SHOP_PRICE_UNIT' => Currency::getActiveCurrencySymbol()));
// Show the Coupon code field only if there is at least one defined
if (Coupon::count_available()) {
//DBG::log("Coupons available");
$objTemplate->setVariable(array('SHOP_DISCOUNT_COUPON_CODE' => isset($_SESSION['shop']['coupon_code']) ? $_SESSION['shop']['coupon_code'] : ''));
if ($objTemplate->blockExists('shopCoupon')) {
$objTemplate->parse('shopCoupon');
}
if (self::get_discount_amount()) {
$total_discount_amount = self::get_discount_amount();
//DBG::log("Shop::view_cart(): Total: Amount $total_discount_amount");
$objTemplate->setVariable(array('SHOP_DISCOUNT_COUPON_TOTAL' => $_ARRAYLANG['TXT_SHOP_DISCOUNT_COUPON_AMOUNT_TOTAL'], 'SHOP_DISCOUNT_COUPON_TOTAL_AMOUNT' => Currency::formatPrice(-$total_discount_amount)));
}
}
if (Vat::isEnabled()) {
$objTemplate->setVariable(array('TXT_TAX_PREFIX' => Vat::isIncluded() ? $_ARRAYLANG['TXT_SHOP_VAT_PREFIX_INCL'] : $_ARRAYLANG['TXT_SHOP_VAT_PREFIX_EXCL'], 'SHOP_TOTAL_TAX_AMOUNT' => self::get_vat_amount() . ' ' . Currency::getActiveCurrencySymbol()));
if (Vat::isIncluded()) {
$objTemplate->setVariable(array('SHOP_GRAND_TOTAL_EXCL_TAX' => Currency::formatPrice(self::get_price() - self::get_vat_amount()) . ' ' . Currency::getActiveCurrencySymbol()));
}
//.........这里部分代码省略.........
示例12: finalize
/**
* Parses the main template in order to finish request
* @todo Remove usage of globals
* @global type $themesPages
* @global null $moduleStyleFile
* @global array $_CONFIG
* @global type $subMenuTitle
* @global type $_CORELANG
* @global type $plainCmd
* @global type $cmd
*/
protected function finalize()
{
global $themesPages, $moduleStyleFile, $_CONFIG, $subMenuTitle, $_CORELANG, $plainCmd, $cmd;
if ($this->mode == self::MODE_FRONTEND) {
// parse system
$parsingTime = $this->stopTimer();
$this->template->setVariable('PARSING_TIME', $parsingTime);
$this->parseGlobalPlaceholders($themesPages['sidebar']);
$this->template->setVariable(array('SIDEBAR_FILE' => $themesPages['sidebar'], 'JAVASCRIPT_FILE' => $themesPages['javascript'], 'BUILDIN_STYLE_FILE' => $themesPages['buildin_style'], 'DATE_YEAR' => date('Y'), 'DATE_MONTH' => date('m'), 'DATE_DAY' => date('d'), 'DATE_TIME' => date('H:i'), 'BUILDIN_STYLE_FILE' => $themesPages['buildin_style'], 'JAVASCRIPT_LIGHTBOX' => '<script type="text/javascript" src="lib/lightbox/javascript/mootools.js"></script>
<script type="text/javascript" src="lib/lightbox/javascript/slimbox.js"></script>', 'JAVASCRIPT_MOBILE_DETECTOR' => '<script type="text/javascript" src="lib/mobiledetector.js"></script>'));
if (!empty($moduleStyleFile)) {
$this->template->setVariable('STYLE_FILE', "<link rel=\"stylesheet\" href=\"{$moduleStyleFile}\" type=\"text/css\" media=\"screen, projection\" />");
}
if (!$this->resolvedPage->getUseSkinForAllChannels() && isset($_GET['pdfview']) && intval($_GET['pdfview']) == 1) {
$pageTitle = $this->resolvedPage->getTitle();
$extenstion = empty($pageTitle) ? null : '.pdf';
$objPDF = new \Cx\Core_Modules\Pdf\Model\Entity\PdfDocument();
$objPDF->SetTitle($pageTitle . $extenstion);
$objPDF->setContent($this->template->get());
$objPDF->Create();
exit;
}
// fetch the parsed webpage
$this->template->setVariable('JAVASCRIPT', 'javascript_inserting_here');
$endcode = $this->template->get();
/**
* Get all javascripts in the code, replace them with nothing, and register the js file
* to the javascript lib. This is because we don't want something twice, and there could be
* a theme that requires a javascript, which then could be used by a module too and therefore would
* be loaded twice.
*/
/* Finds all uncommented script tags, strips them out of the HTML and
* stores them internally so we can put them in the placeholder later
* (see JS::getCode() below)
*/
\JS::findJavascripts($endcode);
/*
* Proposal: Use this
* $endcode = preg_replace_callback('/<script\s.*?src=(["\'])(.*?)(\1).*?\/?>(?:<\/script>)?/i', array('JS', 'registerFromRegex'), $endcode);
* and change JS::registerFromRegex to use index 2
*/
// i know this is ugly, but is there another way
$endcode = str_replace('javascript_inserting_here', \JS::getCode(), $endcode);
// do a final replacement of all those node-urls ({NODE_<ID>_<LANG>}- placeholders) that haven't been captured earlier
$endcode = preg_replace('/\\[\\[([A-Z0-9_-]+)\\]\\]/', '{\\1}', $endcode);
\LinkGenerator::parseTemplate($endcode);
// remove the meta tag X-UA-Compatible if the user agent ist neighter internet explorer nor chromeframe
if (!preg_match('/(msie|chromeframe)/i', $_SERVER['HTTP_USER_AGENT'])) {
$endcode = preg_replace('/<meta.*?X-UA-Compatible.*?>/i', '', $endcode);
}
// replace links from before contrexx 3
$ls = new \LinkSanitizer($this, $this->getCodeBaseOffsetPath() . \Env::get('virtualLanguageDirectory') . '/', $endcode);
$this->endcode = $ls->replace();
} else {
// backend meta navigation
if ($this->template->blockExists('backend_metanavigation')) {
// parse language navigation
if ($this->template->blockExists('backend_language_navigation') && $this->template->blockExists('backend_language_navigation_item')) {
$backendLanguage = \FWLanguage::getActiveBackendLanguages();
if (count($backendLanguage) > 1) {
$this->template->setVariable('TXT_LANGUAGE', $_CORELANG['TXT_LANGUAGE']);
foreach ($backendLanguage as $language) {
$languageUrl = \Env::get('init')->getUriBy('setLang', $language['id']);
$this->template->setVariable(array('LANGUAGE_URL' => contrexx_raw2xhtml($languageUrl), 'LANGUAGE_NAME' => $language['name'], 'LANGUAGE_CSS' => \Env::get('init')->getBackendLangId() == $language['id'] ? 'active' : ''));
$this->template->parse('backend_language_navigation_item');
}
$this->template->parse('backend_language_navigation');
} else {
$this->template->hideBlock('backend_language_navigation');
}
}
$this->template->touchBlock('backend_metanavigation');
}
// page parsing
$parsingTime = $this->stopTimer();
// var_dump($parsingTime);
/*echo ($finishTime[0] - $startTime[0]) . '<br />';
if (!isset($_SESSION['asdf1']) || isset($_GET['reset'])) {
$_SESSION['asdf1'] = 0;
$_SESSION['asdf2'] = 0;
}
echo $_SESSION['asdf1'] . '<br />';
if ($_SESSION['asdf1'] > 0) {
echo $_SESSION['asdf2'] / $_SESSION['asdf1'];
}
$_SESSION['asdf1']++;
$_SESSION['asdf2'] += ($finishTime[0] - $startTime[0]);//*/
$objAdminNav = new \adminMenu($plainCmd);
$objAdminNav->getAdminNavbar();
//.........这里部分代码省略.........
示例13: parseCategoryDownloads
private function parseCategoryDownloads($objCategory, $downloadOrderBy, $downloadOrderDirection, $downloadLimitOffset, $categoryOrderBy, $categoryOrderDirection, $categoryLimitOffset, $searchTerm)
{
global $_ARRAYLANG, $_LANGID, $_CONFIG;
$nr = 0;
$arrDownloadOrder = $objCategory->getAssociatedDownloadIds();
$objFWUser = \FWUser::getFWUserObject();
$sortOrder = $this->downloadsSortingOptions[$this->arrConfig['downloads_sorting_order']];
$arrSort = empty($downloadOrderBy) ? $sortOrder : array_merge(array($downloadOrderBy => $downloadOrderDirection), $sortOrder);
$objDownload = new Download();
$objDownload->loadDownloads(array('category_id' => $objCategory->getId()), $searchTerm, $arrSort, null, $_CONFIG['corePagingLimit'], $downloadLimitOffset, true);
$downloadsAvailable = $objDownload->EOF ? false : true;
while (!$objDownload->EOF) {
// if (!\Permission::checkAccess(143, 'static', true) && !$objDownload->getVisibility() && $objDownload->getOwnerId() != $objFWUser->objUser->getId()) {
// $objDownload->next();
// continue;
// }
// parse select checkbox & order box
if ((\Permission::checkAccess(143, 'static', true) || !$objCategory->getManageFilesAccessId() || \Permission::checkAccess($objCategory->getManageFilesAccessId(), 'dynamic', true) || $objCategory->getOwnerId() == $objFWUser->objUser->getId()) && $objCategory->getId()) {
// select checkbox
$this->objTemplate->setVariable('DOWNLOADS_DOWNLOAD_ID', $objDownload->getId());
$this->objTemplate->parse('downloads_download_checkbox');
// order box
$this->objTemplate->setVariable(array('DOWNLOADS_DOWNLOAD_ID' => $objDownload->getId(), 'DOWNLOADS_DOWNLOAD_ORDER' => $arrDownloadOrder[$objDownload->getId()]));
$this->objTemplate->parse('downloads_download_orderbox');
$this->objTemplate->hideBlock('downloads_download_no_orderbox');
$this->objTemplate->parse('downloads_download_no_save_button');
} else {
// select checkbox
$this->objTemplate->hideBlock('downloads_download_checkbox');
$this->objTemplate->hideBlock('downloads_download_action_dropdown');
// order box
$this->objTemplate->setVariable('DOWNLOADS_DOWNLOAD_ORDER', $objCategory->getId() ? $arrDownloadOrder[$objDownload->getId()] : $objDownload->getOrder());
$this->objTemplate->parse('downloads_download_no_orderbox');
$this->objTemplate->hideBlock('downloads_download_orderbox');
$this->objTemplate->hideBlock('downloads_download_no_save_button');
}
// parse status link and modify button
if (\Permission::checkAccess(143, 'static', true) || $objCategory->getId() && (!$objCategory->getManageFilesAccessId() || \Permission::checkAccess($objCategory->getManageFilesAccessId(), 'dynamic', true) || $objCategory->getModifyAccessByOwner() && $objCategory->getOwnerId() == $objFWUser->objUser->getId()) || $objDownload->getOwnerId() == $objFWUser->objUser->getId()) {
$this->objTemplate->setVariable(array('DOWNLOADS_DOWNLOAD_CATEGORY_SORT' => $categoryOrderDirection, 'DOWNLOADS_DOWNLOAD_CATEGORY_SORT_BY' => $categoryOrderBy, 'DOWNLOADS_DOWNLOAD_DOWNLOAD_SORT' => $downloadOrderDirection, 'DOWNLOADS_DOWNLOAD_DOWNLOAD_BY' => $downloadOrderBy, 'DOWNLOADS_DOWNLOAD_CATEGORY_OFFSET' => $categoryLimitOffset, 'DOWNLOADS_DOWNLOAD_DOWNLOAD_OFFSET' => $downloadLimitOffset, 'DOWNLOADS_DOWNLOAD_ID' => $objDownload->getId(), 'DOWNLOADS_DOWNLOAD_CATEGORY_PARENT_ID' => $objCategory->getId(), 'DOWNLOADS_DOWNLOAD_SWITCH_STATUS_DESC' => $objDownload->getActiveStatus() ? $_ARRAYLANG['TXT_DOWNLOADS_DEACTIVATE_DOWNLOAD_DESC'] : $_ARRAYLANG['TXT_DOWNLOADS_ACTIVATE_DOWNLOAD_DESC'], 'DOWNLOADS_DOWNLOAD_SWITCH_STATUS_IMG_DESC' => $objDownload->getActiveStatus() ? $_ARRAYLANG['TXT_DOWNLOADS_DEACTIVATE_DOWNLOAD_DESC'] : $_ARRAYLANG['TXT_DOWNLOADS_ACTIVATE_DOWNLOAD_DESC']));
$this->objTemplate->parse('downloads_download_status_link_open');
$this->objTemplate->touchBlock('downloads_download_status_link_close');
// parse modify icon
$this->objTemplate->setVariable(array('DOWNLOADS_DOWNLOAD_CATEGORY_SORT' => $categoryOrderDirection, 'DOWNLOADS_DOWNLOAD_CATEGORY_SORT_BY' => $categoryOrderBy, 'DOWNLOADS_DOWNLOAD_DOWNLOAD_SORT' => $downloadOrderDirection, 'DOWNLOADS_DOWNLOAD_DOWNLOAD_BY' => $downloadOrderBy, 'DOWNLOADS_DOWNLOAD_CATEGORY_OFFSET' => $categoryLimitOffset, 'DOWNLOADS_DOWNLOAD_DOWNLOAD_OFFSET' => $downloadLimitOffset, 'DOWNLOADS_DOWNLOAD_ID' => $objDownload->getId(), 'DOWNLOADS_DOWNLOAD_CATEGORY_PARENT_ID' => $objCategory->getId()));
$this->objTemplate->parse('downloads_download_function_modify_link');
$this->objTemplate->hideBlock('downloads_download_function_no_modify_link');
// parse modify link on name attribute
$this->objTemplate->setVariable(array('DOWNLOADS_DOWNLOAD_CATEGORY_SORT' => $categoryOrderDirection, 'DOWNLOADS_DOWNLOAD_CATEGORY_SORT_BY' => $categoryOrderBy, 'DOWNLOADS_DOWNLOAD_DOWNLOAD_SORT' => $downloadOrderDirection, 'DOWNLOADS_DOWNLOAD_DOWNLOAD_BY' => $downloadOrderBy, 'DOWNLOADS_DOWNLOAD_CATEGORY_OFFSET' => $categoryLimitOffset, 'DOWNLOADS_DOWNLOAD_DOWNLOAD_OFFSET' => $downloadLimitOffset, 'DOWNLOADS_DOWNLOAD_ID' => $objDownload->getId(), 'DOWNLOADS_DOWNLOAD_CATEGORY_PARENT_ID' => $objCategory->getId()));
$this->objTemplate->parse('downloads_download_modify_link_open');
$this->objTemplate->touchBlock('downloads_download_modify_link_close');
} else {
$this->objTemplate->setVariable(array('DOWNLOADS_DOWNLOAD_SWITCH_STATUS_DESC' => $objDownload->getActiveStatus() ? $_ARRAYLANG['TXT_DOWNLOADS_ACTIVE'] : $_ARRAYLANG['TXT_DOWNLOADS_INACTIVE'], 'DOWNLOADS_DOWNLOAD_SWITCH_STATUS_IMG_DESC' => $objDownload->getActiveStatus() ? $_ARRAYLANG['TXT_DOWNLOADS_ACTIVE'] : $_ARRAYLANG['TXT_DOWNLOADS_INACTIVE']));
$this->objTemplate->hideBlock('downloads_download_status_link_open');
$this->objTemplate->hideBlock('downloads_download_status_link_close');
// hide modify icon
$this->objTemplate->touchBlock('downloads_download_function_no_modify_link');
$this->objTemplate->hideBlock('downloads_download_function_modify_link');
// hide modify linke on name attribute
$this->objTemplate->hideBlock('downloads_download_modify_link_open');
$this->objTemplate->hideBlock('downloads_download_modify_link_close');
}
// parse download link
if (!$objDownload->getAccessId() || $objDownload->getOwnerId() == $objFWUser->objUser->getId() || \Permission::checkAccess($objDownload->getAccessId(), 'dynamic', true) || \Permission::checkAccess(143, 'static', true) || $objCategory->getId() && (!$objCategory->getManageFilesAccessId() || \Permission::checkAccess($objCategory->getManageFilesAccessId(), 'dynamic', true) || $objCategory->getModifyAccessByOwner() && $objCategory->getOwnerId() == $objFWUser->objUser->getId())) {
$this->objTemplate->setVariable(array('DOWNLOADS_DOWNLOAD_ID' => $objDownload->getId(), 'DOWNLOADS_DOWNLOAD_DOWNLOAD_ICON' => $objDownload->getIcon(true), 'DOWNLOADS_DOWNLOAD_SOURCE' => htmlentities($objDownload->getSource(), ENT_QUOTES, CONTREXX_CHARSET)));
$this->objTemplate->parse('downloads_download_function_download_link');
$this->objTemplate->hideBlock('downloads_download_function_no_download_link');
} else {
$this->objTemplate->hideBlock('downloads_download_function_download_link');
$this->objTemplate->touchBlock('downloads_download_function_no_download_link');
}
// parse unlink button
if (\Permission::checkAccess(143, 'static', true) || $objCategory->getId() && (!$objCategory->getManageFilesAccessId() || \Permission::checkAccess($objCategory->getManageFilesAccessId(), 'dynamic', true) || $objCategory->getOwnerId() == $objFWUser->objUser->getId()) || $objDownload->getOwnerId() == $objFWUser->objUser->getId()) {
$this->objTemplate->setVariable(array('TXT_DOWNLOADS_UNLINK' => $_ARRAYLANG['TXT_DOWNLOADS_UNLINK'], 'DOWNLOADS_DOWNLOAD_NAME_JS' => htmlspecialchars($objDownload->getName(), ENT_QUOTES, CONTREXX_CHARSET)));
// parse delete icon
$this->objTemplate->parse('downloads_download_function_unlink_link');
$this->objTemplate->hideBlock('downloads_download_function_no_unlink_link');
} else {
// hide delete icon
$this->objTemplate->touchBlock('downloads_download_function_no_unlink_link');
$this->objTemplate->hideBlock('downloads_download_function_unlink_link');
}
$description = $objDownload->getDescription();
if (strlen($description) > 100) {
$description = substr($description, 0, 97) . '...';
}
$this->objTemplate->setVariable(array('DOWNLOADS_DOWNLOAD_ID' => $objDownload->getId(), 'DOWNLOADS_DOWNLOAD_NAME' => htmlentities($objDownload->getName(), ENT_QUOTES, CONTREXX_CHARSET), 'DOWNLOADS_DOWNLOAD_DESCRIPTION' => htmlentities($description, ENT_QUOTES, CONTREXX_CHARSET), 'DOWNLOADS_DOWNLOAD_OWNER' => $this->getParsedUsername($objDownload->getOwnerId()), 'DOWNLOADS_DOWNLOAD_DOWNLOADED' => $objDownload->getDownloadCount(), 'DOWNLOADS_DOWNLOAD_VIEWED' => $objDownload->getViewCount(), 'DOWNLOADS_DOWNLOAD_STATUS_LED' => $objDownload->getActiveStatus() ? 'led_green.gif' : 'led_red.gif', 'DOWNLOADS_DOWNLOAD_ROW_CLASS' => $nr++ % 2 ? 'row1' : 'row2'));
$this->objTemplate->parse('downloads_download_list');
$objDownload->next();
}
if ($downloadsAvailable && !empty($this->parentCategoryId)) {
$this->objTemplate->setVariable('TXT_DOWNLOADS_OF_CATEGORY', sprintf($_ARRAYLANG['TXT_DOWNLOADS_DOWNLOADS_OF_CATEGORY'], '„' . htmlentities($objCategory->getName($_LANGID), ENT_QUOTES, CONTREXX_CHARSET) . '“'));
} else {
$this->objTemplate->setVariable('TXT_DOWNLOADS_ALL_DOWNLOADS', $_ARRAYLANG['TXT_DOWNLOADS_ALL_DOWNLOADS']);
}
if ($downloadsAvailable) {
$this->objTemplate->setVariable(array('DOWNLOADS_CONFIRM_UNLINK_DOWNLOADS_TXT' => preg_replace('#\\n#', '\\n', addslashes($_ARRAYLANG['TXT_DOWNLOADS_CONFIRM_UNLINK_DOWNLOADS'])), 'TXT_SAVE_CHANGES_DOWNLOADS' => $_ARRAYLANG['TXT_SAVE_CHANGES'], 'TXT_DOWNLOADS_CHECK_ALL' => $_ARRAYLANG['TXT_DOWNLOADS_CHECK_ALL'], 'TXT_DOWNLOADS_UNCHECK_ALL' => $_ARRAYLANG['TXT_DOWNLOADS_UNCHECK_ALL'], 'TXT_DOWNLOADS_SELECT_ACTION' => $_ARRAYLANG['TXT_DOWNLOADS_SELECT_ACTION'], 'TXT_DOWNLOADS_ORDER' => $_ARRAYLANG['TXT_DOWNLOADS_ORDER'], 'TXT_DOWNLOADS_UNLINK_MULTI' => $_ARRAYLANG['TXT_DOWNLOADS_UNLINK_MULTI']));
$this->objTemplate->setVariable(array('TXT_DOWNLOADS_OWNER' => $_ARRAYLANG['TXT_DOWNLOADS_OWNER'], 'TXT_DOWNLOADS_FUNCTIONS' => $_ARRAYLANG['TXT_DOWNLOADS_FUNCTIONS'], 'DOWNLOADS_DOWNLOAD_CATEGORY_ID' => $objCategory->getId(), 'DOWNLOADS_DOWNLOAD_SORT_DIRECTION' => $downloadOrderDirection, 'DOWNLOADS_DOWNLOAD_SORT_BY' => $downloadOrderBy, 'DOWNLOADS_DOWNLOAD_SORT_ID' => $downloadOrderBy == 'id' && $downloadOrderDirection == 'asc' ? 'desc' : 'asc', 'DOWNLOADS_DOWNLOAD_SORT_STATUS' => $downloadOrderBy == 'is_active' && $downloadOrderDirection == 'asc' ? 'desc' : 'asc', 'DOWNLOADS_DOWNLOAD_SORT_ORDER' => $downloadOrderBy == 'order' && $downloadOrderDirection == 'asc' ? 'desc' : 'asc', 'DOWNLOADS_DOWNLOAD_SORT_NAME' => $downloadOrderBy == 'name' && $downloadOrderDirection == 'asc' ? 'desc' : 'asc', 'DOWNLOADS_DOWNLOAD_SORT_DESCRIPTION' => $downloadOrderBy == 'description' && $downloadOrderDirection == 'asc' ? 'desc' : 'asc', 'DOWNLOADS_DOWNLOAD_SORT_DOWNLOADED' => $downloadOrderBy == 'download_count' && $downloadOrderDirection == 'desc' ? 'asc' : 'desc', 'DOWNLOADS_DOWNLOAD_SORT_VIEWED' => $downloadOrderBy == 'views' && $downloadOrderDirection == 'desc' ? 'asc' : 'desc', 'DOWNLOADS_DOWNLOAD_SORT_ID_LABEL' => $_ARRAYLANG['TXT_DOWNLOADS_ID'] . ($downloadOrderBy == 'id' ? $downloadOrderDirection == 'asc' ? ' ↑' : ' ↓' : ''), 'DOWNLOADS_DOWNLOAD_SORT_STATUS_LABEL' => $_ARRAYLANG['TXT_DOWNLOADS_STATUS'] . ($downloadOrderBy == 'is_active' ? $downloadOrderDirection == 'asc' ? ' ↑' : ' ↓' : ''), 'DOWNLOADS_DOWNLOAD_SORT_ORDER_LABEL' => $_ARRAYLANG['TXT_DOWNLOADS_ORDER'] . ($downloadOrderBy == 'order' ? $downloadOrderDirection == 'asc' ? ' ↑' : ' ↓' : ''), 'DOWNLOADS_DOWNLOAD_SORT_NAME_LABEL' => $_ARRAYLANG['TXT_DOWNLOADS_NAME'] . ($downloadOrderBy == 'name' ? $downloadOrderDirection == 'asc' ? ' ↑' : ' ↓' : ''), 'DOWNLOADS_DOWNLOAD_SORT_DESCRIPTION_LABEL' => $_ARRAYLANG['TXT_DOWNLOADS_DESCRIPTION'] . ($downloadOrderBy == 'description' ? $downloadOrderDirection == 'asc' ? ' ↑' : ' ↓' : ''), 'DOWNLOADS_DOWNLOAD_SORT_DOWNLOADED_LABEL' => $_ARRAYLANG['TXT_DOWNLOADS_DOWNLOADED'] . ($downloadOrderBy == 'download_count' ? $downloadOrderDirection == 'asc' ? ' ↑' : ' ↓' : ''), 'DOWNLOADS_DOWNLOAD_SORT_VIEWED_LABEL' => $_ARRAYLANG['TXT_DOWNLOADS_VIEWED'] . ($downloadOrderBy == 'views' ? $downloadOrderDirection == 'asc' ? ' ↑' : ' ↓' : ''), 'DOWNLOADS_DOWNLOAD_CATEGORY_SORT' => $categoryOrderDirection, 'DOWNLOADS_DOWNLOAD_CATEGORY_BY' => $categoryOrderBy, 'DOWNLOADS_DOWNLOAD_CATEGORY_OFFSET' => $categoryLimitOffset));
// parse paging
$downloadCount = $objDownload->getFilteredSearchDownloadCount();
if ($downloadCount > $_CONFIG['corePagingLimit']) {
$pagingLink = "&cmd=Downloads&act=categories&parent_id=" . $objCategory->getId() . "&category_sort=" . htmlspecialchars($categoryOrderDirection) . "&category_by=" . htmlspecialchars($categoryOrderBy) . "&download_sort=" . htmlspecialchars($downloadOrderDirection) . "&download_by=" . htmlspecialchars($downloadOrderBy) . "&category_pos=" . $categoryLimitOffset;
//.........这里部分代码省略.........
示例14: intval
//.........这里部分代码省略.........
foreach ($keys1 as $key) {
$keys[$key] = $_ARRAYLANG[$key];
}
array_walk($keys, array(&$this, 'arrStrToLower'));
$searchterm = contrexx_addslashes($_REQUEST['search']);
if (!empty($searchterm) && strlen($searchterm) <= 3) {
$this->_objTpl->setVariable("TXT_IMMO_SEARCHTERM_TOO_SHORT", $_ARRAYLANG['TXT_IMMO_SEARCHTERM_TOO_SHORT']);
return false;
}
$query = " SELECT immo.id AS `immo_id`, immo.reference AS `reference`, immo.object_type AS otype, immo.new_building AS `new`, immo.property_type AS ptype, logo,\n a.fieldvalue as headline,\n CAST(b.fieldvalue AS UNSIGNED) as price,\n c.fieldvalue as header,\n d.fieldvalue as location,\n e.fieldvalue as rooms,\n f.fieldvalue as foreigner_authorization,\n g.fieldvalue as address,\n img.uri AS imgsrc\n FROM " . DBPREFIX . "module_immo AS immo";
if (!empty($searchterm)) {
$query .= " LEFT JOIN " . DBPREFIX . "module_immo_content AS content on ( content.immo_id = immo.id ) ";
}
$query .= " LEFT JOIN " . DBPREFIX . "module_immo_content AS a ON ( immo.id = a.immo_id\n AND a.field_id = (\n SELECT field_id\n FROM " . DBPREFIX . "module_immo_fieldname\n WHERE name = 'headline'\n AND lang_id = 1 )\n AND a.lang_id = " . $this->frontLang . " )\n LEFT JOIN " . DBPREFIX . "module_immo_content AS b ON ( immo.id = b.immo_id\n AND b.field_id = (\n SELECT field_id\n FROM " . DBPREFIX . "module_immo_fieldname\n WHERE name = 'preis'\n AND lang_id = 1 )\n AND b.lang_id = " . $this->frontLang . " )\n LEFT JOIN " . DBPREFIX . "module_immo_content AS c ON ( immo.id = c.immo_id\n AND c.field_id = (\n SELECT field_id\n FROM " . DBPREFIX . "module_immo_fieldname\n WHERE name = 'kopfzeile'\n AND lang_id = 1 )\n AND c.lang_id = " . $this->frontLang . " )\n LEFT JOIN " . DBPREFIX . "module_immo_content AS d ON ( immo.id = d.immo_id\n AND d.field_id = (\n SELECT field_id\n FROM " . DBPREFIX . "module_immo_fieldname\n WHERE name = 'ort'\n AND lang_id = 1 )\n AND d.lang_id = " . $this->frontLang . " )\n LEFT JOIN " . DBPREFIX . "module_immo_content AS e ON ( immo.id = e.immo_id\n AND e.field_id = (\n SELECT field_id\n FROM " . DBPREFIX . "module_immo_fieldname\n WHERE name = 'anzahl zimmer'\n AND lang_id = 1 )\n AND e.lang_id = " . $this->frontLang . " )\n LEFT JOIN " . DBPREFIX . "module_immo_content AS f ON ( immo.id = f.immo_id\n AND f.field_id = (\n SELECT field_id\n FROM " . DBPREFIX . "module_immo_fieldname\n WHERE name = 'ausl�nder-bewilligung'\n AND lang_id = 1 )\n AND f.lang_id = " . $this->frontLang . " )\n LEFT JOIN " . DBPREFIX . "module_immo_content AS g ON ( immo.id = g.immo_id\n AND g.field_id = (\n SELECT field_id\n FROM " . DBPREFIX . "module_immo_fieldname\n WHERE name = 'adresse'\n AND lang_id = 1 )\n AND g.lang_id = " . $this->frontLang . " )\n LEFT JOIN " . DBPREFIX . "module_immo_image AS img ON ( immo.id = img.immo_id\n AND img.field_id = (\n SELECT field_id\n FROM " . DBPREFIX . "module_immo_fieldname\n WHERE name = 'übersichtsbild' )\n )\n WHERE TRUE\n ";
if (!empty($searchterm)) {
$query .= " AND content.fieldvalue LIKE '%" . $searchterm . "%' ";
}
$query .= " AND immo.visibility != 'disabled' ";
if (!intval($_REQUEST['refnr'])) {
$query .= " AND immo.visibility != 'reference' ";
}
if (!empty($locations) || !empty($obj_type) || !empty($property_type)) {
if (!empty($locations)) {
$query .= " AND d.fieldvalue = '" . $locations . "'";
}
if (!empty($property_type)) {
$query .= " AND immo.property_type = '" . $property_type . "'";
}
if (!empty($obj_type)) {
$query .= " AND immo.object_type = '" . $obj_type . "'";
}
if (!empty($new_building)) {
$query .= " AND immo.new_building = '" . $new_building . "'";
}
if (!empty($foreigner_auth)) {
//max rooms
$query .= " AND f.fieldvalue = '" . $foreigner_auth . "' ";
}
if (!empty($fprice)) {
//min price
$query .= " AND b.fieldvalue >= " . $fprice . " ";
}
if (!empty($tprice)) {
//max price
$query .= " AND b.fieldvalue <= " . $tprice . " ";
}
if (!empty($frooms)) {
//min rooms
$query .= " AND e.fieldvalue >= '" . $frooms . "' ";
}
if (!empty($trooms)) {
//max rooms
$query .= " AND e.fieldvalue <= '" . $trooms . "' ";
}
if (!empty($logo)) {
//max rooms
$query .= " AND logo = '" . $logo . "' ";
}
$query .= ' GROUP BY immo.id ORDER BY ' . $orderBy . ' ASC';
}
} elseif (!empty($_REQUEST['ref_nr'])) {
//advanced search
$orderBy = !empty($_REQUEST['order_by']) ? contrexx_addslashes($_REQUEST['order_by']) : 'immo.id';
$refnr = intval($_REQUEST['ref_nr']);
$query .= ' AND reference = ' . $refnr . " GROUP BY immo.id ORDER BY {$orderBy} ASC";
}
//else { //no where clause => show all }
$objRS = $objDatabase->Execute($query);
if (!$objRS) {
echo "DB error. file: " . __FILE__ . " line: " . __LINE__;
return false;
}
if ($objRS->RecordCount() == 0) {
if ($this->_objTpl->blockExists("no_results")) {
$this->_objTpl->touchBlock("no_results");
$this->_objTpl->parse("no_results");
}
return false;
}
while (!$objRS->EOF) {
$imgdim = '';
$img = $objRS->fields['imgsrc'];
$imgdim = $this->_getImageDim($img, 80);
$this->_objTpl->setVariable(array('IMMO_HEADER' => $objRS->fields['header'], 'IMMO_LOCATION' => $objRS->fields['location'], 'IMMO_PRICE' => $objRS->fields['price'], 'IMMO_REF_NR' => $objRS->fields['reference'], 'IMMO_HEADLINE' => $objRS->fields['headline'], 'IMMO_IMG_PREVIEW_DIM' => $imgdim[0], 'IMMO_IMG_PREVIEW_SRC' => $img, 'IMMO_ID' => $objRS->fields['immo_id']));
if (!empty($objRS->fields['imgsrc'])) {
$this->_objTpl->parse("previewImage");
} else {
$this->_objTpl->hideBlock("previewImage");
}
$this->_objTpl->setVariable('IMMO_HEADER', $objRS->fields['header']);
$this->_objTpl->parse("objectRow");
$objRS->MoveNext();
}
// TODO: Never used
// $limit = $_CONFIG['corePagingLimit'];
$count = '';
$pos = intval($_GET['pos']);
$this->_objTpl->setVariable('IMMO_PAGING', getPaging($count, $pos, '&search=' . $_REQUEST['search'], '', true));
return true;
}
示例15: intval
/**
* Set up the detail view of the selected order
* @access public
* @param \Cx\Core\Html\Sigma $objTemplate The Template, by reference
* @param boolean $edit Edit if true, view otherwise
* @global ADONewConnection $objDatabase Database connection object
* @global array $_ARRAYLANG Language array
* @return boolean True on success,
* false otherwise
* @static
* @author Reto Kohli <reto.kohli@comvation.com> (parts)
* @version 3.1.0
*/
static function view_detail(&$objTemplate = null, $edit = false)
{
global $objDatabase, $_ARRAYLANG, $objInit;
$backend = $objInit->mode == 'backend';
if ($objTemplate->blockExists('order_list')) {
$objTemplate->hideBlock('order_list');
}
$have_option = false;
// The order total -- in the currency chosen by the customer
$order_sum = 0;
// recalculated VAT total
$total_vat_amount = 0;
$order_id = intval($_REQUEST['order_id']);
if (!$order_id) {
return \Message::error($_ARRAYLANG['TXT_SHOP_ORDER_ERROR_INVALID_ORDER_ID']);
}
if (!$objTemplate) {
$template_name = $edit ? 'module_shop_order_edit.html' : 'module_shop_order_details.html';
$objTemplate = new \Cx\Core\Html\Sigma(\Cx\Core\Core\Controller\Cx::instanciate()->getCodeBaseModulePath() . '/Shop/View/Template/Backend');
//DBG::log("Orders::view_list(): new Template: ".$objTemplate->get());
$objTemplate->loadTemplateFile($template_name);
//DBG::log("Orders::view_list(): loaded Template: ".$objTemplate->get());
}
$objOrder = Order::getById($order_id);
if (!$objOrder) {
//DBG::log("Shop::shopShowOrderdetails(): Failed to find Order ID $order_id");
return \Message::error(sprintf($_ARRAYLANG['TXT_SHOP_ORDER_NOT_FOUND'], $order_id));
}
// lsv data
$query = "\n SELECT `holder`, `bank`, `blz`\n FROM " . DBPREFIX . "module_shop" . MODULE_INDEX . "_lsv\n WHERE order_id={$order_id}";
$objResult = $objDatabase->Execute($query);
if (!$objResult) {
return self::errorHandler();
}
if ($objResult->RecordCount() == 1) {
$objTemplate->setVariable(array('SHOP_ACCOUNT_HOLDER' => contrexx_raw2xhtml($objResult->fields['holder']), 'SHOP_ACCOUNT_BANK' => contrexx_raw2xhtml($objResult->fields['bank']), 'SHOP_ACCOUNT_BLZ' => contrexx_raw2xhtml($objResult->fields['blz'])));
}
$customer_id = $objOrder->customer_id();
if (!$customer_id) {
//DBG::log("Shop::shopShowOrderdetails(): Invalid Customer ID $customer_id");
\Message::error(sprintf($_ARRAYLANG['TXT_SHOP_INVALID_CUSTOMER_ID'], $customer_id));
}
$objCustomer = Customer::getById($customer_id);
if (!$objCustomer) {
//DBG::log("Shop::shopShowOrderdetails(): Failed to find Customer ID $customer_id");
\Message::error(sprintf($_ARRAYLANG['TXT_SHOP_CUSTOMER_NOT_FOUND'], $customer_id));
$objCustomer = new Customer();
// No editing allowed!
$have_option = true;
}
Vat::is_reseller($objCustomer->is_reseller());
Vat::is_home_country(\Cx\Core\Setting\Controller\Setting::getValue('country_id', 'Shop') == $objOrder->country_id());
$objTemplate->setGlobalVariable($_ARRAYLANG + array('SHOP_CURRENCY' => Currency::getCurrencySymbolById($objOrder->currency_id())));
//DBG::log("Order sum: ".Currency::formatPrice($objOrder->sum()));
$objTemplate->setVariable(array('SHOP_CUSTOMER_ID' => $customer_id, 'SHOP_ORDERID' => $order_id, 'SHOP_DATE' => date(ASCMS_DATE_FORMAT_INTERNATIONAL_DATETIME, strtotime($objOrder->date_time())), 'SHOP_ORDER_STATUS' => $edit ? Orders::getStatusMenu($objOrder->status(), false, null, 'swapSendToStatus(this.value)') : $_ARRAYLANG['TXT_SHOP_ORDER_STATUS_' . $objOrder->status()], 'SHOP_SEND_MAIL_STYLE' => $objOrder->status() == Order::STATUS_CONFIRMED ? 'display: inline;' : 'display: none;', 'SHOP_SEND_MAIL_STATUS' => $edit ? $objOrder->status() != Order::STATUS_CONFIRMED ? \Html::ATTRIBUTE_CHECKED : '' : '', 'SHOP_ORDER_SUM' => Currency::formatPrice($objOrder->sum()), 'SHOP_DEFAULT_CURRENCY' => Currency::getDefaultCurrencySymbol(), 'SHOP_GENDER' => $edit ? Customer::getGenderMenu($objOrder->billing_gender(), 'billing_gender') : $_ARRAYLANG['TXT_SHOP_' . strtoupper($objOrder->billing_gender())], 'SHOP_COMPANY' => $objOrder->billing_company(), 'SHOP_FIRSTNAME' => $objOrder->billing_firstname(), 'SHOP_LASTNAME' => $objOrder->billing_lastname(), 'SHOP_ADDRESS' => $objOrder->billing_address(), 'SHOP_ZIP' => $objOrder->billing_zip(), 'SHOP_CITY' => $objOrder->billing_city(), 'SHOP_COUNTRY' => $edit ? \Cx\Core\Country\Controller\Country::getMenu('billing_country_id', $objOrder->billing_country_id()) : \Cx\Core\Country\Controller\Country::getNameById($objOrder->billing_country_id()), 'SHOP_PHONE' => $objOrder->billing_phone(), 'SHOP_FAX' => $objOrder->billing_fax(), 'SHOP_EMAIL' => $objOrder->billing_email(), 'SHOP_SHIP_GENDER' => $edit ? Customer::getGenderMenu($objOrder->gender(), 'shipPrefix') : $_ARRAYLANG['TXT_SHOP_' . strtoupper($objOrder->gender())], 'SHOP_SHIP_COMPANY' => $objOrder->company(), 'SHOP_SHIP_FIRSTNAME' => $objOrder->firstname(), 'SHOP_SHIP_LASTNAME' => $objOrder->lastname(), 'SHOP_SHIP_ADDRESS' => $objOrder->address(), 'SHOP_SHIP_ZIP' => $objOrder->zip(), 'SHOP_SHIP_CITY' => $objOrder->city(), 'SHOP_SHIP_COUNTRY' => $edit ? \Cx\Core\Country\Controller\Country::getMenu('shipCountry', $objOrder->country_id()) : \Cx\Core\Country\Controller\Country::getNameById($objOrder->country_id()), 'SHOP_SHIP_PHONE' => $objOrder->phone(), 'SHOP_PAYMENTTYPE' => Payment::getProperty($objOrder->payment_id(), 'name'), 'SHOP_CUSTOMER_NOTE' => $objOrder->note(), 'SHOP_COMPANY_NOTE' => $objCustomer->companynote(), 'SHOP_SHIPPING_TYPE' => $objOrder->shipment_id() ? Shipment::getShipperName($objOrder->shipment_id()) : ' '));
if ($backend) {
$objTemplate->setVariable(array('SHOP_CUSTOMER_IP' => $objOrder->ip() ? '<a href="index.php?cmd=NetTools&tpl=whois&address=' . $objOrder->ip() . '" title="' . $_ARRAYLANG['TXT_SHOW_DETAILS'] . '">' . $objOrder->ip() . '</a>' : ' ', 'SHOP_CUSTOMER_HOST' => $objOrder->host() ? '<a href="index.php?cmd=NetTools&tpl=whois&address=' . $objOrder->host() . '" title="' . $_ARRAYLANG['TXT_SHOW_DETAILS'] . '">' . $objOrder->host() . '</a>' : ' ', 'SHOP_CUSTOMER_LANG' => \FWLanguage::getLanguageParameter($objOrder->lang_id(), 'name'), 'SHOP_CUSTOMER_BROWSER' => $objOrder->browser() ? $objOrder->browser() : ' ', 'SHOP_LAST_MODIFIED' => $objOrder->modified_on() && $objOrder->modified_on() != '0000-00-00 00:00:00' ? $objOrder->modified_on() . ' ' . $_ARRAYLANG['TXT_EDITED_BY'] . ' ' . $objOrder->modified_by() : $_ARRAYLANG['TXT_ORDER_WASNT_YET_EDITED']));
} else {
// Frontend: Order history ONLY. Repeat the Order, go to cart
$objTemplate->setVariable(array('SHOP_ACTION_URI_ENCODED' => \Cx\Core\Routing\Url::fromModuleAndCmd('Shop', 'cart')));
}
$ppName = '';
$psp_id = Payment::getPaymentProcessorId($objOrder->payment_id());
if ($psp_id) {
$ppName = PaymentProcessing::getPaymentProcessorName($psp_id);
}
$objTemplate->setVariable(array('SHOP_SHIPPING_PRICE' => $objOrder->shipment_amount(), 'SHOP_PAYMENT_PRICE' => $objOrder->payment_amount(), 'SHOP_PAYMENT_HANDLER' => $ppName, 'SHOP_LAST_MODIFIED_DATE' => $objOrder->modified_on()));
if ($edit) {
// edit order
$strJsArrShipment = Shipment::getJSArrays();
$objTemplate->setVariable(array('SHOP_SEND_TEMPLATE_TO_CUSTOMER' => sprintf($_ARRAYLANG['TXT_SEND_TEMPLATE_TO_CUSTOMER'], $_ARRAYLANG['TXT_ORDER_COMPLETE']), 'SHOP_SHIPPING_TYP_MENU' => Shipment::getShipperMenu($objOrder->country_id(), $objOrder->shipment_id(), "calcPrice(0);"), 'SHOP_JS_ARR_SHIPMENT' => $strJsArrShipment, 'SHOP_PRODUCT_IDS_MENU_NEW' => Products::getMenuoptions(null, null, $_ARRAYLANG['TXT_SHOP_PRODUCT_MENU_FORMAT']), 'SHOP_JS_ARR_PRODUCT' => Products::getJavascriptArray($objCustomer->group_id(), $objCustomer->is_reseller())));
}
$options = $objOrder->getOptionArray();
if (!empty($options[$order_id])) {
$have_option = true;
}
// Order items
$total_weight = $i = 0;
$total_net_price = $objOrder->view_items($objTemplate, $edit, $total_weight, $i);
// Show VAT with the individual products:
// If VAT is enabled, and we're both in the same country
// ($total_vat_amount has been set above if both conditions are met)
// show the VAT rate.
// If there is no VAT, the amount is 0 (zero).
//if ($total_vat_amount) {
// distinguish between included VAT, and additional VAT added to sum
$tax_part_percentaged = Vat::isIncluded() ? $_ARRAYLANG['TXT_TAX_PREFIX_INCL'] : $_ARRAYLANG['TXT_TAX_PREFIX_EXCL'];
//.........这里部分代码省略.........