本文整理汇总了PHP中erLhcoreClassTemplate类的典型用法代码示例。如果您正苦于以下问题:PHP erLhcoreClassTemplate类的具体用法?PHP erLhcoreClassTemplate怎么用?PHP erLhcoreClassTemplate使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了erLhcoreClassTemplate类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getOutArray
public static function getOutArray()
{
if (self::$outArray == null) {
$tpl = new erLhcoreClassTemplate();
$smileys = explode('||', $tpl->fetch('lhbbcode/smiley.tpl.php'));
self::$outArray = $smileys;
}
return self::$outArray;
}
示例2: validateSendMail
public static function validateSendMail(erLhAbstractModelEmailTemplate &$sendMail, &$chat, $params = array())
{
$Errors = array();
$validationFields = array();
$validationFields['Message'] = new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'unsafe_raw');
$validationFields['Subject'] = new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'unsafe_raw');
$validationFields['FromName'] = new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'unsafe_raw');
$validationFields['FromEmail'] = new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'validate_email');
$validationFields['ReplyEmail'] = new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'validate_email');
$validationFields['RecipientEmail'] = new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'validate_email');
$form = new ezcInputForm(INPUT_POST, $validationFields);
$Errors = array();
if (isset($params['archive_mode']) && $params['archive_mode'] == true) {
$messages = array_reverse(erLhcoreClassChat::getList(array('limit' => 100, 'sort' => 'id DESC', 'filter' => array('chat_id' => $chat->id)), 'erLhcoreClassModelChatArchiveMsg', erLhcoreClassModelChatArchiveRange::$archiveMsgTable));
} else {
$messages = array_reverse(erLhcoreClassModelmsg::getList(array('limit' => 100, 'sort' => 'id DESC', 'filter' => array('chat_id' => $chat->id))));
}
// Fetch chat messages
$tpl = new erLhcoreClassTemplate('lhchat/messagelist/plain.tpl.php');
$tpl->set('chat', $chat);
$tpl->set('messages', $messages);
$sendMail->content = str_replace(array('{user_chat_nick}', '{messages_content}'), array($chat->nick, $tpl->fetch()), $sendMail->content);
if ($form->hasValidData('Message')) {
$sendMail->content = str_replace('{additional_message}', $form->Message, $sendMail->content);
}
$sendMail->content = erLhcoreClassBBCode::parseForMail($sendMail->content);
if ($form->hasValidData('FromEmail')) {
$sendMail->from_email = $form->FromEmail;
}
if ($form->hasValidData('ReplyEmail')) {
$sendMail->reply_to = $form->ReplyEmail;
}
if ($form->hasValidData('FromName')) {
$sendMail->from_name = $form->FromName;
}
if ($form->hasValidData('Subject')) {
$sendMail->subject = $form->Subject;
}
if ($form->hasValidData('RecipientEmail')) {
$sendMail->recipient = $form->RecipientEmail;
} else {
$Errors[] = erTranslationClassLhTranslation::getInstance()->getTranslation('chat/sendmail', 'Please enter recipient e-mail!');
}
if (empty($sendMail->from_email)) {
$Errors[] = erTranslationClassLhTranslation::getInstance()->getTranslation('chat/sendmail', 'From e-mail is missing!');
}
if (empty($sendMail->reply_to)) {
$Errors[] = erTranslationClassLhTranslation::getInstance()->getTranslation('chat/sendmail', 'Reply e-mail is missing!');
}
if (empty($sendMail->subject)) {
$Errors[] = erTranslationClassLhTranslation::getInstance()->getTranslation('chat/sendmail', 'Subject is missing!');
}
return $Errors;
}
示例3: header
<?php
header('P3P:CP="IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT"');
header('Content-type: text/javascript');
header('Expires: Sat, 26 Jul 1997 05:00:00 GMT');
header('Last-Modified: ' . gmdate('D, d M Y H:i:s', time() + 60 * 60 * 8) . ' GMT');
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Cache-Control: post-check=0, pre-check=0', false);
header('Pragma: no-cache');
$tpl = erLhcoreClassTemplate::getInstance('lhchat/chatcheckstatus.tpl.php');
if (is_array($Params['user_parameters_unordered']['department'])) {
erLhcoreClassChat::validateFilterIn($Params['user_parameters_unordered']['department']);
$tpl->set('department', implode('/', $Params['user_parameters_unordered']['department']));
$tpl->set('department_array', $Params['user_parameters_unordered']['department']);
} else {
$tpl->set('department', false);
$tpl->set('department_array', false);
}
$tpl->set('status', $Params['user_parameters_unordered']['status'] == 'true' ? true : false);
if (erLhcoreClassModelChatConfig::fetch('track_is_online')->current_value) {
$ignorable_ip = erLhcoreClassModelChatConfig::fetch('ignorable_ip')->current_value;
if ($ignorable_ip == '' || !erLhcoreClassIPDetect::isIgnored(erLhcoreClassIPDetect::getIP(), explode(',', $ignorable_ip))) {
if ((string) $Params['user_parameters_unordered']['vid'] != '') {
$db = ezcDbInstance::get();
/**
* Perhaps there is some pending operations for online visitor
* */
$stmt = $db->prepare('SELECT operation FROM lh_chat_online_user WHERE vid = :vid');
$stmt->bindValue(':vid', (string) $Params['user_parameters_unordered']['vid']);
$stmt->execute();
$operation = $stmt->fetch(PDO::FETCH_COLUMN);
示例4: array
<?php
$tpl = erLhcoreClassTemplate::getInstance('lhdocshare/configuration.tpl.php');
$docSharer = erLhcoreClassModelChatConfig::fetch('doc_sharer');
$data = (array) $docSharer->data;
if (isset($_POST['StoreConfiguration'])) {
$definition = array('LibreOfficePath' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'string'), 'SupportedExtensions' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'string'), 'PdftoppmPath' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'string'), 'HttpUserName' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'string'), 'HttpGroupName' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'string'), 'BackgroundProcess' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'boolean'), 'MaxFileSize' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'int', array('min_range' => 2)), 'PdftoppmLimit' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'int', array('min_range' => 0)));
$Errors = array();
$form = new ezcInputForm(INPUT_POST, $definition);
$Errors = array();
if (!isset($_POST['csfr_token']) || !$currentUser->validateCSFRToken($_POST['csfr_token'])) {
erLhcoreClassModule::redirect('docshare/configuration');
exit;
}
if ($form->hasValidData('LibreOfficePath')) {
$data['libre_office_path'] = $form->LibreOfficePath;
} else {
$data['libre_office_path'] = '/usr/bin/libreoffice';
}
if ($form->hasValidData('PdftoppmPath')) {
$data['pdftoppm_path'] = $form->PdftoppmPath;
} else {
$data['pdftoppm_path'] = '/usr/bin/pdftoppm';
}
if ($form->hasValidData('PdftoppmLimit')) {
$data['pdftoppm_limit'] = $form->PdftoppmLimit;
} else {
$data['pdftoppm_limit'] = '0';
}
if ($form->hasValidData('HttpUserName')) {
$data['http_user_name'] = $form->HttpUserName;
示例5: lhPaginator
<?php
try {
$tpl = erLhcoreClassTemplate::getInstance('lhinstance/invoices.tpl.php');
$pages = new lhPaginator();
$pages->items_total = erLhcoreClassModelInstanceInvoice::getCount();
$pages->translationContext = 'abstract/list';
$pages->serverURL = erLhcoreClassDesign::baseurl('instance/invoices');
$pages->setItemsPerPage(20);
$pages->paginate();
$tpl->set('pages', $pages);
$items = array();
if ($pages->items_total > 0) {
$items = erLhcoreClassModelInstanceInvoice::getList(array('offset' => $pages->low, 'limit' => $pages->items_per_page));
}
$tpl->set('items', $items);
$tpl->set('pages', $pages);
$Result['content'] = $tpl->fetch();
$Result['path'] = array(array('url' => erLhcoreClassDesign::baseurl('system/configuration'), 'title' => erTranslationClassLhTranslation::getInstance()->getTranslation('system/htmlcode', 'System configuration')), array('title' => erTranslationClassLhTranslation::getInstance()->getTranslation('instance/edit', 'Invoices')));
} catch (Exception $e) {
print_r($e);
}
示例6: array
<?php
$tpl = erLhcoreClassTemplate::getInstance('lhtheme/import.tpl.php');
if (ezcInputForm::hasPostData()) {
if (!isset($_POST['csfr_token']) || !$currentUser->validateCSFRToken($_POST['csfr_token'])) {
erLhcoreClassModule::redirect('theme/import');
exit;
}
if (erLhcoreClassSearchHandler::isFile('themefile', array('json'))) {
$dir = 'var/tmpfiles/';
erLhcoreClassChatEventDispatcher::getInstance()->dispatch('theme.temppath', array('dir' => &$dir));
erLhcoreClassFileUpload::mkdirRecursive($dir);
$filename = erLhcoreClassSearchHandler::moveUploadedFile('themefile', $dir);
$content = file_get_contents($dir . $filename);
unlink($dir . $filename);
$data = json_decode($content);
if ($data !== null) {
$widgetTheme = new erLhAbstractModelWidgetTheme();
$data = (array) $data;
$imgData = array();
if (isset($data['logo_image_data'])) {
$imgData['logo_image'] = $data['logo_image_data'];
unset($data['logo_image_data']);
}
if (isset($data['need_help_image_data'])) {
$imgData['need_help_image'] = $data['need_help_image_data'];
unset($data['need_help_image_data']);
}
if (isset($data['online_image_data'])) {
$imgData['online_image'] = $data['online_image_data'];
unset($data['online_image_data']);
示例7: lhPaginator
<?php
$tpl = erLhcoreClassTemplate::getInstance('lhchatarchive/listarchivechats.tpl.php');
$archive = erLhcoreClassModelChatArchiveRange::fetch($Params['user_parameters']['id']);
if (isset($_GET['doSearch'])) {
$filterParams = erLhcoreClassSearchHandler::getParams(array('module' => 'chat', 'module_file' => 'chat_search', 'format_filter' => true, 'use_override' => true, 'uparams' => $Params['user_parameters_unordered']));
$filterParams['is_search'] = true;
} else {
$filterParams = erLhcoreClassSearchHandler::getParams(array('module' => 'chat', 'module_file' => 'chat_search', 'format_filter' => true, 'uparams' => $Params['user_parameters_unordered']));
$filterParams['is_search'] = false;
}
$append = erLhcoreClassSearchHandler::getURLAppendFromInput($filterParams['input_form']);
// Set correct archive tables
$archive->setArchiveTables();
$pages = new lhPaginator();
$pages->serverURL = erLhcoreClassDesign::baseurl('chatarchive/listarchivechats') . '/' . $archive->id . $append;
$pages->items_total = erLhcoreClassChat::getCount($filterParams['filter'], erLhcoreClassModelChatArchiveRange::$archiveTable);
$pages->setItemsPerPage(2);
$pages->paginate();
$items = array();
if ($pages->items_total > 0) {
try {
$items = erLhcoreClassChat::getList(array_merge(array('offset' => $pages->low, 'limit' => $pages->items_per_page, 'sort' => 'id ASC'), $filterParams['filter']), 'erLhcoreClassModelChatArchive', erLhcoreClassModelChatArchiveRange::$archiveTable);
} catch (Exception $e) {
print_r($e->getMessage());
}
}
$filterParams['input_form']->form_action = erLhcoreClassDesign::baseurl('chatarchive/listarchivechats') . '/' . $archive->id;
$tpl->set('input', $filterParams['input_form']);
$tpl->set('items', $items);
$tpl->set('archive', $archive);
示例8: array
<?php
$tpl = erLhcoreClassTemplate::getInstance('lhsystem/smtp.tpl.php');
$smtpData = erLhcoreClassModelChatConfig::fetch('smtp_data');
$data = (array) $smtpData->data;
if (isset($_POST['StoreSMTPSettings']) || isset($_POST['StoreSMTPSettingsTest'])) {
$definition = array('host' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'unsafe_raw'), 'username' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'unsafe_raw'), 'password' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'unsafe_raw'), 'port' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'unsafe_raw'), 'use_smtp' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'boolean'));
if (!isset($_POST['csfr_token']) || !$currentUser->validateCSFRToken($_POST['csfr_token'])) {
erLhcoreClassModule::redirect('system/smtp');
exit;
}
$Errors = array();
$form = new ezcInputForm(INPUT_POST, $definition);
$Errors = array();
if ($form->hasValidData('host')) {
$data['host'] = $form->host;
} else {
$data['host'] = '';
}
if ($form->hasValidData('port')) {
$data['port'] = $form->port;
} else {
$data['port'] = '';
}
if ($form->hasValidData('use_smtp') && $form->use_smtp == true) {
$data['use_smtp'] = 1;
} else {
$data['use_smtp'] = 0;
}
if ($form->hasValidData('username')) {
$data['username'] = $form->username;
示例9: array
<?php
$tpl = erLhcoreClassTemplate::getInstance('lhuser/autologinconfig.tpl.php');
$autologinData = erLhcoreClassModelChatConfig::fetch('autologin_data');
$data = (array) $autologinData->data;
if (isset($_POST['StoreAutologinSettings'])) {
$definition = array('secret_hash' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'unsafe_raw'), 'enabled' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'boolean'));
if (!isset($_POST['csfr_token']) || !$currentUser->validateCSFRToken($_POST['csfr_token'])) {
erLhcoreClassModule::redirect('user/autologinconfig');
exit;
}
$Errors = array();
$form = new ezcInputForm(INPUT_POST, $definition);
$Errors = array();
try {
if ($form->hasValidData('secret_hash') && strlen($form->secret_hash) >= 10) {
$data['secret_hash'] = $form->secret_hash;
} else {
throw new Exception('Please enter secret hash');
}
if ($form->hasValidData('enabled') && $form->enabled == true) {
$data['enabled'] = 1;
} else {
$data['enabled'] = 0;
}
$autologinData->value = serialize($data);
$autologinData->saveThis();
$CacheManager = erConfigClassLhCacheConfig::getInstance();
$CacheManager->expireCache();
$tpl->set('updated', 'done');
} catch (Exception $e) {
示例10: json_encode
<?php
try {
$chat = erLhcoreClassChat::getSession()->load('erLhcoreClassModelChat', $Params['user_parameters']['chat_id']);
if ($chat->hash == $Params['user_parameters']['hash']) {
$msg = erLhcoreClassModelmsg::fetch($Params['user_parameters']['msgid']);
if ($msg->chat_id == $chat->id) {
$tpl = erLhcoreClassTemplate::getInstance('lhchat/syncuser.tpl.php');
$tpl->set('messages', array((array) $msg));
$tpl->set('chat', $chat);
$tpl->set('sync_mode', isset($Params['user_parameters_unordered']['mode']) ? $Params['user_parameters_unordered']['mode'] : '');
echo json_encode(array('msg' => $tpl->fetch(), 'error' => 'f'));
exit;
}
}
} catch (Exception $e) {
}
echo json_encode(array('error' => 't'));
exit;
示例11: lhPaginator
<?php
$tpl = erLhcoreClassTemplate::getInstance('lhchat/operatorschats.tpl.php');
if (isset($_GET['doSearch'])) {
$filterParams = erLhcoreClassSearchHandler::getParams(array('module' => 'chat', 'module_file' => 'chat_search', 'format_filter' => true, 'use_override' => true, 'uparams' => $Params['user_parameters_unordered']));
$filterParams['is_search'] = true;
} else {
$filterParams = erLhcoreClassSearchHandler::getParams(array('module' => 'chat', 'module_file' => 'chat_search', 'format_filter' => true, 'uparams' => $Params['user_parameters_unordered']));
$filterParams['is_search'] = false;
}
if ($Params['user_parameters_unordered']['print'] == 1) {
$tpl = erLhcoreClassTemplate::getInstance('lhchat/printchats.tpl.php');
$items = erLhcoreClassChat::getOperatorsChats(10000, 0, $filterParams['filter']);
$tpl->set('items', $items);
$Result['content'] = $tpl->fetch();
$Result['pagelayout'] = 'popup';
return;
}
if ($Params['user_parameters_unordered']['xls'] == 1) {
erLhcoreClassChatExport::chatListExportXLS(erLhcoreClassChat::getOperatorsChats(10000, 0, $filterParams['filter']));
exit;
}
$append = erLhcoreClassSearchHandler::getURLAppendFromInput($filterParams['input_form']);
$pages = new lhPaginator();
$pages->items_total = erLhcoreClassChat::getOperatorsChatsCount($filterParams['filter']);
$pages->translationContext = 'chat/closedchats';
$pages->serverURL = erLhcoreClassDesign::baseurl('chat/operatorschats') . $append;
$pages->paginate();
$tpl->set('pages', $pages);
if ($pages->items_total > 0) {
$items = erLhcoreClassChat::getOperatorsChats($pages->items_per_page, $pages->low, $filterParams['filter']);
示例12: fetch
//.........这里部分代码省略.........
}
// Compile override config settings
$Matches = array();
preg_match_all('/erConfigClassLhConfig::getInstance\\(\\)->getOverrideValue\\((\\s?)\'([a-zA-Z0-9-\\.-\\/\\_]+)\'(\\s?),(\\s?)\'([a-zA-Z0-9-\\.-\\/\\_]+)\'(\\s?)\\)/i', $contentFile, $Matches);
foreach ($Matches[1] as $key => $UrlAddress) {
$valueConfig = erConfigClassLhConfig::getInstance()->getOverrideValue($Matches[2][$key], $Matches[5][$key]);
$valueReplace = '';
if (is_bool($valueConfig)) {
$valueReplace = $valueConfig == false ? 'false' : 'true';
} elseif (is_integer($valueConfig)) {
$valueReplace = $valueConfig;
} elseif (is_array($valueConfig)) {
$valueReplace = var_export($valueConfig, true);
} else {
$valueReplace = '\'' . $valueConfig . '\'';
}
$contentFile = str_replace($Matches[0][$key], $valueReplace, $contentFile);
}
$Matches = array();
preg_match_all('/<\\?php echo erConfigClassLhConfig::getInstance\\(\\)->getDirLanguage\\((\\s?)\'([a-zA-Z0-9-\\.-\\/\\_]+)\'(\\s?)\\)(.*?)\\?\\>/i', $contentFile, $Matches);
foreach ($Matches[1] as $key => $UrlAddress) {
$valueConfig = erConfigClassLhConfig::getInstance()->getDirLanguage($Matches[2][$key]);
$valueReplace = '';
if (is_bool($valueConfig)) {
$valueReplace = $valueConfig == false ? 'false' : 'true';
} elseif (is_integer($valueConfig)) {
$valueReplace = $valueConfig;
} elseif (is_array($valueConfig)) {
$valueReplace = var_export($valueConfig, true);
} else {
$valueReplace = $valueConfig;
}
$contentFile = str_replace($Matches[0][$key], $valueReplace, $contentFile);
}
// Compile config settings
$Matches = array();
preg_match_all('/erConfigClassLhConfig::getInstance\\(\\)->getDirLanguage\\((\\s?)\'([a-zA-Z0-9-\\.-\\/\\_]+)\'(\\s?)\\)/i', $contentFile, $Matches);
foreach ($Matches[1] as $key => $var) {
$valueConfig = erConfigClassLhConfig::getInstance()->getDirLanguage($Matches[2][$key]);
$valueReplace = '';
if (is_bool($valueConfig)) {
$valueReplace = $valueConfig == false ? 'false' : 'true';
} elseif (is_integer($valueConfig)) {
$valueReplace = $valueConfig;
} elseif (is_array($valueConfig)) {
$valueReplace = var_export($valueConfig, true);
} else {
$valueReplace = '\'' . $valueConfig . '\'';
}
$contentFile = str_replace($Matches[0][$key], $valueReplace, $contentFile);
}
if ($this->cacheDbVariables == true) {
// Compile config completely
$Matches = array();
preg_match_all('/<\\?php echo erLhcoreClassModelChatConfig::fetch\\((\\s?)\'([a-zA-Z0-9-\\.-\\/\\_]+)\'(\\s?)\\)->current_value(.*?)\\?\\>/i', $contentFile, $Matches);
foreach ($Matches[1] as $key => $UrlAddress) {
$valueConfig = erLhcoreClassModelChatConfig::fetch($Matches[2][$key])->current_value;
$contentFile = str_replace($Matches[0][$key], $valueConfig, $contentFile);
}
// Compile config settings in php scripts
$Matches = array();
preg_match_all('/erLhcoreClassModelChatConfig::fetch\\((\\s?)\'([a-zA-Z0-9-\\.-\\/\\_]+)\'(\\s?)\\)->current_value/i', $contentFile, $Matches);
foreach ($Matches[1] as $key => $UrlAddress) {
$valueConfig = erLhcoreClassModelChatConfig::fetch($Matches[2][$key])->current_value;
$valueReplace = '';
$valueReplace = '\'' . str_replace("'", "\\'", $valueConfig) . '\'';
$contentFile = str_replace($Matches[0][$key], $valueReplace, $contentFile);
}
// Compile config settings in php scripts
$Matches = array();
preg_match_all('/erLhcoreClassModelChatConfig::fetch\\((\\s?)\'([a-zA-Z0-9-\\.-\\/\\_]+)\'(\\s?)\\)->data_value/i', $contentFile, $Matches);
foreach ($Matches[1] as $key => $UrlAddress) {
$valueConfig = erLhcoreClassModelChatConfig::fetch($Matches[2][$key])->data_value;
$valueReplace = var_export($valueConfig, true);
$contentFile = str_replace($Matches[0][$key], $valueReplace, $contentFile);
}
// Compile config settings array
$Matches = array();
preg_match_all('/erLhcoreClassModelChatConfig::fetch\\((\\s?)\'([a-zA-Z0-9-\\.-\\/\\_]+)\'(\\s?)\\)->data\\[\'([a-zA-Z0-9-\\.-\\/\\_]+)\'\\]/i', $contentFile, $Matches);
foreach ($Matches[1] as $key => $UrlAddress) {
$valueConfig = erLhcoreClassModelChatConfig::fetch($Matches[2][$key])->data[$Matches[4][$key]];
$valueReplace = '';
$valueReplace = '\'' . str_replace("'", "\\'", $valueConfig) . '\'';
$contentFile = str_replace($Matches[0][$key], $valueReplace, $contentFile);
}
}
// Compile content language
$contentFile = str_replace('<?php echo erLhcoreClassSystem::instance()->ContentLanguage?>', erLhcoreClassSystem::instance()->ContentLanguage, $contentFile);
// Compile siteaccess
$contentFile = str_replace('erLhcoreClassSystem::instance()->SiteAccess', '\'' . erLhcoreClassSystem::instance()->SiteAccess . '\'', $contentFile);
// Atomoc template compilation to avoid concurent request compiling and writing to the same file
$fileName = 'cache/compiledtemplates/' . md5(time() . rand(0, 1000) . microtime() . $file . $instance->WWWDirLang . $instance->Language . $port) . '.php';
file_put_contents($fileName, erLhcoreClassTemplate::strip_html($contentFile));
$file = 'cache/compiledtemplates/' . md5($file . $instance->WWWDirLang . $instance->Language . $port) . '.php';
rename($fileName, $file);
$this->cacheTemplates[md5($fileTemplate . $instance->WWWDirLang . $instance->Language . $port)] = $file;
$this->storeCache();
}
return $this->fetchExecute($file);
}
示例13: erLhAbstractModelAdminTheme
<?php
$tpl = erLhcoreClassTemplate::getInstance('lhtheme/adminnewtheme.tpl.php');
$form = new erLhAbstractModelAdminTheme();
if (ezcInputForm::hasPostData()) {
$Errors = erLhcoreClassThemeValidator::validateAdminTheme($form);
if (!empty($Errors)) {
$tpl->set('errors', $Errors);
} else {
$form->saveThis();
erLhcoreClassModule::redirect('theme/adminthemes');
exit;
}
}
$tpl->set('form', $form);
$Result['content'] = $tpl->fetch();
$Result['additional_footer_js'] = '<script src="' . erLhcoreClassDesign::designJS('js/admintheme.form.angular.js') . '"></script>';
$Result['path'] = array(array('url' => erLhcoreClassDesign::baseurl('theme/index'), 'title' => erTranslationClassLhTranslation::getInstance()->getTranslation('theme/index', 'Themes')), array('url' => erLhcoreClassDesign::baseurl('theme/adminthemes'), 'title' => erTranslationClassLhTranslation::getInstance()->getTranslation('lhtheme/admin', 'Admin themes')), array('title' => erTranslationClassLhTranslation::getInstance()->getTranslation('lhtheme/admin', 'New admin theme')));
示例14: json_encode
<?php
if (!isset($_SERVER['HTTP_X_CSRFTOKEN']) || !$currentUser->validateCSFRToken($_SERVER['HTTP_X_CSRFTOKEN'])) {
echo json_encode(array('error' => 'true', 'result' => 'Invalid CSRF Token'));
exit;
}
$definition = array('data' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::REQUIRED, 'unsafe_raw'));
$form = new ezcInputForm(INPUT_POST, $definition);
$Chat = erLhcoreClassChat::getSession()->load('erLhcoreClassModelChat', $Params['user_parameters']['chat_id']);
$errorTpl = erLhcoreClassTemplate::getInstance('lhkernel/validation_error.tpl.php');
if (erLhcoreClassChat::hasAccessToRead($Chat)) {
if ($form->hasValidData('data')) {
$errors = array();
erLhcoreClassChatEventDispatcher::getInstance()->dispatch('chat.before_save_remarks', array('chat' => &$Chat, 'errors' => &$errors));
if (empty($errors)) {
$Chat->remarks = $form->data;
$Chat->saveThis();
echo json_encode(array('error' => 'false'));
exit;
} else {
$errorTpl->set('errors', $errors);
echo json_encode(array('error' => 'true', 'result' => $errorTpl->fetch()));
exit;
}
} else {
$errorTpl->set('errors', array(erTranslationClassLhTranslation::getInstance()->getTranslation('chat/adminchat', 'Form data not valid')));
echo json_encode(array('error' => 'true', 'result' => $errorTpl->fetch()));
exit;
}
} else {
$errorTpl->set('errors', array(erTranslationClassLhTranslation::getInstance()->getTranslation('chat/adminchat', 'Has no access to this chat')));
示例15: array
<?php
$response = erLhcoreClassChatEventDispatcher::getInstance()->dispatch('form.index', array());
$tpl = erLhcoreClassTemplate::getInstance('lhform/index.tpl.php');
$Result['content'] = $tpl->fetch();
$Result['path'] = array(array('title' => erTranslationClassLhTranslation::getInstance()->getTranslation('form/index', 'Form')));