本文整理汇总了PHP中contrexx_raw2xhtml函数的典型用法代码示例。如果您正苦于以下问题:PHP contrexx_raw2xhtml函数的具体用法?PHP contrexx_raw2xhtml怎么用?PHP contrexx_raw2xhtml使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了contrexx_raw2xhtml函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: load
/**
* Load your component.
*
* @param \Cx\Core\ContentManager\Model\Entity\Page $page The resolved page
*/
public function load(\Cx\Core\ContentManager\Model\Entity\Page $page)
{
global $_CORELANG, $page, $objTemplate, $subMenuTitle;
switch ($this->cx->getMode()) {
case \Cx\Core\Core\Controller\Cx::MODE_FRONTEND:
$newsObj = new News(\Env::get('cx')->getPage()->getContent());
\Env::get('cx')->getPage()->setContent($newsObj->getNewsPage());
$newsObj->getPageTitle(\Env::get('cx')->getPage()->getTitle());
// Set the meta page description to the teaser text if displaying news details
$teaser = $newsObj->getTeaser();
if ($teaser !== null) {
//news details, else getTeaser would return null
$page->setMetadesc(contrexx_raw2xhtml(contrexx_strip_tags(html_entity_decode($teaser, ENT_QUOTES, CONTREXX_CHARSET))));
}
if (substr($page->getCmd(), 0, 7) == 'details') {
\Env::get('cx')->getPage()->setTitle($newsObj->newsTitle);
\Env::get('cx')->getPage()->setContentTitle($newsObj->newsTitle);
\Env::get('cx')->getPage()->setMetaTitle($newsObj->newsTitle);
}
break;
case \Cx\Core\Core\Controller\Cx::MODE_BACKEND:
$this->cx->getTemplate()->addBlockfile('CONTENT_OUTPUT', 'content_master', 'LegacyContentMaster.html');
$objTemplate = $this->cx->getTemplate();
\Permission::checkAccess(10, 'static');
$subMenuTitle = $_CORELANG['TXT_NEWS_MANAGER'];
$objNews = new NewsManager();
$objNews->getPage();
break;
default:
break;
}
}
示例2: getInputfield
function getInputfield($intView, $arrInputfield, $intEntryId = null)
{
global $objDatabase, $_ARRAYLANG, $_LANGID, $objInit;
switch ($intView) {
default:
case 1:
//modify (add/edit) View
$intId = intval($arrInputfield['id']);
$arrValue = array();
if (!empty($intEntryId)) {
$objInputfieldValue = $objDatabase->Execute("\n SELECT\n `value`,\n `lang_id`\n FROM " . DBPREFIX . "module_mediadir_rel_entry_inputfields\n WHERE field_id={$intId}\n AND entry_id={$intEntryId}");
if ($objInputfieldValue) {
while (!$objInputfieldValue->EOF) {
$arrValue[intval($objInputfieldValue->fields['lang_id'])] = contrexx_raw2xhtml($objInputfieldValue->fields['value']);
$objInputfieldValue->MoveNext();
}
$arrValue[0] = isset($arrValue[$_LANGID]) ? $arrValue[$_LANGID] : null;
}
} else {
$arrValue = null;
}
$countFrontendLang = count($this->arrFrontendLanguages);
$minimize = '';
if ($objInit->mode == 'backend' || $this->arrSettings['settingsFrontendUseMultilang']) {
$minimize = "<a href=\"javascript:ExpandMinimize('{$intId}');\">{$_ARRAYLANG['TXT_MEDIADIR_MORE']} »</a>";
}
$strDefaultValue = isset($arrValue[0]) ? $arrValue[0] : '';
$strDefaultInput = $this->getInput($intId, $strDefaultValue, 0, $arrInputfield);
$strInputfield = <<<INPUT
<div id="{$this->moduleNameLC}Inputfield_{$intId}_Minimized" class="{$this->moduleNameLC}GroupMultilang" style="display: block; float:left;">
{$strDefaultInput}
{$minimize}
</div>
INPUT;
if ($objInit->mode == 'backend' || $this->arrSettings['settingsFrontendUseMultilang']) {
$strInputfield .= '<div id="' . $this->moduleNameLC . 'Inputfield_' . $intId . '_Expanded" class="' . $this->moduleNameLC . 'GroupMultilang" style="display: none; float:left;">';
foreach ($this->arrFrontendLanguages as $key => $arrLang) {
$intLangId = $arrLang['id'];
$minimize = '';
if ($key + 1 == $countFrontendLang) {
$minimize = " <a href=\"javascript:ExpandMinimize('" . $intId . "');\">« " . $_ARRAYLANG['TXT_MEDIADIR_MINIMIZE'] . "</a>";
}
$value = isset($arrValue[$intLangId]) ? $arrValue[$intLangId] : '';
$strInput = $this->getInput($intId, $value, $intLangId);
$strInputfield .= <<<INPUT
<div>
{$strInput}
{$minimize}
</div>
INPUT;
}
$strInputfield .= '</div>';
}
return $strInputfield;
break;
case 2:
//search View
break;
}
}
示例3: getHomeTopNews
function getHomeTopNews($catId = 0)
{
global $_CORELANG, $objDatabase;
$catId = intval($catId);
$i = 0;
$this->_objTemplate->setTemplate($this->_pageContent, true, true);
if ($this->_objTemplate->blockExists('newsrow')) {
$this->_objTemplate->setCurrentBlock('newsrow');
} else {
return null;
}
$newsLimit = intval($this->arrSettings['news_top_limit']);
if ($newsLimit > 50) {
//limit to a maximum of 50 news
$newsLimit = 50;
}
if ($newsLimit < 1) {
//do not get any news if 0 was specified as the limit.
$objResult = false;
} else {
//fetch news
$objResult = $objDatabase->SelectLimit("\n SELECT DISTINCT(tblN.id) AS id,\n tblN.`date`, \n tblN.teaser_image_path,\n tblN.teaser_image_thumbnail_path,\n tblN.redirect,\n tblN.publisher,\n tblN.publisher_id,\n tblN.author,\n tblN.author_id,\n tblL.title AS title, \n tblL.teaser_text\n FROM " . DBPREFIX . "module_news AS tblN\n INNER JOIN " . DBPREFIX . "module_news_locale AS tblL ON tblL.news_id=tblN.id\n INNER JOIN " . DBPREFIX . "module_news_rel_categories AS tblC ON tblC.news_id=tblL.news_id\n WHERE tblN.status=1" . ($catId > 0 ? " AND tblC.category_id={$catId}" : '') . "\n AND tblN.teaser_only='0'\n AND tblL.lang_id=" . FRONTEND_LANG_ID . "\n AND (startdate<='" . date('Y-m-d H:i:s') . "' OR startdate='0000-00-00 00:00:00')\n AND (enddate>='" . date('Y-m-d H:i:s') . "' OR enddate='0000-00-00 00:00:00')" . ($this->arrSettings['news_message_protection'] == '1' && !\Permission::hasAllAccess() ? ($objFWUser = \FWUser::getFWUserObject()) && $objFWUser->objUser->login() ? " AND (frontend_access_id IN (" . implode(',', array_merge(array(0), $objFWUser->objUser->getDynamicPermissionIds())) . ") OR userid=" . $objFWUser->objUser->getId() . ") " : " AND frontend_access_id=0 " : '') . "ORDER BY\n (SELECT COUNT(*) FROM " . DBPREFIX . "module_news_stats_view WHERE news_id=tblN.id AND time>'" . date_format(date_sub(date_create('now'), date_interval_create_from_date_string(intval($this->arrSettings['news_top_days']) . ' day')), 'Y-m-d H:i:s') . "') DESC", $newsLimit);
}
if ($objResult !== false && $objResult->RecordCount()) {
while (!$objResult->EOF) {
$newsid = $objResult->fields['id'];
$newstitle = $objResult->fields['title'];
$author = \FWUser::getParsedUserTitle($objResult->fields['author_id'], $objResult->fields['author']);
$publisher = \FWUser::getParsedUserTitle($objResult->fields['publisher_id'], $objResult->fields['publisher']);
$newsCategories = $this->getCategoriesByNewsId($newsid);
$newsUrl = empty($objResult->fields['redirect']) ? \Cx\Core\Routing\Url::fromModuleAndCmd('News', $this->findCmdById('details', self::sortCategoryIdByPriorityId(array_keys($newsCategories), array($catId))), FRONTEND_LANG_ID, array('newsid' => $newsid)) : $objResult->fields['redirect'];
$htmlLink = self::parseLink($newsUrl, $newstitle, contrexx_raw2xhtml($newstitle));
list($image, $htmlLinkImage, $imageSource) = self::parseImageThumbnail($objResult->fields['teaser_image_path'], $objResult->fields['teaser_image_thumbnail_path'], $newstitle, $newsUrl);
$this->_objTemplate->setVariable(array('NEWS_ID' => $newsid, 'NEWS_CSS' => 'row' . ($i % 2 + 1), 'NEWS_LONG_DATE' => date(ASCMS_DATE_FORMAT, $objResult->fields['date']), 'NEWS_DATE' => date(ASCMS_DATE_FORMAT_DATE, $objResult->fields['date']), 'NEWS_TIME' => date(ASCMS_DATE_FORMAT_TIME, $objResult->fields['date']), 'NEWS_TITLE' => contrexx_raw2xhtml($newstitle), 'NEWS_TEASER' => nl2br($objResult->fields['teaser_text']), 'NEWS_LINK' => $htmlLink, 'NEWS_LINK_URL' => contrexx_raw2xhtml($newsUrl), 'NEWS_AUTHOR' => contrexx_raw2xhtml($author), 'NEWS_PUBLISHER' => contrexx_raw2xhtml($publisher)));
if (!empty($image)) {
$this->_objTemplate->setVariable(array('NEWS_IMAGE' => $image, 'NEWS_IMAGE_SRC' => contrexx_raw2xhtml($imageSource), 'NEWS_IMAGE_ALT' => contrexx_raw2xhtml($newstitle), 'NEWS_IMAGE_LINK' => $htmlLinkImage));
if ($this->_objTemplate->blockExists('news_image')) {
$this->_objTemplate->parse('news_image');
}
} else {
if ($this->_objTemplate->blockExists('news_image')) {
$this->_objTemplate->hideBlock('news_image');
}
}
self::parseImageBlock($this->_objTemplate, $objResult->fields['teaser_image_thumbnail_path'], $newstitle, $newsUrl, 'image_thumbnail');
self::parseImageBlock($this->_objTemplate, $objResult->fields['teaser_image_path'], $newstitle, $newsUrl, 'image_detail');
$this->_objTemplate->parseCurrentBlock();
$i++;
$objResult->MoveNext();
}
} else {
$this->_objTemplate->hideBlock('newsrow');
}
$this->_objTemplate->setVariable("TXT_MORE_NEWS", $_CORELANG['TXT_MORE_NEWS']);
return $this->_objTemplate->get();
}
示例4: getHomeHeadlines
function getHomeHeadlines($catId = 0)
{
global $_CORELANG, $objDatabase, $_LANGID;
$i = 0;
$catId = intval($catId);
$this->_objTemplate->setTemplate($this->_pageContent, true, true);
$newsLimit = intval($this->arrSettings['news_headlines_limit']);
if ($newsLimit > 50) {
//limit to a maximum of 50 news
$newsLimit = 50;
}
if ($newsLimit < 1) {
//do not get any news if 0 was specified as the limit.
$objResult = false;
} else {
//fetch news
$objResult = $objDatabase->SelectLimit("\n SELECT DISTINCT(tblN.id) AS id,\n tblN.`date`, \n tblN.teaser_image_path,\n tblN.teaser_image_thumbnail_path,\n tblN.redirect,\n tblN.publisher,\n tblN.publisher_id,\n tblN.author,\n tblN.author_id,\n tblL.text NOT REGEXP '^(<br type=\"_moz\" />)?\$' AS newscontent,\n tblL.title AS title, \n tblL.teaser_text\n FROM " . DBPREFIX . "module_news AS tblN\n INNER JOIN " . DBPREFIX . "module_news_locale AS tblL ON tblL.news_id=tblN.id\n INNER JOIN " . DBPREFIX . "module_news_rel_categories AS tblC ON tblC.news_id=tblL.news_id\n WHERE tblN.status=1" . ($catId > 0 ? " AND tblC.category_id={$catId}" : '') . "\n AND tblN.teaser_only='0'\n AND tblL.lang_id=" . $_LANGID . "\n AND tblL.is_active=1\n AND (startdate<='" . date('Y-m-d H:i:s') . "' OR startdate='0000-00-00 00:00:00')\n AND (enddate>='" . date('Y-m-d H:i:s') . "' OR enddate='0000-00-00 00:00:00')" . ($this->arrSettings['news_message_protection'] == '1' && !\Permission::hasAllAccess() ? ($objFWUser = \FWUser::getFWUserObject()) && $objFWUser->objUser->login() ? " AND (frontend_access_id IN (" . implode(',', array_merge(array(0), $objFWUser->objUser->getDynamicPermissionIds())) . ") OR userid=" . $objFWUser->objUser->getId() . ") " : " AND frontend_access_id=0 " : '') . "ORDER BY date DESC", $newsLimit);
}
if ($objResult !== false && $objResult->RecordCount() >= 0) {
while (!$objResult->EOF) {
$newsid = $objResult->fields['id'];
$newstitle = $objResult->fields['title'];
$newsCategories = $this->getCategoriesByNewsId($newsid);
$newsUrl = empty($objResult->fields['redirect']) ? empty($objResult->fields['newscontent']) ? '' : \Cx\Core\Routing\Url::fromModuleAndCmd('News', $this->findCmdById('details', self::sortCategoryIdByPriorityId(array_keys($newsCategories), array($catId))), FRONTEND_LANG_ID, array('newsid' => $newsid)) : $objResult->fields['redirect'];
$htmlLink = self::parseLink($newsUrl, $newstitle, contrexx_raw2xhtml($newstitle), 'headlineLink');
$htmlLinkTitle = self::parseLink($newsUrl, $newstitle, contrexx_raw2xhtml($newstitle));
// in case that the message is a stub, we shall just display the news title instead of a html-a-tag with no href target
if (empty($htmlLinkTitle)) {
$htmlLinkTitle = contrexx_raw2xhtml($newstitle);
}
list($image, $htmlLinkImage, $imageSource) = self::parseImageThumbnail($objResult->fields['teaser_image_path'], $objResult->fields['teaser_image_thumbnail_path'], $newstitle, $newsUrl);
$author = \FWUser::getParsedUserTitle($objResult->fields['author_id'], $objResult->fields['author']);
$publisher = \FWUser::getParsedUserTitle($objResult->fields['publisher_id'], $objResult->fields['publisher']);
$this->_objTemplate->setVariable(array('NEWS_ID' => $newsid, 'NEWS_CSS' => 'row' . ($i % 2 + 1), 'NEWS_LONG_DATE' => date(ASCMS_DATE_FORMAT, $objResult->fields['date']), 'NEWS_DATE' => date(ASCMS_DATE_FORMAT_DATE, $objResult->fields['date']), 'NEWS_TIME' => date(ASCMS_DATE_FORMAT_TIME, $objResult->fields['date']), 'NEWS_TITLE' => contrexx_raw2xhtml($newstitle), 'NEWS_TEASER' => nl2br($objResult->fields['teaser_text']), 'NEWS_LINK_TITLE' => $htmlLinkTitle, 'NEWS_LINK' => $htmlLink, 'NEWS_LINK_URL' => contrexx_raw2xhtml($newsUrl), 'NEWS_AUTHOR' => contrexx_raw2xhtml($author), 'NEWS_PUBLISHER' => contrexx_raw2xhtml($publisher), 'HEADLINE_ID' => $newsid, 'HEADLINE_DATE' => date(ASCMS_DATE_FORMAT_DATE, $objResult->fields['date']), 'HEADLINE_TEXT' => nl2br($objResult->fields['teaser_text']), 'HEADLINE_LINK' => $htmlLinkTitle, 'HEADLINE_AUTHOR' => contrexx_raw2xhtml($author)));
if (!empty($image)) {
$this->_objTemplate->setVariable(array('NEWS_IMAGE' => $image, 'NEWS_IMAGE_SRC' => contrexx_raw2xhtml($imageSource), 'NEWS_IMAGE_ALT' => contrexx_raw2xhtml($newstitle), 'NEWS_IMAGE_LINK' => $htmlLinkImage, 'HEADLINE_IMAGE_PATH' => contrexx_raw2xhtml($objResult->fields['teaser_image_path']), 'HEADLINE_THUMBNAIL_PATH' => contrexx_raw2xhtml($imageSource)));
if ($this->_objTemplate->blockExists('news_image')) {
$this->_objTemplate->parse('news_image');
}
} else {
if ($this->_objTemplate->blockExists('news_image')) {
$this->_objTemplate->hideBlock('news_image');
}
}
self::parseImageBlock($this->_objTemplate, $objResult->fields['teaser_image_thumbnail_path'], $newstitle, $newsUrl, 'image_thumbnail');
self::parseImageBlock($this->_objTemplate, $objResult->fields['teaser_image_path'], $newstitle, $newsUrl, 'image_detail');
$this->_objTemplate->parse('headlines_row');
$i++;
$objResult->MoveNext();
}
} else {
$this->_objTemplate->hideBlock('headlines_row');
}
$this->_objTemplate->setVariable("TXT_MORE_NEWS", $_CORELANG['TXT_MORE_NEWS']);
return $this->_objTemplate->get();
}
示例5: showDomains
/**
* Show all the Domain Alias
*
* @global array $_ARRAYLANG
*/
public function showDomains()
{
global $_ARRAYLANG, $objInit;
$langData = $objInit->loadLanguageData('Config');
$_ARRAYLANG = array_merge($_ARRAYLANG, $langData);
$domainRepository = new \Cx\Core\Net\Model\Repository\DomainRepository();
$domains = $domainRepository->findAll();
$view = new \Cx\Core\Html\Controller\ViewGenerator($domains, array('header' => $_ARRAYLANG['TXT_CORE_NETMANAGER'], 'entityName' => $_ARRAYLANG['TXT_CORE_NETMANAGER_ENTITY'], 'fields' => array('name' => array('header' => $_ARRAYLANG['TXT_NAME'], 'table' => array('parse' => function ($value) {
global $_ARRAYLANG;
static $mainDomainName;
if (empty($mainDomainName)) {
$domainRepository = new \Cx\Core\Net\Model\Repository\DomainRepository();
$mainDomainName = $domainRepository->getMainDomain()->getName();
}
$domainName = contrexx_raw2xhtml(\Cx\Core\Net\Controller\ComponentController::convertIdnToUtf8Format($value));
if ($domainName != contrexx_raw2xhtml($value)) {
$domainName .= ' (' . contrexx_raw2xhtml($value) . ')';
}
$mainDomainIcon = '';
if ($value == $mainDomainName) {
$mainDomainIcon = ' <img src="' . \Env::get('cx')->getCodeBaseCoreWebPath() . '/Core/View/Media/icons/Home.png" title="' . $_ARRAYLANG['TXT_CORE_CONFIG_MAINDOMAINID'] . '" />';
}
return $domainName . $mainDomainIcon;
}), 'formfield' => function ($fieldname, $fieldtype, $fieldlength, $fieldvalue, $fieldoptions) {
return \Cx\Core\Net\Controller\ComponentController::convertIdnToUtf8Format($fieldvalue);
}), 'id' => array('showOverview' => false)), 'functions' => array('add' => true, 'edit' => false, 'allowEdit' => true, 'delete' => false, 'allowDelete' => true, 'sorting' => true, 'paging' => true, 'filtering' => false, 'actions' => function ($rowData, $rowId) {
global $_CORELANG;
static $mainDomainName;
if (empty($mainDomainName)) {
$domainRepository = new \Cx\Core\Net\Model\Repository\DomainRepository();
$mainDomainName = $domainRepository->getMainDomain()->getName();
}
preg_match_all('/\\d+/', $rowId, $ids, null, 0);
$actionIcons = '';
$csrfParams = \Cx\Core\Csrf\Controller\Csrf::param();
if ($mainDomainName !== $rowData['name']) {
$actionIcons = '<a href="' . \Env::get('cx')->getWebsiteBackendPath() . '/?cmd=NetManager&editid=' . $rowId . '" class="edit" title="Edit entry"></a>';
$actionIcons .= '<a onclick=" if(confirm(\'' . $_CORELANG['TXT_CORE_RECORD_DELETE_CONFIRM'] . '\'))window.location.replace(\'' . \Env::get('cx')->getWebsiteBackendPath() . '/?cmd=NetManager&deleteid=' . (empty($ids[0][1]) ? 0 : $ids[0][1]) . '&vg_increment_number=' . (empty($ids[0][0]) ? 0 : $ids[0][0]) . '&' . $csrfParams . '\');" href="javascript:void(0);" class="delete" title="Delete entry"></a>';
}
return $actionIcons;
})));
$this->template->setVariable('DOMAINS_CONTENT', $view->render());
}
示例6: parsePage
/**
* Parses a rudimentary system log backend page
* @param \Cx\Core\Html\Sigma $template Backend template for this page
* @param array $cmd Supplied CMD
*/
public function parsePage(\Cx\Core\Html\Sigma $template, array $cmd)
{
$em = $this->cx->getDb()->getEntityManager();
$logRepo = $em->getRepository('Cx\\Core_Modules\\SysLog\\Model\\Entity\\Log');
// @todo: parse message if no entries (template block exists already)
$parseObject = $this->getNamespace() . '\\Model\\Entity\\Log';
// set default sorting
if (!isset($_GET['order'])) {
$_GET['order'] = 'timestamp/DESC';
}
// configure view
$viewGenerator = new \Cx\Core\Html\Controller\ViewGenerator($parseObject, array('functions' => array('delete' => 'true', 'paging' => true, 'sorting' => true, 'edit' => true), 'fields' => array('id' => array('showOverview' => false), 'timestamp' => array('readonly' => true), 'severity' => array('readonly' => true, 'table' => array('parse' => function ($data, $rows) {
return '<span class="' . contrexx_raw2xhtml(strtolower($data)) . '_background">' . contrexx_raw2xhtml($data) . '</span>';
})), 'message' => array('readonly' => true, 'table' => array('parse' => function ($data, $rows) {
$url = clone \Cx\Core\Routing\Url::fromRequest();
$url->setMode('backend');
$url->setParam('editid', $rows['id']);
return '<a href="' . $url . '">' . contrexx_raw2xhtml($data) . '</a>';
})), 'data' => array('readonly' => true, 'showOverview' => false, 'type' => 'text'), 'logger' => array('readonly' => true))));
$template->setVariable('ENTITY_VIEW', $viewGenerator);
}
示例7: notifyStaffOnContactAccModification
/**
* notify the staffs regarding the account modification of a contact
*
* @param Integer $customerId customer id
* @param String $first_name customer first name
* @param String $last_name customer last name
*
* @access public
* @global object $objTemplate
* @global array $_ARRAYLANG
*
* @return null
*/
public function notifyStaffOnContactAccModification($customerId = 0, $first_name = '', $last_name = '', $gender = 0)
{
global $objDatabase, $_ARRAYLANG;
if (empty($customerId)) {
return false;
}
$objFWUser = \FWUser::getFWUserObject();
$settings = $this->getSettings();
$resources = $this->getResources($settings['emp_default_user_group']);
$customer_name = $first_name . " " . $last_name;
$contact_gender = $gender == 1 ? "gender_female" : ($gender == 2 ? "gender_male" : 'gender_undefined');
$emailIds = array();
foreach ($resources as $key => $value) {
$emailIds[] = $value['email'];
}
$cx = \Cx\Core\Core\Controller\Cx::instanciate();
foreach ($emailIds as $emails) {
if (!empty($emails)) {
$objUsers = $objFWUser->objUser->getUsers($filter = array('email' => addslashes($emails)));
$info['substitution'] = array('CRM_ASSIGNED_USER_NAME' => contrexx_raw2xhtml(\FWUser::getParsedUserTitle($objUsers->getId())), 'CRM_ASSIGNED_USER_EMAIL' => $emails, 'CRM_CONTACT_FIRSTNAME' => contrexx_raw2xhtml($first_name), 'CRM_CONTACT_LASTNAME' => contrexx_raw2xhtml($last_name), 'CRM_CONTACT_GENDER' => contrexx_raw2xhtml($contact_gender), 'CRM_DOMAIN' => ASCMS_PROTOCOL . "://{$_SERVER['HTTP_HOST']}" . $cx->getCodeBaseOffsetPath(), 'CRM_CONTACT_DETAILS_URL' => ASCMS_PROTOCOL . "://{$_SERVER['HTTP_HOST']}" . $cx->getCodeBaseOffsetPath() . $cx->getBackendFolderName() . "/index.php?cmd=" . $this->moduleName . "&act=customers&tpl=showcustdetail&id={$customerId}", 'CRM_CONTACT_DETAILS_LINK' => "<a href='" . ASCMS_PROTOCOL . "://{$_SERVER['HTTP_HOST']}" . $cx->getCodeBaseOffsetPath() . $cx->getBackendFolderName() . "/index.php?cmd=" . $this->moduleName . "&act=customers&tpl=showcustdetail&id={$customerId}'>" . $customer_name . "</a>");
//setting email template lang id
$availableMailTempLangAry = $this->getActiveEmailTemLangId('Crm', CRM_EVENT_ON_ACCOUNT_UPDATED);
$availableLangId = $this->getEmailTempLang($availableMailTempLangAry, $emails);
$info['lang_id'] = $availableLangId;
$dispatcher = CrmEventDispatcher::getInstance();
$dispatcher->triggerEvent(CRM_EVENT_ON_ACCOUNT_UPDATED, null, $info);
}
}
}
示例8: getDataElement
//.........这里部分代码省略.........
// this image is uesd as delete function for the selected image over javascript
$deleteImage = new \Cx\Core\Html\Model\Entity\HtmlElement('img');
$deleteImage->setAttribute('class', 'deletePreviewImage');
$deleteImage->setAttribute('src', '/core/Core/View/Media/icons/delete.gif');
$div->addChild($previewImage);
$div->addChild($deleteImage);
$div->addChild(new \Cx\Core\Html\Model\Entity\HtmlElement('br'));
}
$div->addChild($input);
$div->addChild(new \Cx\Core\Html\Model\Entity\TextElement($mediaBrowser->getXHtml($_ARRAYLANG['TXT_CORE_CM_BROWSE'])));
return $div;
break;
case 'sourcecode':
//set mode
$mode = 'html';
if (isset($options['options']['mode'])) {
switch ($options['options']['mode']) {
case 'js':
$mode = 'javascript';
break;
case 'yml':
case 'yaml':
$mode = 'yaml';
break;
}
}
//define textarea
$textarea = new \Cx\Core\Html\Model\Entity\HtmlElement('textarea');
$textarea->setAttribute('name', $name);
$textarea->setAttribute('id', $name);
$textarea->setAttribute('style', 'display:none;');
$textarea->addChild(new \Cx\Core\Html\Model\Entity\TextElement($value));
//define pre
$pre = new \Cx\Core\Html\Model\Entity\HtmlElement('pre');
$pre->setAttribute('id', 'editor-' . $name);
$pre->addChild(new \Cx\Core\Html\Model\Entity\TextElement(contrexx_raw2xhtml($value)));
//set readonly if necessary
$readonly = '';
if (isset($options['readonly']) && $options['readonly']) {
$readonly = 'editor.setReadOnly(true);';
$textarea->setAttribute('disabled');
}
//create div and add all stuff
$div = new \Cx\Core\Html\Model\Entity\HtmlElement('div');
// required for the Ace editor to work. Otherwise
// it won't be visible as the DIV does have a width of 0px.
$div->setAttribute('style', 'display:block;');
$div->addChild($textarea);
$div->addChild($pre);
//register js
$jsCode = <<<CODE
var editor;
\$J(function(){
if (\$J("#editor-{$name}").length) {
editor = ace.edit("editor-{$name}");
editor.getSession().setMode("ace/mode/{$mode}");
editor.setShowPrintMargin(false);
editor.focus();
editor.gotoLine(1);
{$readonly}
}
\$J('form').submit(function(){
\$J('#{$name}').val(editor.getSession().getValue());
});
});
CODE;
\JS::activate('ace');
\JS::registerCode($jsCode);
return $div;
break;
case 'string':
case 'hidden':
default:
// convert NULL to empty string
if (is_null($value)) {
$value = '';
}
// input field with type text
$input = new \Cx\Core\Html\Model\Entity\DataElement($name, $value);
if (isset($options['validValues'])) {
$input->setValidator(new \Cx\Core\Validate\Model\Entity\RegexValidator('/^' . $options['validValues'] . '$/'));
}
if ($type == 'hidden') {
$input->setAttribute('type', 'hidden');
} else {
$input->setAttribute('type', 'text');
$input->setClass('form-control');
}
if (isset($options['readonly']) && $options['readonly']) {
$input->setAttribute('disabled');
}
if (isset($options['attributes'])) {
$input->setAttributes($options['attributes']);
}
return $input;
break;
}
}
示例9: getInputfield
function getInputfield($intView, $arrInputfield, $intEntryId = null)
{
global $objDatabase, $_LANGID, $objInit, $_ARRAYLANG;
switch ($intView) {
default:
case 1:
//modify (add/edit) View
$intId = intval($arrInputfield['id']);
$arrValue = null;
if (!empty($intEntryId)) {
$objInputfieldValue = $objDatabase->Execute("\n SELECT\n `value`,\n `lang_id`\n FROM\n " . DBPREFIX . "module_" . $this->moduleTablePrefix . "_rel_entry_inputfields\n WHERE\n field_id=" . $intId . "\n AND\n entry_id=" . $intEntryId . "\n ");
if ($objInputfieldValue !== false) {
while (!$objInputfieldValue->EOF) {
$arrValue[intval($objInputfieldValue->fields['lang_id'])] = contrexx_raw2xhtml($objInputfieldValue->fields['value']);
$objInputfieldValue->MoveNext();
}
$arrValue[0] = isset($arrValue[$_LANGID]) ? $arrValue[$_LANGID] : null;
}
}
if (empty($arrValue)) {
foreach ($arrInputfield['default_value'] as $intLangKey => $strDefaultValue) {
$strDefaultValue = empty($strDefaultValue) ? $arrInputfield['default_value'][0] : $strDefaultValue;
if (substr($strDefaultValue, 0, 2) == '[[') {
$objPlaceholder = new \Cx\Modules\MediaDir\Controller\MediaDirectoryPlaceholder($this->moduleName);
$arrValue[$intLangKey] = $objPlaceholder->getPlaceholder($strDefaultValue);
} else {
$arrValue[$intLangKey] = $strDefaultValue;
}
}
}
$arrInfoValue = null;
$strInfoClass = '';
if (!empty($arrInputfield['info'][0])) {
$arrInfoValue[0] = 'title="' . $arrInputfield['info'][0] . '"';
$strInfoClass = 'mediadirInputfieldHint';
foreach ($arrInputfield['info'] as $intLangKey => $strInfoValue) {
$arrInfoValue[$intLangKey] = empty($strInfoValue) ? 'title="' . $arrInputfield['info'][0] . '"' : 'title="' . $strInfoValue . '"';
}
}
$countFrontendLang = count($this->arrFrontendLanguages);
if ($objInit->mode == 'backend') {
$strInputfield = '<div id="' . $this->moduleNameLC . 'Inputfield_' . $intId . '_Minimized" style="display: block;"><textarea data-id="' . $intId . '" class="' . $this->moduleNameLC . 'InputfieldDefault" name="' . $this->moduleNameLC . 'Inputfield[' . $intId . '][0]" id="' . $this->moduleNameLC . 'Inputfield_' . $intId . '_0" style="width: 300px; height: 60px;" onfocus="this.select();" />' . $arrValue[0] . '</textarea> <a href="javascript:ExpandMinimize(\'' . $intId . '\');">' . $_ARRAYLANG['TXT_MEDIADIR_MORE'] . ' »</a></div>';
$strInputfield .= '<div id="' . $this->moduleNameLC . 'Inputfield_' . $intId . '_Expanded" style="display: none;">';
foreach ($this->arrFrontendLanguages as $key => $arrLang) {
$intLangId = $arrLang['id'];
$minimize = "";
if ($key + 1 == $countFrontendLang) {
$minimize = " <a href=\"javascript:ExpandMinimize('" . $intId . "');\">« " . $_ARRAYLANG['TXT_MEDIADIR_MINIMIZE'] . "</a>";
}
$value = isset($arrValue[$intLangId]) ? $arrValue[$intLangId] : '';
$strInputfield .= '<textarea data-id="' . $intId . '" name="' . $this->moduleNameLC . 'Inputfield[' . $intId . '][' . $intLangId . ']" id="' . $this->moduleNameLC . 'Inputfield_' . $intId . '_' . $intLangId . '" style="height: 60px; width: 279px; margin-bottom: 2px; padding-left: 21px; background: #ffffff url(\'' . \Env::get('cx')->getCodeBaseOffsetPath() . \Env::get('cx')->getCoreFolderName() . '/Country/View/Media/Flag/flag_' . $arrLang['lang'] . '.gif\') no-repeat 3px 3px;" onfocus="this.select();" />' . $value . '</textarea> ' . $arrLang['name'] . '<a href="javascript:ExpandMinimize(\'' . $intId . '\');"> ' . $minimize . '</a><br />';
}
$strInputfield .= '</div>';
} else {
if ($this->arrSettings['settingsFrontendUseMultilang'] == 1) {
$strInputfield = '<div id="' . $this->moduleNameLC . 'Inputfield_' . $intId . '_Minimized" style="display: block; float: left;" class="' . $this->moduleNameLC . 'GroupMultilang"><textarea data-id="' . $intId . '" class="' . $this->moduleNameLC . 'InputfieldDefault" name="' . $this->moduleNameLC . 'Inputfield[' . $intId . '][0]" id="' . $this->moduleNameLC . 'Inputfield_' . $intId . '_0" class="' . $this->moduleNameLC . 'InputfieldTextarea ' . $strInfoClass . '" ' . $arrInfoValue[0] . ' onfocus="this.select();" />' . $arrValue[0] . '</textarea> <a href="javascript:ExpandMinimize(\'' . $intId . '\');">' . $_ARRAYLANG['TXT_MEDIADIR_MORE'] . ' »</a></div>';
$strInputfield .= '<div id="' . $this->moduleNameLC . 'Inputfield_' . $intId . '_Expanded" style="display: none; float: left;" class="' . $this->moduleNameLC . 'GroupMultilang">';
foreach ($this->arrFrontendLanguages as $key => $arrLang) {
$intLangId = $arrLang['id'];
$minimize = "";
if ($key + 1 == $countFrontendLang) {
$minimize = " <a href=\"javascript:ExpandMinimize('" . $intId . "');\">« " . $_ARRAYLANG['TXT_MEDIADIR_MINIMIZE'] . "</a>";
}
$value = isset($arrValue[$intLangId]) ? $arrValue[$intLangId] : '';
$strInputfield .= '<textarea data-id="' . $intId . '" name="' . $this->moduleNameLC . 'Inputfield[' . $intId . '][' . $intLangId . ']" id="' . $this->moduleNameLC . 'Inputfield_' . $intId . '_' . $intLangId . '" class="' . $this->moduleNameLC . 'InputfieldTextarea ' . $strInfoClass . '" ' . $arrInfoValue[$intLangId] . ' onfocus="this.select();" />' . $value . '</textarea> ' . $arrLang['name'] . '<a href="javascript:ExpandMinimize(\'' . $intId . '\');"> ' . $minimize . '</a><br />';
}
$strInputfield .= '</div>';
} else {
$strInputfield = '<textarea name="' . $this->moduleNameLC . 'Inputfield[' . $intId . '][0]" id="' . $this->moduleNameLC . 'Inputfield_' . $intId . '_0" class="' . $this->moduleNameLC . 'InputfieldTextarea ' . $strInfoClass . '" ' . $arrInfoValue[0] . ' onfocus="this.select();" />' . $arrValue[0] . '</textarea>';
}
}
return $strInputfield;
break;
case 2:
//search View
break;
}
return null;
}
示例10: getNavtreeLevels
function getNavtreeLevels($intLevelId)
{
$objLevel = new MediaDirectoryLevel($intLevelId, null, 0, $this->moduleName);
$objLevel->arrLevels[$intLevelId];
if (isset($_GET['cmd'])) {
$strLevelCmd = '&cmd=' . $_GET['cmd'];
} else {
$strLevelCmd = null;
}
$this->arrNavtree[] = '<a href="?section=' . $this->moduleName . $strLevelCmd . '&lid=' . $objLevel->arrLevels[$intLevelId]['levelId'] . '">' . contrexx_raw2xhtml($objLevel->arrLevels[$intLevelId]['levelName'][0]) . '</a>';
if ($objLevel->arrLevels[$intLevelId]['levelParentId'] != 0) {
$this->getNavtreeLevels($objLevel->arrLevels[$intLevelId]['levelParentId']);
}
}
示例11: getData
/**
* gets the data for the event
*
* @return null
*/
function getData()
{
global $objDatabase, $_ARRAYLANG, $_LANGID;
$activeLangs = explode(",", $this->showIn);
$this->arrData = array();
foreach ($activeLangs as $key => $langId) {
$query = "SELECT field.title AS title,\n field.teaser AS teaser,\n field.description AS description,\n field.redirect AS redirect,\n field.place AS place,\n field.place_city AS place_city,\n field.place_country AS place_country,\n field.org_name AS org_name,\n field.org_city AS org_city,\n field.org_country AS org_country\n FROM " . DBPREFIX . "module_" . $this->moduleTablePrefix . "_event_field AS field\n WHERE field.event_id = '" . intval($this->id) . "'\n AND field.lang_id = '" . intval($langId) . "'\n LIMIT 1";
$objResult = $objDatabase->Execute($query);
if ($objResult !== false) {
while (!$objResult->EOF) {
$this->arrData['title'][$langId] = htmlentities(stripslashes($objResult->fields['title']), ENT_QUOTES, CONTREXX_CHARSET);
$this->arrData['teaser'][$langId] = htmlentities(stripslashes($objResult->fields['teaser']), ENT_QUOTES, CONTREXX_CHARSET);
$this->arrData['description'][$langId] = stripslashes($objResult->fields['description']);
$this->arrData['redirect'][$langId] = htmlentities(stripslashes($objResult->fields['redirect']), ENT_QUOTES, CONTREXX_CHARSET);
$this->arrData['place'][$langId] = contrexx_raw2xhtml($objResult->fields['place']);
$this->arrData['place_city'][$langId] = contrexx_raw2xhtml($objResult->fields['place_city']);
$this->arrData['place_country'][$langId] = contrexx_raw2xhtml($objResult->fields['place_country']);
$this->arrData['org_name'][$langId] = contrexx_raw2xhtml($objResult->fields['org_name']);
$this->arrData['org_city'][$langId] = contrexx_raw2xhtml($objResult->fields['org_city']);
$this->arrData['org_country'][$langId] = contrexx_raw2xhtml($objResult->fields['org_country']);
$objResult->MoveNext();
}
}
}
}
示例12: _showRecipientFeedbackAnalysis
function _showRecipientFeedbackAnalysis()
{
global $objDatabase, $_ARRAYLANG, $_CONFIG;
if (empty($_REQUEST['id']) || empty($_REQUEST['recipient_type']) || !in_array($_REQUEST['recipient_type'], array(self::USER_TYPE_NEWSLETTER, self::USER_TYPE_ACCESS))) {
return $this->_userList();
}
$recipientId = intval($_REQUEST['id']);
$recipientType = $_REQUEST['recipient_type'];
$linkCount = 0;
if ($recipientType == self::USER_TYPE_NEWSLETTER) {
$objRecipient = $objDatabase->SelectLimit('SELECT `lastname`, `firstname` FROM `' . DBPREFIX . 'module_newsletter_user` WHERE `id`=' . $recipientId, 1);
if ($objRecipient !== false && $objRecipient->RecordCount() == 1) {
$recipientLastname = $objRecipient->fields['lastname'];
$recipientFirstname = $objRecipient->fields['firstname'];
} else {
return $this->_userList();
}
} else {
$objRecipient = \FWUser::getFWUserObject()->objUser->getUser($recipientId);
if ($objRecipient) {
$recipientLastname = $objRecipient->getProfileAttribute('lastname');
$recipientFirstname = $objRecipient->getProfileAttribute('firstname');
} else {
return $this->_userList();
}
}
$this->_pageTitle = $_ARRAYLANG['TXT_NEWSLETTER_USER_ADMINISTRATION'];
$this->_objTpl->addBlockfile('NEWSLETTER_USER_FILE', 'module_newsletter_user_feedback', 'module_newsletter_user_feedback.html');
$this->_objTpl->setVariable('TXT_NEWSLETTER_USER_FEEDBACK_TITLE', sprintf($_ARRAYLANG['TXT_NEWSLETTER_RECIPIENT_FEEDBACK'], contrexx_raw2xhtml(trim($recipientLastname . " " . $recipientFirstname))));
$this->_objTpl->setVariable(array('TXT_NEWSLETTER_LINK_TITLE' => $_ARRAYLANG['TXT_NEWSLETTER_LINK_TITLE'], 'TXT_NEWSLETTER_EMAIL' => $_ARRAYLANG['TXT_NEWSLETTER_EMAIL'], 'TXT_NEWSLETTER_LINK_SOURCE' => $_ARRAYLANG['TXT_NEWSLETTER_LINK_SOURCE'], 'TXT_NEWSLETTER_FUNCTIONS' => $_ARRAYLANG['TXT_NEWSLETTER_FUNCTIONS'], 'TXT_NEWSLETTER_BACK' => $_ARRAYLANG['TXT_NEWSLETTER_BACK']));
$this->_objTpl->setGlobalVariable(array('TXT_NEWSLETTER_OPEN_LINK_IN_NEW_TAB' => $_ARRAYLANG['TXT_NEWSLETTER_OPEN_LINK_IN_NEW_TAB']));
$objResultCount = $objDatabase->SelectLimit('
SELECT COUNT(1) AS `link_count`
FROM `' . DBPREFIX . 'module_newsletter_email_link_feedback`
WHERE `recipient_id` = ' . $recipientId . '
AND `recipient_type` = \'' . $recipientType . '\'', 1);
if ($objResultCount !== false) {
$linkCount = $objResultCount->fields['link_count'];
}
$rowNr = 0;
$pos = isset($_GET['pos']) ? intval($_GET['pos']) : 0;
$objResult = $objDatabase->SelectLimit("SELECT\n tblLink.id,\n tblLink.title,\n tblLink.url,\n tblMail.subject\n FROM " . DBPREFIX . "module_newsletter_email_link_feedback AS tblMailLinkFB\n INNER JOIN " . DBPREFIX . "module_newsletter AS tblMail ON tblMail.id = tblMailLinkFB.email_id\n INNER JOIN " . DBPREFIX . "module_newsletter_email_link AS tblLink ON tblMailLinkFB.link_id = tblLink.id\n WHERE tblMailLinkFB.recipient_id = " . $recipientId . " AND tblMailLinkFB.recipient_type = '" . $recipientType . "'\n ORDER BY tblLink.title ASC", $_CONFIG['corePagingLimit'], $pos);
if ($objResult !== false) {
while (!$objResult->EOF) {
$this->_objTpl->setVariable(array('NEWSLETTER_LINK_ROW_CLASS' => $rowNr % 2 == 1 ? 'row1' : 'row2', 'NEWSLETTER_LINK_TITLE' => contrexx_raw2xhtml($objResult->fields['title']), 'NEWSLETTER_LINK_URL' => $objResult->fields['url'], 'NEWSLETTER_EMAIL' => $objResult->fields['subject']));
$this->_objTpl->setGlobalVariable('NEWSLETTER_LINK_ID', $objResult->fields['id']);
$this->_objTpl->parse("link_list");
$objResult->MoveNext();
$rowNr++;
}
if ($rowNr > 0) {
$paging = getPaging($linkCount, $pos, "&cmd=Newsletter&act=users&tpl=feedback&id=" . $recipientId, "", false, $_CONFIG['corePagingLimit']);
$this->_objTpl->setVariable('NEWSLETTER_LINKS_PAGING', "<br />" . $paging . "<br />");
} else {
$this->_objTpl->setVariable('NEWSLETTER_USER_NO_FEEDBACK', $_ARRAYLANG['TXT_NEWSLETTER_USER_NO_FEEDBACK']);
$this->_objTpl->touchBlock('link_list_empty');
$this->_objTpl->hideBlock('link_list');
}
}
return true;
}
示例13: languageOverview
/**
* Set the language list page
*
* @global array
* @global ADONewConnection
* @global \Cx\Core\Html\Sigma
* @return void
*/
function languageOverview()
{
global $_ARRAYLANG, $objDatabase;
// init vars
$i = 0;
\JS::activate('cx');
$cxjs = \ContrexxJavascript::getInstance();
$cxjs->setVariable('copyTitle', $_ARRAYLANG['TXT_LANGUAGE_COPY_TITLE'], 'language/lang');
$cxjs->setVariable('copyText', $_ARRAYLANG['TXT_LANGUAGE_COPY_TEXT'], 'language/lang');
$cxjs->setVariable('copySuccess', $_ARRAYLANG['TXT_LANGUAGE_COPY_SUCCESS'], 'language/lang');
$cxjs->setVariable('linkTitle', $_ARRAYLANG['TXT_LANGUAGE_LINK_TITLE'], 'language/lang');
$cxjs->setVariable('linkText', $_ARRAYLANG['TXT_LANGUAGE_LINK_TEXT'], 'language/lang');
$cxjs->setVariable('linkSuccess', $_ARRAYLANG['TXT_LANGUAGE_LINK_SUCCESS'], 'language/lang');
$cxjs->setVariable('warningTitle', $_ARRAYLANG['TXT_LANGUAGE_WARNING_TITLE'], 'language/lang');
$cxjs->setVariable('warningText', $_ARRAYLANG['TXT_LANGUAGE_WARNING_TEXT'], 'language/lang');
$cxjs->setVariable('waitTitle', $_ARRAYLANG['TXT_LANGUAGE_WAIT_TITLE'], 'language/lang');
$cxjs->setVariable('waitText', $_ARRAYLANG['TXT_LANGUAGE_WAIT_TEXT'], 'language/lang');
$cxjs->setVariable('yesOption', $_ARRAYLANG['TXT_YES'], 'language/lang');
$cxjs->setVariable('noOption', $_ARRAYLANG['TXT_NO'], 'language/lang');
$cxjs->setVariable('langRemovalLabel', $_ARRAYLANG['TXT_LANGUAGE_MANAGER_LABEL_LANG_REMOVAL'], 'language/lang');
$cxjs->setVariable('langRemovalContent', $_ARRAYLANG['TXT_LANGUAGE_MANAGER_LANG_REMOVAL_CONTENT'], 'language/lang');
$this->template->loadTemplateFile('language_langlist.html');
$this->pageTitle = $_ARRAYLANG['TXT_LANGUAGE_LIST'];
if (!$this->isInFullMode()) {
$this->hideVariables = true;
$this->template->hideBlock('extendedTitles');
$this->template->hideBlock('extendedHeaders');
} else {
$this->template->touchBlock('extendedTitles');
}
//begin language variables
$this->template->setVariable(array('TXT_ADD_NEW_LANGUAGE' => $_ARRAYLANG['TXT_ADD_NEW_LANGUAGE'], 'TXT_NAME' => $_ARRAYLANG['TXT_NAME'], 'TXT_SHORT_NAME' => $_ARRAYLANG['TXT_SHORT_NAME'], 'TXT_CHARSET' => $_ARRAYLANG['TXT_CHARSET'], 'TXT_ADD' => $_ARRAYLANG['TXT_ADD'], 'TXT_LANGUAGE_LIST' => $_ARRAYLANG['TXT_LANGUAGE_LIST'], 'TXT_ID' => $_ARRAYLANG['TXT_ID'], 'TXT_SHORT_FORM' => $_ARRAYLANG['TXT_SHORT_FORM'], 'TXT_STANDARD_LANGUAGE' => $_ARRAYLANG['TXT_STANDARD_LANGUAGE'], 'TXT_ACTION' => $_ARRAYLANG['TXT_ACTION'], 'TXT_ACCEPT_CHANGES' => $_ARRAYLANG['TXT_ACCEPT_CHANGES'], 'TXT_REMARK' => $_ARRAYLANG['TXT_REMARK'], 'TXT_ADD_DELETE_LANGUAGE_REMARK' => $_ARRAYLANG['TXT_ADD_DELETE_LANGUAGE_REMARK'], 'TXT_CONFIRM_DELETE_DATA' => $_ARRAYLANG['TXT_CONFIRM_DELETE_DATA'], 'TXT_ACTION_IS_IRREVERSIBLE' => $_ARRAYLANG['TXT_ACTION_IS_IRREVERSIBLE'], 'TXT_VALUE' => $_ARRAYLANG['TXT_VALUE'], 'TXT_MODULE' => $_ARRAYLANG['TXT_MODULE'], 'TXT_LANGUAGE' => $_ARRAYLANG['TXT_LANGUAGE'], 'TXT_STATUS' => $_ARRAYLANG['TXT_STATUS'], 'TXT_VIEW' => $_ARRAYLANG['TXT_VIEW'], 'TXT_CONTROLLED' => $_ARRAYLANG['TXT_CONTROLLED'], 'TXT_OPEN_ISSUE' => $_ARRAYLANG['TXT_OPEN_ISSUE'], 'TXT_SHORT_NAME' => $_ARRAYLANG['TXT_SHORT_NAME'], 'TXT_LANGUAGE_DEPENDANT_SYSTEM_VARIABLES' => $_ARRAYLANG['TXT_LANGUAGE_DEPENDANT_SYSTEM_VARIABLES'], 'TXT_ADMINISTRATION_PAGES' => $_ARRAYLANG['TXT_ADMINISTRATION_PAGES'], 'TXT_WEB_PAGES' => $_ARRAYLANG['TXT_WEB_PAGES'], 'TXT_SECTION' => $_ARRAYLANG['TXT_SECTION'], 'TXT_CORE_FALLBACK' => $_ARRAYLANG['TXT_CORE_FALLBACK'], 'TXT_LANGUAGE_MANAGER_OK' => $_ARRAYLANG['TXT_LANGUAGE_MANAGER_OK']));
$this->template->setGlobalVariable(array('TXT_DEFAULT_LANGUAGE' => $_ARRAYLANG['TXT_STANDARD_LANGUAGE'], 'TXT_CORE_NONE' => $_ARRAYLANG['TXT_CORE_NONE'], 'CMD' => contrexx_input2xhtml($_GET['cmd']), 'TXT_LANGUAGE_ACTION_COPY' => $_ARRAYLANG['TXT_LANGUAGE_ACTION_COPY'], 'TXT_LANGUAGE_ACTION_LINK' => $_ARRAYLANG['TXT_LANGUAGE_ACTION_LINK']));
//end language variables
if ($this->hideVariables == true) {
$this->template->setGlobalVariable(array('LANGUAGE_ADMIN_STYLE' => 'display: none'));
} else {
$this->template->setGlobalVariable(array('LANGUAGE_ADMIN_STYLE' => 'display: block'));
}
$arrLanguages = \FWLanguage::getActiveFrontendLanguages();
$this->template->setVariable('LANGUAGE_MANAGER_ACTIVE_LANGIDS', implode(', ', array_keys($arrLanguages)));
$objResult = $objDatabase->Execute("SELECT * FROM " . DBPREFIX . "languages ORDER BY id");
if ($objResult !== false) {
while (!$objResult->EOF) {
$checked = "";
if ($objResult->fields['is_default'] == "true") {
$checked = "checked";
}
$status = "<input type='radio' name='langDefaultStatus' onchange='updateCurrent();' value='" . $objResult->fields['id'] . "' {$checked} />";
$checked = "";
if ($objResult->fields['frontend'] == 1) {
$checked = "checked";
}
$activeStatus = "<input type='checkbox' name='langActiveStatus[" . $objResult->fields['id'] . "]' onchange='updateCurrent();' value='1' {$checked} />";
$checked = "";
if ($objResult->fields['backend'] == 1) {
$checked = "checked";
}
$selectedLang = '';
switch ($objResult->fields['fallback']) {
case '':
$this->template->setVariable('NONE_SELECTED', 'selected="selected"');
break;
case '0':
$this->template->setVariable('LANGUAGE_DEFAULT_SELECTED', 'selected="selected"');
break;
default:
$selectedLang = $objResult->fields['fallback'];
}
// set fallback language drop down
foreach ($arrLanguages as $langId => $arrLanguage) {
$selected = $langId == $selectedLang ? 'selected="selected"' : '';
$this->template->setVariable(array('LANGUAGE_LANG_ID' => $langId, 'LANGUAGE_LANG_OPTION' => contrexx_raw2xhtml($arrLanguage['name']), 'LANGUAGE_OPTION_SELECTED' => $selected));
$this->template->parse('fallbackLanguages');
}
$adminStatus = "<input type='checkbox' name='langAdminStatus[" . $objResult->fields['id'] . "]' value='1' {$checked} />";
$this->template->setVariable(array('LANGUAGE_ROWCLASS' => 'row' . ($i++ % 2 + 1), 'LANGUAGE_LANG_ID' => $objResult->fields['id'], 'LANGUAGE_LANG_NAME' => $objResult->fields['name'], 'LANGUAGE_LANG_SHORTNAME' => $objResult->fields['lang'], 'LANGUAGE_LANG_CHARSET' => $objResult->fields['charset'], 'LANGUAGE_LANG_STATUS' => $status, 'LANGUAGE_ACTIVE_STATUS' => $activeStatus, 'LANGUAGE_ADMIN_STATUS' => $adminStatus));
if (!$this->isInFullMode()) {
$this->template->hideBlock('extendedOptions');
}
$this->template->parse('languageRow');
$objResult->MoveNext();
}
}
}
示例14: registerTagJsCode
/**
* Register the JS code for the given input field ID
*
* @param type $newsTagId HMTL ID attribute Value of the input field
*/
public function registerTagJsCode($newsTagId = 'newsTags')
{
global $_ARRAYLANG;
$allNewsTags = $this->getTags();
$concatedTag = '';
$tagCount = 0;
foreach ($allNewsTags as $newsTag) {
++$tagCount;
$concatedTag .= '"' . contrexx_raw2xhtml(addslashes($newsTag)) . '"' . ($tagCount != count($allNewsTags) ? ',' : '');
}
$newsTagsFormated = htmlspecialchars_decode($concatedTag);
$placeholderText = $_ARRAYLANG['TXT_NEWS_ADD_TAGS'];
$jsCode = <<<EOF
\$J(document).ready(function() {
var encoded = [{$newsTagsFormated}];
var decoded = [];
\$J.each(encoded, function(key, value){
decoded.push(\$J("<div/>").html(value).text());
});
\$J("#{$newsTagId}").tagit({
fieldName: "newsTags[]",
availableTags : decoded,
placeholderText : "{$placeholderText}",
allowSpaces : true
});
});
EOF;
\JS::registerCode($jsCode);
}
示例15: renderElement
protected function renderElement($title, $level, $hasChilds, $lang, $path, $current, $page)
{
//make sure the page to render is inside our branch
if (!$this->isParentNodeInsideCurrentBranch($page->getNode())) {
return '';
}
//are we inside the layer bounds?
if (!$this->isLevelInsideLayerBound($level)) {
return '';
}
if (!$page->isVisible()) {
return '';
}
$node = $page->getNode();
reset($this->branchNodeIds);
while ($node && $node->getId() != $this->activeNode->getId()) {
if ($node->getPage(FRONTEND_LANG_ID) && !$node->getPage(FRONTEND_LANG_ID)->isVisible()) {
return '';
}
$node = $node->getParent();
}
if (!isset($this->navigationIds[$level])) {
$this->navigationIds[$level] = 0;
} else {
$this->navigationIds[$level]++;
}
$block = trim($this->template->_blocks['level']);
$output = " <li>" . $block;
//check if we need to close any <ul>'s
$this->lastLevel = $level;
$style = $current ? self::StyleNameActive : self::StyleNameNormal;
$output = str_replace('{NAME}', contrexx_raw2xhtml($title), $output);
$output = str_replace('<li>', '<li class="' . $style . '">', $output);
$output = str_replace('{URL}', \Cx\Core\Core\Controller\Cx::instanciate()->getWebsiteOffsetPath() . $this->virtualLanguageDirectory . contrexx_raw2encodedUrl($path), $output);
$linkTarget = $page->getLinkTarget();
$output = str_replace('{TARGET}', empty($linkTarget) ? '_self' : $linkTarget, $output);
$output = str_replace('{CSS_NAME}', $page->getCssNavName(), $output);
$output = str_replace('{PAGE_ID}', $page->getId(), $output);
$output = str_replace('{PAGE_NODE_ID}', $page->getNode()->getId(), $output);
$output = str_replace('{NAVIGATION_ID}', $this->navigationIds[$level], $output);
return $output;
}