/** * 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; }
/** * Add or edit the jobs Locations * @global object $objDatabase * @global array $_ARRAYLANG * @param string $pageContent */ function manageLocations() { global $objDatabase, $_ARRAYLANG; $this->pageTitle = $_ARRAYLANG['TXT_LOCATION_MANAGER']; $this->_objTpl->loadTemplateFile('module_jobs_location.html', true, true); $this->_objTpl->setVariable(array('TXT_ADD_NEW_LOCATION' => $_ARRAYLANG['TXT_ADD_NEW_LOCATION'], 'TXT_NAME' => $_ARRAYLANG['TXT_NAME'], 'TXT_ADD' => $_ARRAYLANG['TXT_ADD'], 'TXT_SELECT_ALL' => $_ARRAYLANG['TXT_SELECT_ALL'], 'TXT_REMOVE_SELECTION' => $_ARRAYLANG['TXT_REMOVE_SELECTION'], 'TXT_LOCATION_LIST' => $_ARRAYLANG['TXT_LOCATION_LIST'], 'TXT_ID' => $_ARRAYLANG['TXT_ID'], 'TXT_ACTION' => $_ARRAYLANG['TXT_ACTION'], 'TXT_ACCEPT_CHANGES' => $_ARRAYLANG['TXT_ACCEPT_CHANGES'], 'TXT_CONFIRM_DELETE_DATA' => $_ARRAYLANG['TXT_CONFIRM_DELETE_DATA'], 'TXT_ACTION_IS_IRREVERSIBLE' => $_ARRAYLANG['TXT_ACTION_IS_IRREVERSIBLE'], 'TXT_ATTENTION_SYSTEM_FUNCTIONALITY_AT_RISK' => $_ARRAYLANG['TXT_ATTENTION_SYSTEM_FUNCTIONALITY_AT_RISK'], 'TXT_JOBS_SORTING' => $_ARRAYLANG['TXT_JOBS_SORTING'], 'TXT_JOBS_SORTTYPE' => $_ARRAYLANG['TXT_JOBS_SORTTYPE'])); $this->_objTpl->setGlobalVariable(array('TXT_DELETE' => $_ARRAYLANG['TXT_DELETE'])); // Add a new category if (isset($_POST['addLoc']) and $_POST['addLoc'] == true) { $locName = get_magic_quotes_gpc() ? strip_tags($_POST['newLocName']) : addslashes(strip_tags($_POST['newLocName'])); if ($objDatabase->Execute("INSERT INTO " . DBPREFIX . "module_jobs_location (name)\n VALUES ('{$locName}')")) { $this->strOkMessage = $_ARRAYLANG['TXT_DATA_RECORD_ADDED_SUCCESSFUL']; } else { $this->strErrMessage = $_ARRAYLANG['TXT_DATABASE_QUERY_ERROR']; } } // Modify a new category if (isset($_POST['modLoc']) and $_POST['modLoc'] == true) { foreach ($_POST['locName'] as $id => $name) { $name = get_magic_quotes_gpc() ? strip_tags($name) : addslashes(strip_tags($name)); $id = intval($id); // Unused // $sorting = !empty($_REQUEST['sortStyle'][$id]) ? contrexx_addslashes($_REQUEST['sortStyle'][$id]) : 'alpha'; if ($objDatabase->Execute("UPDATE " . DBPREFIX . "module_jobs_location\n SET name='{$name}'\n WHERE id={$id}")) { $this->strOkMessage = $_ARRAYLANG['TXT_DATA_RECORD_UPDATED_SUCCESSFUL']; } else { $this->strErrMessage = $_ARRAYLANG['TXT_DATABASE_QUERY_ERROR']; } } } $query = "SELECT `id`,\n `name`\n FROM `" . DBPREFIX . "module_jobs_location`\n ORDER BY `id` asc"; $objResult = $objDatabase->Execute($query); $this->_objTpl->setCurrentBlock('row'); $i = 0; while ($objResult !== false && !$objResult->EOF) { $class = $i % 2 == 0 ? "row1" : "row2"; // Unused // $sorting = $objResult->fields['sort_style']; $this->_objTpl->setVariable(array('JOBS_ROWCLASS' => $class, 'JOBS_LOC_ID' => $objResult->fields['id'], 'JOBS_LOC_NAME' => stripslashes($objResult->fields['name']))); $this->_objTpl->parseCurrentBlock('row'); $i++; $objResult->MoveNext(); } }
/** * Set up the template block with the shipment terms and conditions * * Please *DO NOT* remove this method, despite the site terms and * conditions have been removed from the Shop! * This has been requested by some shopkeepers and may be used at will. * @global array $_ARRAYLANG Language array * @author Reto Kohli <*****@*****.**> */ static function showShipmentTerms() { if (self::$objTemplate->blockExists('shopShipper')) { // TODO: Should be set by the calling view, if any global $_ARRAYLANG; self::$objTemplate->setGlobalVariable($_ARRAYLANG + array('SHOP_CURRENCY_SYMBOL' => Currency::getActiveCurrencySymbol(), 'SHOP_CURRENCY_CODE' => Currency::getActiveCurrencyCode())); $arrShipment = Shipment::getShipmentConditions(); foreach ($arrShipment as $strShipperName => $arrContent) { $strCountries = join(', ', $arrContent['countries']); $arrConditions = $arrContent['conditions']; self::$objTemplate->setCurrentBlock('shopShipment'); foreach ($arrConditions as $arrData) { self::$objTemplate->setVariable(array('SHOP_MAX_WEIGHT' => $arrData['max_weight'], 'SHOP_COST_FREE' => $arrData['free_from'], 'SHOP_COST' => $arrData['fee'])); self::$objTemplate->parse('shopShipment'); } self::$objTemplate->setVariable(array('SHOP_SHIPPER' => $strShipperName, 'SHOP_COUNTRIES' => $strCountries)); self::$objTemplate->parse('shopShipper'); } } }
/** * Show the article groups for editing * @return boolean True on success, false otherwise * @author Reto Kohli <*****@*****.**> */ function view_article_groups() { global $_ARRAYLANG; if (isset($_GET['delete'])) { Discount::deleteArticleGroup($_GET['id']); } if (isset($_POST['store'])) { Discount::storeArticleGroup($_POST['groupName'], $_POST['id']); } // Force discounts to be reinitialised Discount::flush(); self::$objTemplate->addBlockfile('SHOP_PRODUCTS_FILE', 'shop_products_block', 'module_shop_discount_groups_article.html'); // Group overview $arrGroups = Discount::getArticleGroupArray(); self::$objTemplate->setCurrentBlock('shopGroup'); $i = 0; foreach ($arrGroups as $id => $arrGroup) { self::$objTemplate->setVariable(array('SHOP_GROUP_ID' => $id, 'SHOP_GROUP_NAME' => $arrGroup['name'], 'SHOP_ROW_STYLE' => 'row' . (++$i % 2 + 1))); self::$objTemplate->parseCurrentBlock(); } // Add/edit Group $id = 0; if (!empty($_GET['edit'])) { $id = intval($_GET['id']); self::$objTemplate->setGlobalVariable(array('SHOP_GROUP_EDIT_CLASS' => 'active', 'SHOP_GROUP_EDIT_DISPLAY' => 'block', 'SHOP_GROUP_LIST_CLASS' => '', 'SHOP_GROUP_LIST_DISPLAY' => 'none', 'TXT_ADD_OR_EDIT' => $_ARRAYLANG['TXT_EDIT'])); } else { self::$objTemplate->setGlobalVariable(array('SHOP_GROUP_EDIT_CLASS' => '', 'SHOP_GROUP_EDIT_DISPLAY' => 'none', 'SHOP_GROUP_LIST_CLASS' => 'active', 'SHOP_GROUP_LIST_DISPLAY' => 'block', 'TXT_ADD_OR_EDIT' => $_ARRAYLANG['TXT_ADD'])); } self::$objTemplate->setCurrentBlock('shopGroupName'); self::$objTemplate->setVariable(array('SHOP_GROUP_ID_EDIT' => $id, 'SHOP_ROW_STYLE' => 'row' . (++$i % 2 + 1))); if (isset($arrGroups[$id])) { self::$objTemplate->setVariable('SHOP_GROUP_NAME', $arrGroups[$id]['name']); } self::$objTemplate->parseCurrentBlock(); return true; }