本文整理汇总了PHP中iaLanguage类的典型用法代码示例。如果您正苦于以下问题:PHP iaLanguage类的具体用法?PHP iaLanguage怎么用?PHP iaLanguage使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了iaLanguage类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
示例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;
}
示例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/');
}
示例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());
}
示例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;
}
示例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;
}
示例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');
}
示例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);
}
示例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;
}
示例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);
}
示例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'));
}
}
示例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;
}
示例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;
}
示例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);
示例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);
}