本文整理汇总了PHP中Cx\Core\Html\Sigma::parseCurrentBlock方法的典型用法代码示例。如果您正苦于以下问题:PHP Sigma::parseCurrentBlock方法的具体用法?PHP Sigma::parseCurrentBlock怎么用?PHP Sigma::parseCurrentBlock使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Cx\Core\Html\Sigma
的用法示例。
在下文中一共展示了Sigma::parseCurrentBlock方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: manageLocations
/**
* 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();
}
}
示例2: foreach
/**
* Show the article groups for editing
* @return boolean True on success, false otherwise
* @author Reto Kohli <reto.kohli@comvation.com>
*/
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;
}