本文整理汇总了PHP中iaLanguage类的典型用法代码示例。如果您正苦于以下问题:PHP iaLanguage类的具体用法?PHP iaLanguage怎么用?PHP iaLanguage使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了iaLanguage类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: _t
function _t($key = '', $default = null)
{
if (!class_exists('iaLanguage') || empty($key)) {
return false;
}
iaDebug::debug($key, 'Deprecated language phrase obtaining');
return iaLanguage::get($key, $default);
}
开发者ID:kamilklkn,项目名称:subrion,代码行数:8,代码来源:function.php
示例2: _deleteFile
private function _deleteFile($params)
{
$result = array('error' => true, 'message' => iaLanguage::get('invalid_parameters'));
$item = isset($params['item']) ? iaSanitize::sql($params['item']) : null;
$field = isset($params['field']) ? iaSanitize::sql($params['field']) : null;
$path = isset($params['path']) ? iaSanitize::sql($params['path']) : null;
$itemId = isset($params['itemid']) ? (int) $params['itemid'] : null;
if ($itemId && $item && $field && $path) {
$tableName = $this->_iaCore->factory('item')->getItemTable($item);
$itemValue = $this->_iaDb->one($field, iaDb::convertIds($itemId), $tableName);
$iaAcl = $this->_iaCore->factory('acl');
if ($iaAcl->isAdmin() && $itemValue) {
$pictures = $itemValue[1] == ':' ? unserialize($itemValue) : $itemValue;
$key = null;
if (is_array($pictures)) {
if ($primitive = !is_array($pictures[key($pictures)])) {
$pictures = array($pictures);
}
foreach ($pictures as $k => $v) {
if ($path == $v['path']) {
$key = $k;
break;
}
}
if (!is_null($key)) {
unset($pictures[$key]);
}
$newItemValue = $primitive ? '' : serialize($pictures);
} else {
// single image
$newItemValue = '';
if ($pictures == $path) {
$key = true;
}
}
if (!is_null($key)) {
if ($this->_iaCore->factory('picture')->delete($path)) {
if ($this->_iaDb->update(array($field => $newItemValue), iaDb::convertIds($itemId), null, $tableName)) {
if (iaUsers::getItemName() == $item) {
// update current profile data
if ($itemId == iaUsers::getIdentity()->id) {
iaUsers::reloadIdentity();
}
}
}
$result['error'] = false;
$result['message'] = iaLanguage::get('deleted');
} else {
$result['message'] = iaLanguage::get('error');
}
}
}
}
return $result;
}
开发者ID:TalehFarzaliey,项目名称:subrion,代码行数:55,代码来源:actions.php
示例3: getDashboardStatistics
public function getDashboardStatistics()
{
$statuses = array(iaCore::STATUS_ACTIVE, iaCore::STATUS_INACTIVE);
$rows = $this->iaDb->keyvalue('`status`, COUNT(*)', '1 GROUP BY `status`', self::getTable());
$total = 0;
foreach ($statuses as $status) {
isset($rows[$status]) || ($rows[$status] = 0);
$total += $rows[$status];
}
return array('icon' => 'quill', 'item' => iaLanguage::get('blogposts'), 'rows' => $rows, 'total' => $total, 'url' => 'blog/');
}
开发者ID:kreativmind,项目名称:subrion,代码行数:11,代码来源:ia.admin.blog.php
示例4: _launch
protected function _launch($id)
{
//$this->getHelper()->run($id);
// implemented via remote request because potentially some package's cron task
// may use front classes which will cause conflicts if executed from backend side.
// otherwise, the only call of iaCore::run() would be enough
$cronUrl = IA_CLEAR_URL . 'cron/?_t&t=' . (int) $id;
iaUtil::getPageContent($cronUrl, 300);
//
$this->_iaCore->iaView->setMessages(iaLanguage::get('scheduled_task_ran'), iaView::SUCCESS);
iaUtil::go_to($this->getPath());
}
开发者ID:rentpad,项目名称:subrion,代码行数:12,代码来源:scheduled-tasks.php
示例5: getById
/**
* Return plan information
*
* @param integer $planId plan id
*
* @return null|array
*/
public function getById($planId)
{
$plan = null;
if (!is_array($planId)) {
$plan = $this->iaDb->row_bind(iaDb::ALL_COLUMNS_SELECTION, '`status` = :status AND `id` = :id', array('status' => iaCore::STATUS_ACTIVE, 'id' => (int) $planId), self::getTable());
if ($plan) {
$plan['title'] = iaLanguage::get('plan_title_' . $plan['id']);
$plan['description'] = iaLanguage::get('plan_description_' . $plan['id']);
}
}
return $plan;
}
开发者ID:TalehFarzaliey,项目名称:subrion,代码行数:19,代码来源:ia.core.plan.php
示例6: smarty_function_ia_html_file
function smarty_function_ia_html_file($params, &$smarty)
{
$browse = iaLanguage::get('browse');
$title = iaLanguage::get('title');
$placeholder = isset($params['value']) && $params['value'] ? $params['value'] : iaLanguage::get('file_click_to_upload');
$id = isset($params['id']) ? $params['id'] : $params['name'];
$multiple = isset($params['multiple']) ? $params['multiple'] : false;
if (!$multiple) {
$result = <<<OUT
<div class="upload-group">
\t<div class="input-group file-upload">
\t\t<input type="hidden" name="v[{$params['name']}]">
\t\t<input type="file" name="{$params['name']}" id="{$id}">
\t\t<input type="text" class="disabled" placeholder="{$placeholder}" disabled>
\t\t<span class="input-group-btn">
\t\t\t<a class="btn btn-primary js-file-browse" href="#">{$browse}</a>
\t\t</span>
\t</div>
</div>
OUT;
} else {
$max_num = isset($params['max_num']) ? $params['max_num'] : 0;
$hidden = $max_num < 1 ? ' style="display: none;"' : '';
$title_html = '';
if (isset($params['title'])) {
$title_html = <<<TITLE
<div class="input-group">
\t<span class="input-group-addon">{$title}:</span>
\t<input type="text" name="{$params['name']}_title[]" class="file-title">
</div>
TITLE;
}
$result = <<<OUT
<div class="upload-group" id="upload-group-{$id}">
\t<div class="file-upload"{$hidden}>
\t\t{$title_html}
\t\t<div class="input-group">
\t\t\t<input type="file" name="{$params['name']}[]">
\t\t\t<input type="text" class="disabled" disabled="disabled" placeholder="{$placeholder}">
\t\t\t<span class="input-group-btn">
\t\t\t\t<a class="btn btn-primary js-file-browse" href="#">{$browse}</a>
\t\t\t\t<a class="btn btn-primary js-file-add" href="#"><i class="i-plus-alt"></i></a>
\t\t\t\t<a class="btn btn-primary js-file-remove" href="#"><i class="i-minus-alt"></i></a>
\t\t\t</span>
\t\t</div>
\t</div>
\t<input type="hidden" value="{$max_num}" id="{$id}">
</div>
OUT;
}
return $result;
}
开发者ID:kamilklkn,项目名称:subrion,代码行数:52,代码来源:function.ia_html_file.php
示例7: _viewPage
private function _viewPage(&$iaView, $id)
{
$item = $this->getById($id);
if (!$item) {
return iaView::errorPage(iaView::ERROR_NOT_FOUND);
}
$iaUsers = $this->_iaCore->factory('users');
$iaView->assign('item', $item);
$iaView->assign('initiator', $iaUsers->getInfo($item['member_id']));
iaBreadcrumb::toEnd(iaLanguage::get('claim_details'));
$iaView->title(iaLanguage::get('claim_details'));
$iaView->display('view');
}
开发者ID:intelliants,项目名称:subrion-plugin-claim_listing,代码行数:13,代码来源:index.php
示例8: _gridRead
protected function _gridRead($params)
{
if (isset($_POST['action'])) {
$output = array();
switch ($_POST['action']) {
case 'get':
$output['code'] = $this->_iaDb->one_bind('`code`', iaDb::convertIds((int) $_POST['id']));
break;
case 'set':
$output['result'] = (bool) $this->_iaDb->update(array('code' => $_POST['code']), iaDb::convertIds($_POST['id']));
$output['message'] = iaLanguage::get($output['result'] ? 'saved' : 'db_error');
}
return $output;
}
return parent::_gridRead($params);
}
开发者ID:nicefirework,项目名称:subrion,代码行数:16,代码来源:hooks.php
示例9: _gridRead
protected function _gridRead($params)
{
$output = array();
switch ($this->_iaCore->requestPath[0]) {
case 'get':
$output['code'] = $this->_iaDb->one_bind('`code`', iaDb::convertIds((int) $_GET['id']));
break;
case 'set':
$this->_iaDb->update(array('code' => $_POST['code']), iaDb::convertIds($_POST['id']));
$output['result'] = 0 == $this->_iaDb->getErrorNumber();
$output['message'] = iaLanguage::get($output['result'] ? 'saved' : 'db_error');
break;
default:
$output = parent::_gridRead($params);
}
return $output;
}
开发者ID:rentpad,项目名称:subrion,代码行数:17,代码来源:hooks.php
示例10: createQueue
public function createQueue($fromName, $fromMail, $subject, $body, $html, $groups, $status)
{
$error = false;
$rcptsPerRun = 15;
$messages = array();
$data = array();
$data['from_name'] = $fromName;
$data['subj'] = $subject;
$data['html'] = $html;
if (empty($fromMail) || !iaValidate::isEmail($fromMail)) {
$error = true;
$messages[] = iaLanguage::get('from_email_err');
} else {
$data['from_mail'] = $fromMail;
}
if (empty($body)) {
$error = true;
$messages[] = iaLanguage::get('err_message');
} else {
$data['body'] = $body;
}
$usergrp = empty($groups) ? 0 : array_sum($groups);
$status = empty($status) ? array() : $status;
$status = implode("','", $status);
$rcpt = $this->iaDb->onefield('email', "`usergroup_id` & {$usergrp} AND `status` IN ('{$status}')", 0, 0, 'members');
if (empty($rcpt)) {
$error = true;
$messages[] = iaLanguage::get('no_rcpt');
}
if (!$error) {
$data['total'] = count($rcpt);
$messageId = $this->iaDb->insert($data, null, self::getTableMessages());
foreach ($rcpt as $index => $addr) {
$rcptCart[] = $addr;
if (($index + 1) % $rcptsPerRun == 0 || $index + 1 == $data['total']) {
$this->iaDb->insert(array('message_id' => $messageId, 'recipients' => implode(',', $rcptCart)), null, self::getTableRecipients());
$rcptCart = array();
}
}
$messages[] = iaLanguage::get('queue_added');
}
return array($error, $messages);
}
开发者ID:intelliants,项目名称:subrion-plugin-mailer,代码行数:43,代码来源:ia.admin.mailerplugin.php
示例11: httpCheckFile
function httpCheckFile($url)
{
$curl = curl_init($url);
curl_setopt($curl, CURLOPT_NOBODY, true);
curl_setopt($curl, CURLOPT_HEADER, true);
curl_setopt($curl, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
curl_exec($curl);
$info = curl_getinfo($curl);
curl_close($curl);
if (200 !== $info['http_code']) {
return array(false, iaLanguage::getf('http_status_error', array('code' => $info['http_code'])));
} elseif (0 !== $info['redirect_count']) {
return array(false, iaLanguage::get('extra_redirects_error'));
} elseif (0 !== $info['download_content_length'] && -1 != $info['download_content_length']) {
return array(false, iaLanguage::getf('remote_file_is_not_empty', array('bytes' => $info['download_content_length'])));
} else {
return array(true, iaLanguage::get('remote_file_validation_success'));
}
}
开发者ID:intelliants,项目名称:subrion-plugin-claim_listing,代码行数:21,代码来源:index.php
示例12: getGroups
public function getGroups(array $exclusions = array())
{
$stmt = '`status` = :status AND `service` = 0';
if ($exclusions) {
$stmt .= " AND `name` NOT IN ('" . implode("','", array_map(array('iaSanitize', 'sql'), $exclusions)) . "')";
}
$this->iaDb->bind($stmt, array('status' => iaCore::STATUS_ACTIVE));
$pages = array();
$result = array();
$rows = $this->iaDb->all(array('id', 'name', 'group'), $stmt, null, null, self::getTable());
foreach ($rows as $page) {
$page['group'] || ($page['group'] = 1);
$pages[$page['group']][$page['id']] = iaLanguage::get('page_title_' . $page['name']);
}
$rows = $this->iaDb->all(array('title', 'id', 'name'), null, null, null, self::getAdminGroupsTable());
foreach ($rows as $row) {
if (isset($pages[$row['id']])) {
$result[$row['id']] = array('title' => $row['title'], 'children' => $pages[$row['id']]);
}
}
return $result;
}
开发者ID:kamilklkn,项目名称:subrion,代码行数:22,代码来源:ia.admin.page.php
示例13: gridDelete
public function gridDelete($params, $languagePhraseKey = 'deleted')
{
$result = array('result' => false, 'message' => iaLanguage::get('invalid_parameters'));
if (isset($params['id']) && is_array($params['id']) && $params['id']) {
$total = count($params['id']);
$affected = 0;
foreach ($params['id'] as $id) {
if ($this->delete($id)) {
$affected++;
}
}
if ($affected) {
$result['result'] = true;
if (1 == $total) {
$result['message'] = iaLanguage::get($languagePhraseKey);
} else {
$result['message'] = $affected == $total ? iaLanguage::getf('items_deleted', array('num' => $affected)) : iaLanguage::getf('items_deleted_of', array('num' => $affected, 'total' => $total));
}
} else {
$result['message'] = iaLanguage::get('db_error');
}
}
return $result;
}
开发者ID:rentpad,项目名称:subrion,代码行数:24,代码来源:ia.base.plugin.php
示例14: define
//##copyright##
define('INTELLI_REALM', 'manage_tiers');
$iaXp = $iaCore->factoryPackages('elitius', 'admin', 'elitius');
$id = (int) $_GET['id'];
if ((int) $_GET['delete'] > 0) {
$iaXp->deleteMultiLevel((int) $_GET['delete']);
$msg = iaLanguage::get('msg_payout_level_deleted');
}
if (isset($_POST['task'])) {
if ($_POST['task'] == 'save') {
foreach ($_POST as $key => $value) {
if (strstr($key, 'amt_')) {
$num = substr($key, 4);
$level[$num] = $value;
}
}
for ($i = 1; $i <= count($level); $i++) {
$iaXp->saveMultiLevel($i, $level[$i]);
}
$msg = iaLanguage::get('msg_changes_success_saved');
} elseif ($_POST['task'] == 'add') {
$iaXp->addMultiLevel($_POST['level'], $_POST['percent']);
$msg = iaLanguage::get('msg_new_payout_level_added');
}
}
$paylevels = $iaXp->getMultiLevels();
$max = $iaXp->getMaxMultilevel();
$max_percent = $iaXp->getMaxMultiPercent();
$iaCore->assign('paylevels', $paylevels);
$iaCore->assign('max', $max);
$iaCore->assign('max_percent', $max_percent);
开发者ID:nicefirework,项目名称:subrion-elitius,代码行数:31,代码来源:tiers.php
示例15: _gridUpdate
protected function _gridUpdate($params)
{
if (isset($params['id']) && is_array($params['id']) && 2 == count($params) && isset($params['status'])) {
$currentUserId = iaUsers::getIdentity()->id;
if (in_array($currentUserId, $params['id'])) {
$totalAdminsCount = (int) $this->_iaDb->one_bind(iaDb::STMT_COUNT_ROWS, '`usergroup_id` = :group AND `status` = :status AND `id` != :id', array('group' => iaUsers::MEMBERSHIP_ADMINISTRATOR, 'status' => iaCore::STATUS_ACTIVE, 'id' => $currentUserId));
if (0 == $totalAdminsCount && $params['status'] != iaCore::STATUS_ACTIVE) {
return array('result' => false, 'message' => iaLanguage::get('action_not_allowed_since_you_only_admin'));
}
}
}
return parent::_gridUpdate($params);
}
开发者ID:nicefirework,项目名称:subrion,代码行数:13,代码来源:members.php
示例16: array
$iaView->assign('blog_entry', $entry);
if ($iaAcl->isAccessible(iaBlog::PAGE_NAME, iaCore::ACTION_EDIT) && iaUsers::hasIdentity() && iaUsers::getIdentity()->id == $entry['member_id']) {
$pageActions[] = array('icon' => 'pencil', 'title' => iaLanguage::get('edit_blog_entry'), 'url' => $baseUrl . 'edit/' . $id . '/', 'classes' => 'btn-info');
$pageActions[] = array('icon' => 'remove', 'title' => iaLanguage::get('delete'), 'url' => $baseUrl . 'delete/' . $id . '/', 'classes' => 'btn-danger');
}
} else {
$page = empty($_GET['page']) ? 0 : (int) $_GET['page'];
$page = $page < 1 ? 1 : $page;
$pagination = array('start' => ($page - 1) * $iaCore->get('blog_number'), 'limit' => (int) $iaCore->get('blog_number'), 'template' => $baseUrl . '?page={page}');
$entries = $iaBlog->get($pagination['start'], $pagination['limit']);
$pagination['total'] = $iaDb->foundRows();
$iaView->assign('tags', $iaBlog->getAllTags());
$iaView->assign('blog_entries', $entries);
$iaView->assign('pagination', $pagination);
}
if ($iaAcl->isAccessible('blog', iaCore::ACTION_ADD)) {
$pageActions[] = array('icon' => 'plus', 'title' => iaLanguage::get('add_blog_entry'), 'url' => $baseUrl . 'add/', 'classes' => 'btn-success');
}
$pageActions[] = array('icon' => 'rss', 'title' => null, 'url' => IA_URL . 'blog.xml', 'classes' => 'btn-warning');
$iaView->set('actions', $pageActions);
}
}
if (iaView::REQUEST_XML == $iaView->getRequestType()) {
$output = array('title' => $iaCore->get('site') . ' :: ' . $iaView->title(), 'description' => '', 'url' => IA_URL . 'blog', 'item' => array());
$entries = $iaBlog->get(0, 20);
foreach ($entries as $entry) {
$output['item'][] = array('title' => $entry['title'], 'link' => $baseUrl . $entry['id'] . '-' . $entry['alias'], 'pubDate' => date('D, d M Y H:i:s T', strtotime($entry['date_modified'])), 'description' => iaSanitize::tags($entry['body']));
}
$iaView->assign('channel', $output);
}
$iaDb->resetTable();
开发者ID:UzielSilva,项目名称:subrion,代码行数:31,代码来源:index.php
示例17: getDashboardStatistics
/**
* Filling admin dashboard statistics with the financial information
*
* @return array
*/
public function getDashboardStatistics()
{
$this->iaDb->setTable(self::getTable());
$currenciesToSymbolMap = array('USD' => '$', 'EUR' => '€', 'RMB' => '¥', 'CNY' => '¥');
$currency = strtoupper($this->iaCore->get('currency'));
$currency = isset($currenciesToSymbolMap[$currency]) ? $currenciesToSymbolMap[$currency] : '';
$data = array();
$weekDay = getdate();
$weekDay = $weekDay['wday'];
$stmt = '`status` = :status AND DATE(`date`) BETWEEN DATE(DATE_SUB(NOW(), INTERVAL ' . $weekDay . ' DAY)) AND DATE(NOW()) GROUP BY DATE(`date`)';
$this->iaDb->bind($stmt, array('status' => self::PASSED));
$rows = $this->iaDb->keyvalue('DAYOFWEEK(DATE(`date`)), SUM(`amount`)', $stmt);
for ($i = 0; $i < 7; $i++) {
$data[$i] = isset($rows[$i]) ? $rows[$i] : 0;
}
$statuses = array(self::PASSED, self::PENDING, self::REFUNDED, self::FAILED);
$rows = $this->iaDb->keyvalue('`status`, COUNT(*)', '1 GROUP BY `status`');
foreach ($statuses as $status) {
isset($rows[$status]) || ($rows[$status] = 0);
}
$total = $this->iaDb->one_bind('ROUND(SUM(`amount`)) `total`', '`status` = :status', array('status' => self::PASSED));
$total || ($total = 0);
$this->iaDb->resetTable();
return array('_format' => 'medium', 'data' => array('array' => implode(',', $data)), 'icon' => 'banknote', 'item' => iaLanguage::get('total_income'), 'rows' => $rows, 'total' => $currency . $total, 'url' => 'transactions/');
}
开发者ID:bohmszi,项目名称:kdbe_cms,代码行数:30,代码来源:ia.core.transaction.php
示例18: _importDump
private static function _importDump(&$iaDb)
{
$filename = $_FILES ? $_FILES['language_file']['tmp_name'] : $_POST['language_file2'];
$format = isset($_POST['format']) && in_array($_POST['format'], array('csv', 'sql')) ? $_POST['format'] : 'sql';
$error = false;
$messages = array();
if (empty($filename)) {
$error = true;
$messages[] = iaLanguage::get('choose_import_file');
} elseif (!($f = fopen($filename, 'r'))) {
$error = true;
$messages[] = iaLanguage::getf('cant_open_sql', array('filename' => $filename));
}
if ($format == 'csv' && isset($_POST['title']) && trim($_POST['title']) == '') {
$error = true;
$messages[] = iaLanguage::get('title_is_empty');
}
if (!$error) {
$error = true;
$languageCode = '';
if ('sql' == $format) {
$sql = '';
while ($s = fgets($f, 10240)) {
$s = trim($s);
if ($s[0] == '#' || $s[0] == '') {
continue;
}
$sql .= $s;
if ($s[strlen($s) - 1] != ';') {
continue;
}
$sql = str_replace('{prefix}', $iaDb->prefix, $sql);
$iaDb->query($sql);
if (empty($languageCode)) {
$matches = array();
if (preg_match('#, \'([a-z]{2})\', \'#', $sql, $matches) || preg_match('#,\'([a-z]{2})\',\'#', $sql, $matches)) {
$languageCode = $matches[1];
}
}
$sql = '';
}
fclose($f);
$error = false;
}
if ('csv' == $format) {
if ($csvContent = file($filename)) {
$array = array();
foreach ($csvContent as $i => $row) {
if (empty($row)) {
break;
}
$fields = explode('|', trim($row));
if (count($fields) != 6) {
break;
}
$fields = array_map(array('iaSanitize', 'sql'), $fields);
$languageCode = isset($fields[4]) ? $fields[4] : null;
$array[] = "('" . implode("','", $fields) . "')";
}
if (count($fields) == 6 && strlen($languageCode) == 2) {
$error = false;
$sql = "INSERT INTO `{$iaDb->prefix}language` (`key`, `original`, `value`, `category`, `code`, `extras`) VALUES ";
$sql .= implode(',', $array);
$sql .= ';';
$iaDb->query($sql);
}
}
}
$messages[] = iaLanguage::get($error ? 'incorrect_file_format' : 'saved');
}
return array(!$error, $messages, isset($languageCode) ? $languageCode : null);
}
开发者ID:kamilklkn,项目名称:subrion,代码行数:72,代码来源:languages.php
示例19: switch
$url = $iaCore->get('members_autoapproval') ? IA_URL . 'login/' : IA_URL;
iaUtil::redirect(iaLanguage::get('reg_confirmation'), $messages, $url);
} else {
$messages[] = iaLanguage::get('confirmation_key_incorrect');
}
$iaView->assign('success', !$error);
}
}
switch ($iaView->name()) {
case 'member_password_forgot':
$template = 'forgot';
break;
case 'register_confirm':
$template = 'registration-confirmation';
break;
default:
if ($memberId) {
$error = false;
$template = 'registration-confirmation';
$messages[] = iaLanguage::get('member_created');
$iaView->assign('email', $itemData['email']);
} else {
$error = true;
$template = 'registration';
$iaView->assign('tmp', $itemData);
}
}
$iaView->setMessages($messages, $error ? iaView::ERROR : iaView::SUCCESS);
$iaView->display($template);
}
$iaDb->resetTable();
开发者ID:TalehFarzaliey,项目名称:subrion,代码行数:31,代码来源:registration.php
示例20: _createJsFile
protected function _createJsFile($file, $type = 'config')
{
$this->iaCore->factory('util');
// required in order the class iaUtil to be loaded
$iaDb =& $this->iaCore->iaDb;
switch ($type) {
case 'lang':
case 'admin_lang':
// get phrases
$stmt = "`code` = :lang AND `category` NOT IN ('tooltip', 'page', :category)";
$iaDb->bind($stmt, array('lang' => $this->iaCore->iaView->language, 'category' => $type == 'admin_lang' ? 'frontend' : iaCore::ADMIN));
$phrases = $iaDb->keyvalue(array('key', 'value'), $stmt, iaLanguage::getTable());
// get list of languages
$languagesList = $iaDb->assoc(array('code', 'title', 'direction', 'flagicon', 'iso' => 'code'), 'admin_lang' == $type ? null : "`status` = 'active'", 'languages');
$fileContent = 'intelli.' . ('admin_lang' == $type ? 'admin.' : '') . 'lang = ' . iaUtil::jsonEncode($phrases) . ';' . 'intelli.languages = ' . iaUtil::jsonEncode($languagesList) . ';';
break;
case 'config':
$stmt = "`private` = 0 && `type` != 'divider' && `config_group` != 'email_templates'";
$config = $iaDb->keyvalue(array('name', 'value'), $stmt, iaCore::getConfigTable());
if (file_exists(IA_INCLUDES . 'custom.inc.php')) {
include IA_INCLUDES . 'custom.inc.php';
}
$config['ia_url'] = IA_CLEAR_URL;
$config['packages'] = $this->iaCore->setPackagesData();
$config['items'] = array();
$config['extras'] = array(array('core', iaLanguage::get('core', 'Core')));
$array = $iaDb->all(array('name', 'title'), "`status` = 'active' ORDER BY `type`", null, null, 'extras');
foreach ($array as $item) {
$config['extras'][] = array($item['name'], $item['title']);
}
$array = $iaDb->onefield('`item`', "`item` != 'transactions'", null, null, 'items');
foreach ($array as $item) {
$config['items'][] = array($item, iaLanguage::get($item, $item));
}
$fileContent = 'intelli.config = ' . iaUtil::jsonEncode($config) . ';';
}
if (isset($fileContent)) {
if ($fh = fopen($file, 'w')) {
fwrite($fh, $fileContent);
fclose($fh);
}
}
}
开发者ID:rentpad,项目名称:subrion,代码行数:43,代码来源:ia.core.cache.php
注:本文中的iaLanguage类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论