本文整理汇总了PHP中Cx\Core\Html\Sigma::parse方法的典型用法代码示例。如果您正苦于以下问题:PHP Sigma::parse方法的具体用法?PHP Sigma::parse怎么用?PHP Sigma::parse使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Cx\Core\Html\Sigma
的用法示例。
在下文中一共展示了Sigma::parse方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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');
}
}
}
示例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: count
/**
* Show the customer and article group discounts for editing.
*
* Handles storing of the discounts as well.
* @return boolean True on success, false otherwise
* @author Reto Kohli <reto.kohli@comvation.com>
*/
function view_customer_discounts()
{
if (!empty($_POST['store'])) {
$this->store_discount_customer();
}
self::$objTemplate->loadTemplateFile("module_shop_discount_customer.html");
// Discounts overview
$arrCustomerGroups = Discount::getCustomerGroupArray();
$arrArticleGroups = Discount::getArticleGroupArray();
$arrRate = null;
$arrRate = Discount::getDiscountRateCustomerArray();
$i = 0;
// Set up the customer groups header
self::$objTemplate->setVariable(array('SHOP_CUSTOMER_GROUP_COUNT' => count($arrCustomerGroups), 'SHOP_DISCOUNT_ROW_STYLE' => 'row' . (++$i % 2 + 1)));
foreach ($arrCustomerGroups as $id => $arrCustomerGroup) {
self::$objTemplate->setVariable(array('SHOP_CUSTOMER_GROUP_ID' => $id, 'SHOP_CUSTOMER_GROUP_NAME' => $arrCustomerGroup['name']));
self::$objTemplate->parse('customer_group_header_column');
self::$objTemplate->touchBlock('article_group_header_column');
self::$objTemplate->parse('article_group_header_column');
}
foreach ($arrArticleGroups as $groupArticleId => $arrArticleGroup) {
//DBG::log("Article group ID $groupArticleId");
foreach ($arrCustomerGroups as $groupCustomerId => $arrCustomerGroup) {
$rate = isset($arrRate[$groupCustomerId][$groupArticleId]) ? $arrRate[$groupCustomerId][$groupArticleId] : 0;
self::$objTemplate->setVariable(array('SHOP_CUSTOMER_GROUP_ID' => $groupCustomerId, 'SHOP_DISCOUNT_RATE' => sprintf('%2.2f', $rate)));
self::$objTemplate->parse('discount_column');
}
self::$objTemplate->setVariable(array('SHOP_ARTICLE_GROUP_ID' => $groupArticleId, 'SHOP_ARTICLE_GROUP_NAME' => $arrArticleGroup['name'], 'SHOP_DISCOUNT_ROW_STYLE' => 'row' . (++$i % 2 + 1)));
self::$objTemplate->parse('article_group_row');
}
self::$objTemplate->setGlobalVariable('SHOP_DISCOUNT_ROW_STYLE', 'row' . (++$i % 2 + 1));
// self::$objTemplate->touchBlock('article_group_header_row');
// self::$objTemplate->parse('article_group_header_row');
return true;
}
示例4: showCatEdit
function showCatEdit()
{
global $objDatabase, $_ARRAYLANG;
// check
if (!isset($_GET['set'])) {
if (!isset($_GET['id']) or $_GET['id'] == '') {
$this->goToReplace('&act=category');
die;
}
}
//set
if (isset($_GET['set']) and $_GET['set'] == 1) {
if ($_POST['form_id'] != '' and $_POST['form_name'] != '' and $_POST['form_status'] != '' and $_POST['form_lang'] != '') {
$id = intval($_POST['form_id']);
$name = CONTREXX_ESCAPE_GPC ? strip_tags($_POST['form_name']) : addslashes(strip_tags($_POST['form_name']));
$status = intval($_POST['form_status']);
$time = time();
$lang = intval($_POST['form_lang']);
$this->showCatEditSet($id, $name, $status, $time, $lang);
$_SESSION['strOkMessage'] = $_ARRAYLANG['TXT_FEED_MESSAGE_SUCCESSFUL_EDIT_CAT'];
$this->goToReplace('&act=category');
die;
} else {
$_SESSION['strErrMessage'] = $_ARRAYLANG['TXT_FEED_MESSAGE_ERROR_FILL_IN_ALL'];
$this->goToReplace('&act=catedit&id=' . $_POST['form_id']);
die;
}
}
$query = "SELECT id,\n name,\n status,\n lang\n FROM " . DBPREFIX . "module_feed_category\n WHERE id = '" . intval($_GET['id']) . "'";
$objResult = $objDatabase->Execute($query);
$id = $objResult->fields['id'];
$name = $objResult->fields['name'];
$status = $objResult->fields['status'];
$lang = $objResult->fields['lang'];
if ($status == 0) {
$status0 = ' selected';
$status1 = '';
} else {
$status0 = '';
$status1 = ' selected';
}
$this->_objTpl->setVariable(array('FEED_ID' => $id, 'FEED_NAME' => $name, 'FEED_STATUS0' => $status0, 'FEED_STATUS1' => $status1));
//lang
$query = "SELECT id,\n name\n FROM " . DBPREFIX . "languages\n WHERE id<>0\n ORDER BY id";
$objResult = $objDatabase->Execute($query);
while (!$objResult->EOF) {
$selected = '';
if ($lang == $objResult->fields['id']) {
$selected = ' selected';
}
$this->_objTpl->setVariable(array('FEED_LANG_ID' => $objResult->fields['id'], 'FEED_LANG_SELECTED' => $selected, 'FEED_LANG_NAME' => $objResult->fields['name']));
$this->_objTpl->parse('feed_lang');
$objResult->MoveNext();
}
//parse $_ARRAYLANG
$this->_objTpl->setVariable(array('TXT_FEED_EDIT_CAT' => $_ARRAYLANG['TXT_FEED_EDIT_CAT'], 'TXT_FEED_NAME' => $_ARRAYLANG['TXT_FEED_NAME'], 'TXT_FEED_LANGUAGE' => $_ARRAYLANG['TXT_FEED_LANGUAGE'], 'TXT_FEED_STATUS' => $_ARRAYLANG['TXT_FEED_STATUS'], 'TXT_FEED_INACTIVE' => $_ARRAYLANG['TXT_FEED_INACTIVE'], 'TXT_FEED_ACTIVE' => $_ARRAYLANG['TXT_FEED_ACTIVE'], 'TXT_FEED_RESET' => $_ARRAYLANG['TXT_FEED_RESET'], 'TXT_FEED_SAVE' => $_ARRAYLANG['TXT_FEED_SAVE'], 'TXT_FEED_FORMCHECK_NAME' => $_ARRAYLANG['TXT_FEED_FORMCHECK_NAME'], 'TXT_FEED_FORMCHECK_LANGUAGE' => $_ARRAYLANG['TXT_FEED_FORMCHECK_LANGUAGE'], 'TXT_FEED_FORMCHECK_STATUS' => $_ARRAYLANG['TXT_FEED_FORMCHECK_STATUS']));
}
示例5: parseDownload
private function parseDownload($objDownload, $categoryId)
{
global $_LANGID, $_ARRAYLANG;
if (!$this->objTemplate->blockExists('downloads_file_detail')) {
return;
}
$this->parseDownloadAttributes($objDownload, $categoryId);
$this->objTemplate->parse('downloads_file_detail');
$objDownload->incrementViewCount();
}
示例6: showEcards
function showEcards()
{
global $objDatabase, $_ARRAYLANG;
\JS::activate('shadowbox');
$this->_objTpl->setTemplate($this->pageContent);
// Initialize POST variables
$selectedId = isset($_POST['selectedEcard']) ? intval($_POST['selectedEcard']) : 0;
$message = !empty($_POST['ecardMessage']) ? htmlentities(contrexx_stripslashes($_POST['ecardMessage']), ENT_QUOTES, CONTREXX_CHARSET) : "";
$recipientSalutation = !empty($_POST['ecardRecipientSalutation']) ? htmlentities(contrexx_stripslashes($_POST['ecardRecipientSalutation']), ENT_QUOTES, CONTREXX_CHARSET) : "";
$senderName = !empty($_POST['ecardSenderName']) ? htmlentities(contrexx_stripslashes($_POST['ecardSenderName']), ENT_QUOTES, CONTREXX_CHARSET) : "";
$senderEmail = !empty($_POST['ecardSenderEmail']) && \FWValidator::isEmail($_POST['ecardSenderEmail']) ? $_POST['ecardSenderEmail'] : "";
$recipientName = !empty($_POST['ecardRecipientName']) ? htmlentities(contrexx_stripslashes($_POST['ecardRecipientName']), ENT_QUOTES, CONTREXX_CHARSET) : "";
$recipientEmail = !empty($_POST['ecardRecipientEmail']) && \FWValidator::isEmail($_POST['ecardRecipientEmail']) ? $_POST['ecardRecipientEmail'] : "";
// Get max. number of characters and lines per message
$query = "\n SELECT `setting_name`, `setting_value`\n FROM " . DBPREFIX . "module_ecard_settings";
$objResult = $objDatabase->Execute($query);
while (!$objResult->EOF) {
switch ($objResult->fields['setting_name']) {
case "maxCharacters":
$maxCharacters = $objResult->fields['setting_value'];
break;
case "maxLines":
$maxLines = $objResult->fields['setting_value'];
break;
}
$objResult->MoveNext();
}
$this->_objTpl->setVariable(array('ECARD_MESSAGE' => $message, 'ECARD_SENDERNAME' => $senderName, 'ECARD_RECIPIENTNAME' => $recipientName, 'ECARD_SENDEREMAIL' => $senderEmail, 'ECARD_RECIPIENTEMAIL' => $recipientEmail, 'ECARD_SALUTATION_SELECTED_MALE' => $recipientSalutation == $_ARRAYLANG['TXT_ECARD_TITLE_MALE'] ? ' checked="checked"' : '', 'ECARD_SALUTATION_SELECTED_FEMALE' => $recipientSalutation == $_ARRAYLANG['TXT_ECARD_TITLE_FEMALE'] ? ' checked="checked"' : '', 'TXT_ECARD_CHOOSE_IMAGE' => $_ARRAYLANG['TXT_ECARD_CHOOSE_IMAGE'], 'TXT_ECARD_ENTER_RECIPIENT_INFO' => $_ARRAYLANG['TXT_ECARD_ENTER_RECIPIENT_INFO'], 'TXT_ECARD_TITLE_MALE' => $_ARRAYLANG['TXT_ECARD_TITLE_MALE'], 'TXT_ECARD_TITLE_FEMALE' => $_ARRAYLANG['TXT_ECARD_TITLE_FEMALE'], 'TXT_ECARD_RECIPIENT_TITLE' => $_ARRAYLANG['TXT_ECARD_RECIPIENT_TITLE'], 'TXT_ECARD_RECIPIENT_NAME' => $_ARRAYLANG['TXT_ECARD_RECIPIENT_NAME'], 'TXT_ECARD_SENDER_NAME' => $_ARRAYLANG['TXT_ECARD_SENDER_NAME'], 'TXT_ECARD_RECIPIENT_EMAIL' => $_ARRAYLANG['TXT_ECARD_RECIPIENT_EMAIL'], 'TXT_ECARD_SENDER_EMAIL' => $_ARRAYLANG['TXT_ECARD_SENDER_EMAIL'], 'TXT_ECARD_ENTER_MESSAGE' => $_ARRAYLANG['TXT_ECARD_ENTER_MESSAGE'], 'TXT_ECARD_NUMBER_OF_CHARACTERS_LEFT' => sprintf($_ARRAYLANG['TXT_ECARD_NUMBER_OF_CHARACTERS_LEFT'], $maxCharacters), 'TXT_ECARD_NUMBER_OF_LINES_LEFT' => sprintf($_ARRAYLANG['TXT_ECARD_NUMBER_OF_LINES_LEFT'], $maxLines), 'TXT_ECARD_PREVIEW' => $_ARRAYLANG['TXT_ECARD_PREVIEW']));
// Select motives from DB
$query = "\n SELECT setting_value, setting_name\n FROM " . DBPREFIX . "module_ecard_settings\n WHERE setting_name LIKE 'motive_%'\n ORDER BY setting_name ASC";
$i = 0;
$objResult = $objDatabase->Execute($query);
// Initialize DATA placeholder
while (!$objResult->EOF) {
$motive = $objResult->fields['setting_value'];
$motive = basename($motive);
if (empty($motive)) {
$objResult->MoveNext();
continue;
}
$arrMatch = array();
$id = 0;
if (preg_match('/(\\d+)$/', $objResult->fields['setting_name'], $arrMatch)) {
$id = $arrMatch[1];
}
$this->_objTpl->setVariable(array('ECARD_MOTIVE_OPTIMIZED_PATH' => ASCMS_ECARD_OPTIMIZED_WEB_PATH . '/' . $motive, 'ECARD_MOTIVE_ID' => $id, 'ECARD_THUMBNAIL_PATH' => ASCMS_ECARD_THUMBNAIL_WEB_PATH . '/' . $motive, 'ECARD_CSSNUMBER' => $i % 3 + 1, 'ECARD_IMAGE_SELECTED' => $id == $selectedId ? ' checked="checked"' : ''));
$this->_objTpl->parse('motiveBlock');
if ($i % 3 == 0) {
$this->_objTpl->parse('motiveRow');
}
++$i;
$objResult->MoveNext();
}
$this->_objTpl->setVariable('ECARD_JAVASCRIPT', self::getJavascript($maxCharacters));
}
示例7: renderOptionField
/**
* Render the option field in the backend.
*
* @param Sigma $template
*/
public function renderOptionField($template)
{
$subTemplate = new Sigma();
$subTemplate->loadTemplateFile($this->cx->getCodeBaseCoreModulePath() . '/TemplateEditor/View/Template/Backend/AreaOption.html');
$subTemplate->setVariable('TEMPLATEEDITOR_OPTION_VALUE', $this->active ? 'checked' : '');
$subTemplate->setVariable('TEMPLATEEDITOR_OPTION_NAME', $this->name);
$subTemplate->setVariable('TEMPLATEEDITOR_OPTION_HUMAN_NAME', $this->humanName);
$template->setVariable('TEMPLATEEDITOR_OPTION', $subTemplate->get());
$template->setVariable('TEMPLATEEDITOR_OPTION_TYPE', 'area');
$template->parse('option');
}
示例8: overview
/**
* List the jobs
* @global object $objDatabase
* @param integer $newsid
* @param string $what
* @return string $output
*/
function overview()
{
global $objDatabase, $_ARRAYLANG, $_CONFIG;
// initialize variables
$i = 0;
$jobslocationform = '';
$location = '';
$docFilter = '';
$locationFilter = ' WHERE ';
$this->pageTitle = $_ARRAYLANG['TXT_JOBS_MANAGER'];
$this->_objTpl->loadTemplateFile('module_jobs_list.html', true, true);
$this->_objTpl->setVariable(array('TXT_EDIT_JOBS_MESSAGE' => $_ARRAYLANG['TXT_EDIT_DOCUMENTS'], 'TXT_EDIT_JOBS_ID' => $_ARRAYLANG['TXT_DOCUMENT_ID'], 'TXT_ARCHIVE' => $_ARRAYLANG['TXT_ARCHIVE'], 'TXT_DATE' => $_ARRAYLANG['TXT_DATE'], 'TXT_TITLE' => $_ARRAYLANG['TXT_TITLE'], 'TXT_USER' => $_ARRAYLANG['TXT_USER'], 'TXT_LAST_EDIT' => $_ARRAYLANG['TXT_LAST_EDIT'], 'TXT_ACTION' => $_ARRAYLANG['TXT_ACTION'], 'TXT_CATEGORY' => $_ARRAYLANG['TXT_CATEGORY'], 'TXT_CONFIRM_DELETE_DATA' => $_ARRAYLANG['TXT_DOCUMENT_DELETE_CONFIRM'], 'TXT_ACTION_IS_IRREVERSIBLE' => $_ARRAYLANG['TXT_ACTION_IS_IRREVERSIBLE'], 'TXT_SELECT_ALL' => $_ARRAYLANG['TXT_SELECT_ALL'], 'TXT_REMOVE_SELECTION' => $_ARRAYLANG['TXT_REMOVE_SELECTION'], 'TXT_EDIT' => $_ARRAYLANG['TXT_EDIT'], 'TXT_TEMPLATE' => $_ARRAYLANG['TXT_TEMPLATE'], 'TXT_MARKED' => $_ARRAYLANG['TXT_MARKED'], 'TXT_ACTIVATE' => $_ARRAYLANG['TXT_ACTIVATE'], 'TXT_DEACTIVATE' => $_ARRAYLANG['TXT_DEACTIVATE'], 'TXT_STATUS' => $_ARRAYLANG['TXT_STATUS'], 'TXT_AUTHOR' => $_ARRAYLANG['TXT_AUTHOR'], 'TXT_JOBS_SEARCH' => $_ARRAYLANG['TXT_JOBS_SEARCH']));
/* check if locations are activated */
$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->EOF) {
if (intval($objResult->fields['value']) == 1) {
if (isset($_REQUEST['location']) && is_numeric($_REQUEST['location'])) {
$location = $_REQUEST['location'];
$locationFilter = ", `" . DBPREFIX . "module_jobs_rel_loc_jobs` AS rel WHERE rel.job = n.id AND rel.location = '" . $location . "' AND ";
}
$jobslocationform = '<select name="location">' . '<option selected="selected" value="">' . $_ARRAYLANG['TXT_LOCATION'] . '</option>' . $this->getLocationMenu($location) . '</select>';
}
}
if (isset($_REQUEST['category']) && is_numeric($_REQUEST['category'])) {
$category = $_REQUEST['category'];
$docFilter = " n.catid='{$category}' AND ";
}
$jobscategoryform = '<select name="category">' . '<option selected="selected" value="">' . $_ARRAYLANG['TXT_CATEGORY'] . '</option>' . $this->getCategoryMenu($this->langId, $category) . '</select>';
$this->_objTpl->setVariable(array('JOBS_CATEGORY_FORM' => $jobscategoryform, 'JOBS_LOCATION_FORM' => $jobslocationform, 'TXT_SUBMIT' => $_ARRAYLANG['TXT_SUBMIT']));
$this->_objTpl->setGlobalVariable(array('TXT_DELETE' => $_ARRAYLANG['TXT_DELETE']));
$query = "SELECT n.id AS jobsId, n.date, n.changelog,\n n.title, n.status, n.author,\n l.name,\n nc.name AS catname,\n n.userid\n FROM " . DBPREFIX . "module_jobs_categories AS nc,\n " . DBPREFIX . "module_jobs AS n,\n " . DBPREFIX . "languages AS l\n {$locationFilter}\n n.lang=l.id\n AND n.lang={$this->langId}\n AND {$docFilter} nc.catid=n.catid\n ORDER BY n.id DESC";
$objResult = $objDatabase->Execute($query);
$count = $objResult->RecordCount();
$pos = isset($_GET['pos']) ? intval($_GET['pos']) : 0;
$paging = $count > intval($_CONFIG['corePagingLimit']) ? getPaging($count, $pos, "&cmd=Jobs&location=" . $location . "&category=" . $category . "&", $_ARRAYLANG['TXT_DOCUMENTS '], true) : "";
$objResult = $objDatabase->SelectLimit($query, $_CONFIG['corePagingLimit'], $pos);
if (!$objResult || $objResult->EOF) {
$this->_objTpl->hideBlock('row');
return;
}
while ($objResult !== false && !$objResult->EOF) {
$statusPicture = $objResult->fields['status'] == 1 ? "status_green.gif" : "status_red.gif";
$jobUser = \FWUser::getFWUserObject()->objUser->getUser($objResult->fields['userid']);
$username = $_ARRAYLANG['TXT_ACCESS_UNKNOWN'];
if ($jobUser) {
$username = $jobUser->getUsername();
}
$this->_objTpl->setVariable(array('JOBS_ID' => $objResult->fields['jobsId'], 'JOBS_DATE' => date(ASCMS_DATE_FORMAT, $objResult->fields['date']), 'JOBS_TITLE' => stripslashes($objResult->fields['title']), 'JOBS_AUTHOR' => stripslashes($objResult->fields['author']), 'JOBS_USER' => $username, 'JOBS_CHANGELOG' => date(ASCMS_DATE_FORMAT, $objResult->fields['changelog']), 'JOBS_PAGING' => $paging, 'JOBS_CLASS' => ++$i % 2 ? "row2" : "row1", 'JOBS_CATEGORY' => $objResult->fields['catname'], 'JOBS_STATUS' => $objResult->fields['status'], 'JOBS_STATUS_PICTURE' => $statusPicture, 'TXT_TEMPLATE' => $_ARRAYLANG['TXT_TEMPLATE'], 'TXT_EDIT' => $_ARRAYLANG['TXT_EDIT']));
$this->_objTpl->parse('row');
$objResult->MoveNext();
}
}
示例9: setMotives
function setMotives()
{
global $objDatabase, $_ARRAYLANG;
\JS::activate('shadowbox');
$this->_objTpl->loadTemplateFile('module_ecard_overview.html', true, true);
$this->_pageTitle = $_ARRAYLANG['TXT_MOTIVE_SELECTION'];
$mediaBrowser = new \Cx\Core_Modules\MediaBrowser\Model\Entity\MediaBrowser();
$mediaBrowser->setCallback('mbCallback');
$mediaBrowser->setOptions(array('type' => 'button', 'data-cx-mb-views' => 'filebrowser', 'id' => 'mediabrowser_button', 'style' => 'display: none;'));
/* Update progress */
if (!empty($_POST['saveMotives'])) {
$i = 0;
$motiveInputArray = $_POST['motiveInputArray'];
while ($i < 9) {
$filepath = $motiveInputArray[$i];
$filename = basename($filepath);
$query = "\n UPDATE " . DBPREFIX . "module_ecard_settings\n SET setting_value='" . contrexx_addslashes($filename) . "'\n WHERE setting_name='motive_{$i}'";
$objResult = $objDatabase->Execute($query);
/* Create optimized picture for e-card dispatch */
if ($filepath != '' && file_exists(\Env::get('cx')->getWebsitePath() . $filepath)) {
$this->resizeMotive(2, \Env::get('cx')->getWebsitePath() . $filepath, ASCMS_ECARD_OPTIMIZED_PATH . '/');
$this->resizeMotive(1, \Env::get('cx')->getWebsitePath() . $filepath, ASCMS_ECARD_THUMBNAIL_PATH . '/');
}
++$i;
}
$this->_objTpl->setVariable(array('CONTENT_OK_MESSAGE' => $this->strOkMessage = $_ARRAYLANG['TXT_DATA_SAVED']));
}
$this->_objTpl->setGlobalVariable(array('TXT_SAVE' => $_ARRAYLANG['TXT_SAVE'], 'TXT_DELETE_MOTIVE' => $_ARRAYLANG['TXT_DELETE_MOTIVE'], 'TXT_PICTURE' => $_ARRAYLANG['TXT_PICTURE'], 'TXT_PATH' => $_ARRAYLANG['TXT_PATH'], 'TXT_BROWSE' => $_ARRAYLANG['TXT_BROWSE'], 'TXT_CHOOSE' => $_ARRAYLANG['TXT_CHOOSE'], 'TXT_DELETE' => $_ARRAYLANG['TXT_DELETE'], 'TXT_ECARD_IMAGES' => $_ARRAYLANG['TXT_ECARD_IMAGES'], 'MEDIABROWSER_BUTTON' => $mediaBrowser->getXHtml($_ARRAYLANG['TXT_CORE_CM_BROWSE'])));
/* Display progress */
$query = "\n SELECT `setting_value`\n FROM " . DBPREFIX . "module_ecard_settings\n WHERE setting_name LIKE 'motive_%'\n ORDER BY setting_name ASC";
$objResult = $objDatabase->Execute($query);
$i = 0;
/* Create thumbnails */
while (!$objResult->EOF) {
$motiveFilename = $objResult->fields['setting_value'];
$thumbnail = ASCMS_ECARD_THUMBNAIL_WEB_PATH . '/' . "no_picture.gif";
$sourcePath = '';
if ($motiveFilename != '') {
$sourcePath = ASCMS_ECARD_OPTIMIZED_WEB_PATH . '/' . $motiveFilename;
$thumbnail = ASCMS_ECARD_THUMBNAIL_WEB_PATH . '/' . $motiveFilename;
}
/* Initialize DATA placeholder */
$this->_objTpl->setVariable(array('MOTIVE_PATH' => $sourcePath, 'MOTIVE_THUMB_PATH' => $thumbnail, 'MOTIVE_ID' => $i++));
$this->_objTpl->parse('motiveBlock');
$objResult->MoveNext();
}
$this->_objTpl->replaceBlock('motiveBlock', '', true);
}
示例10: renderOptionField
/**
* Render the option field in the backend.
*
* @param Sigma $template
*/
public function renderOptionField($template)
{
global $_ARRAYLANG;
$subTemplate = new Sigma();
$subTemplate->loadTemplateFile($this->cx->getCodeBaseCoreModulePath() . '/TemplateEditor/View/Template/Backend/ColorOption.html');
$subTemplate->setVariable('TEMPLATEEDITOR_OPTION_VALUE', $this->color);
$subTemplate->setVariable('TEMPLATEEDITOR_OPTION_NAME', $this->name);
$subTemplate->setVariable('TEMPLATEEDITOR_OPTION_HUMAN_NAME', $this->humanName);
if ($this->choice) {
$subTemplate->setVariable('TEMPLATEEDITOR_OPTION_CHOICE', json_encode($this->choice));
}
\ContrexxJavascript::getInstance()->setVariable(array('select' => $_ARRAYLANG['TXT_CORE_MODULE_TEMPLATEEDITOR_SELECT'], 'colorError' => $_ARRAYLANG['TXT_CORE_MODULE_TEMPLATEEDITOR_COLOR_WRONG_FORMAT'], 'cancel' => $_ARRAYLANG['TXT_CORE_MODULE_TEMPLATEEDITOR_CANCEL']), 'TemplateEditor');
$template->setVariable('TEMPLATEEDITOR_OPTION', $subTemplate->get());
$template->setVariable('TEMPLATEEDITOR_OPTION_TYPE', 'color');
$template->parse('option');
}
示例11: getSearchResults
/**
* Gets the search results.
*
* @return mixed Parsed content.
*/
public function getSearchResults()
{
global $_ARRAYLANG;
$this->template->addBlockfile('ADMIN_CONTENT', 'search', 'Default.html');
if (!empty($this->term)) {
$pages = $this->getSearchedPages();
$countPages = $this->countSearchedPages();
usort($pages, array($this, 'sortPages'));
if ($countPages > 0) {
$parameter = '&cmd=Search' . (empty($this->term) ? '' : '&term=' . contrexx_raw2encodedUrl($this->term));
$paging = \Paging::get($parameter, '', $countPages, 0, true, null, 'pos');
$this->template->setVariable(array('TXT_SEARCH_RESULTS_COMMENT' => sprintf($_ARRAYLANG['TXT_SEARCH_RESULTS_COMMENT'], $this->term, $countPages), 'TXT_SEARCH_TITLE' => $_ARRAYLANG['TXT_NAVIGATION_TITLE'], 'TXT_SEARCH_CONTENT_TITLE' => $_ARRAYLANG['TXT_PAGETITLE'], 'TXT_SEARCH_SLUG' => $_ARRAYLANG['TXT_CORE_CM_SLUG'], 'TXT_SEARCH_LANG' => $_ARRAYLANG['TXT_LANGUAGE'], 'SEARCH_PAGING' => $paging));
foreach ($pages as $page) {
// used for alias pages, because they have no language
if ($page->getLang() == "") {
$languages = "";
foreach (\FWLanguage::getIdArray('frontend') as $langId) {
$languages[] = \FWLanguage::getLanguageCodeById($langId);
}
} else {
$languages = array(\FWLanguage::getLanguageCodeById($page->getLang()));
}
$aliasLanguages = implode(', ', $languages);
$originalPage = $page;
$link = 'index.php?cmd=ContentManager&page=' . $page->getId();
if ($page->getType() == \Cx\Core\ContentManager\Model\Entity\Page::TYPE_ALIAS) {
$pageRepo = \Env::get('em')->getRepository('Cx\\Core\\ContentManager\\Model\\Entity\\Page');
if ($originalPage->isTargetInternal()) {
// is internal target, get target page
$originalPage = $pageRepo->getTargetPage($page);
} else {
// is an external target, set the link to the external targets url
$originalPage = new \Cx\Core\ContentManager\Model\Entity\Page();
$originalPage->setTitle($page->getTarget());
$link = $page->getTarget();
}
}
$this->template->setVariable(array('SEARCH_RESULT_BACKEND_LINK' => $link, 'SEARCH_RESULT_TITLE' => $originalPage->getTitle(), 'SEARCH_RESULT_CONTENT_TITLE' => $originalPage->getContentTitle(), 'SEARCH_RESULT_SLUG' => substr($page->getPath(), 1), 'SEARCH_RESULT_LANG' => $aliasLanguages, 'SEARCH_RESULT_FRONTEND_LINK' => \Cx\Core\Routing\Url::fromPage($page)));
$this->template->parse('search_result_row');
}
} else {
$this->template->setVariable(array('TXT_SEARCH_NO_RESULTS' => sprintf($_ARRAYLANG['TXT_SEARCH_NO_RESULTS'], $this->term)));
}
} else {
$this->template->setVariable(array('TXT_SEARCH_NO_TERM' => $_ARRAYLANG['TXT_SEARCH_NO_TERM']));
}
}
示例12: renderOptionField
/**
* Render the option field in the backend.
*
* @param Sigma $template
*/
public function renderOptionField($template)
{
global $_ARRAYLANG;
$subTemplate = new Sigma();
$subTemplate->loadTemplateFile($this->cx->getCodeBaseCoreModulePath() . '/TemplateEditor/View/Template/Backend/ImageOption.html');
$subTemplate->setGlobalVariable($_ARRAYLANG);
$subTemplate->setVariable('TEMPLATEEDITOR_OPTION_VALUE', $this->url);
$subTemplate->setVariable('TEMPLATEEDITOR_OPTION_NAME', $this->name);
$subTemplate->setVariable('TEMPLATEEDITOR_OPTION_HUMAN_NAME', $this->humanName);
$mediaBrowser = new MediaBrowser();
$mediaBrowser->setOptions(array('views' => 'uploader,filebrowser', 'startView' => 'filebrowser'));
$mediaBrowser->setCallback('callback_' . $this->name);
$subTemplate->setVariable('MEDIABROWSER_BUTTON', $mediaBrowser->getXHtml($_ARRAYLANG['TXT_CORE_MODULE_TEMPLATEEDITOR_CHOOSE_PICTURE']));
$template->setVariable('TEMPLATEEDITOR_OPTION', $subTemplate->get());
$template->setVariable('TEMPLATEEDITOR_OPTION_TYPE', 'img');
$template->parse('option');
}
示例13: renderOptionField
/**
* Render the option field in the backend.
*
* @param Sigma $template
*/
public function renderOptionField($template)
{
global $_LANGID;
$subTemplate = new Sigma();
$subTemplate->loadTemplateFile($this->cx->getCodeBaseCoreModulePath() . '/TemplateEditor/View/Template/Backend/SelectOption.html');
foreach ($this->choice as $value => $choice) {
$subTemplate->setVariable('CHOICE_NAME', isset($choice[$_LANGID]) ? $choice[$_LANGID] : (isset($choice[2]) ? $choice[2] : $value));
$subTemplate->setVariable('CHOICE_VALUE', $value);
if ($value == $this->activeChoice) {
$subTemplate->setVariable('CHOICE_ACTIVE', 'selected');
}
$subTemplate->parse('choices');
}
$subTemplate->setVariable('TEMPLATEEDITOR_OPTION_VALUE', $this->activeChoice);
$subTemplate->setVariable('TEMPLATEEDITOR_OPTION_NAME', $this->name);
$subTemplate->setVariable('TEMPLATEEDITOR_OPTION_HUMAN_NAME', $this->humanName);
$template->setVariable('TEMPLATEEDITOR_OPTION', $subTemplate->get());
$template->setVariable('TEMPLATEEDITOR_OPTION_TYPE', 'select');
$template->parse('option');
}
示例14: showShipmentTerms
/**
* 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 <reto.kohli@comvation.com>
*/
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');
}
}
}
示例15: 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');
}
}