本文整理汇总了PHP中iaLanguage::getf方法的典型用法代码示例。如果您正苦于以下问题:PHP iaLanguage::getf方法的具体用法?PHP iaLanguage::getf怎么用?PHP iaLanguage::getf使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类iaLanguage
的用法示例。
在下文中一共展示了iaLanguage::getf方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _preSaveEntry
protected function _preSaveEntry(array &$entry, array $data, $action)
{
$iaAcl = $this->_iaCore->factory('acl');
iaUtil::loadUTF8Functions('ascii', 'validation', 'bad', 'utf8_to_ascii');
$entry['id'] = $iaAcl->obtainFreeId();
$entry['assignable'] = $data['visible'];
$entry['visible'] = $data['visible'];
if (iaCore::ACTION_ADD == $action) {
if (empty($data['name'])) {
$this->addMessage('error_usergroup_incorrect');
} else {
$entry['name'] = strtolower(iaSanitize::paranoid($data['name']));
if (!iaValidate::isAlphaNumericValid($entry['name'])) {
$this->addMessage('error_usergroup_incorrect');
} elseif ($this->_iaDb->exists('`name` = :name', array('name' => $entry['name']))) {
$this->addMessage('error_usergroup_exists');
}
}
}
foreach ($this->_iaCore->languages as $iso => $title) {
if (empty($data['title'][$iso])) {
$this->addMessage(iaLanguage::getf('error_lang_title', array('lang' => $this->_iaCore->languages[$iso])), false);
} elseif (!utf8_is_valid($data['title'][$iso])) {
$data['title'][$iso] = utf8_bad_replace($data['title'][$iso]);
}
}
if (!$this->getMessages()) {
foreach ($this->_iaCore->languages as $iso => $title) {
iaLanguage::addPhrase('usergroup_' . $entry['name'], $data['title'][$iso], $iso);
}
}
return !$this->getMessages();
}
示例2: lang
public static function lang($params)
{
$key = isset($params['key']) ? $params['key'] : '';
$default = isset($params['default']) ? $params['default'] : null;
if (count($params) > 1 && !isset($params['default'])) {
unset($params['key']);
return iaLanguage::getf($key, $params);
}
return iaLanguage::get($key, $default);
}
示例3: 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'));
}
}
示例4: _preSaveEntry
protected function _preSaveEntry(array &$entry, array $data, $action)
{
$entry['assignable'] = (int) $data['visible'];
$entry['visible'] = (int) $data['visible'];
if (iaCore::ACTION_ADD == $action) {
if (empty($data['name'])) {
$this->addMessage('error_usergroup_incorrect');
} else {
$entry['name'] = strtolower(iaSanitize::paranoid($data['name']));
if (!iaValidate::isAlphaNumericValid($entry['name'])) {
$this->addMessage('error_usergroup_incorrect');
} elseif ($this->_iaDb->exists('`name` = :name', array('name' => $entry['name']))) {
$this->addMessage('error_usergroup_exists');
}
}
}
foreach ($this->_iaCore->languages as $code => $language) {
if (empty($data['title'][$code])) {
$this->addMessage(iaLanguage::getf('error_lang_title', array('lang' => $language['title'])), false);
}
}
return !$this->getMessages();
}
示例5: 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;
}
示例6: array
return iaView::errorPage(iaView::ERROR_FORBIDDEN);
}
}
if (isset($_POST['data-blog-entry'])) {
$result = false;
$messages = array();
iaUtil::loadUTF8Functions('ascii', 'validation', 'bad', 'utf8_to_ascii');
$entry['title'] = $_POST['title'];
utf8_is_valid($entry['title']) || ($entry['title'] = utf8_bad_replace($entry['title']));
if (empty($entry['title'])) {
$messages[] = iaLanguage::get('title_is_empty');
}
$entry['body'] = $_POST['body'];
utf8_is_valid($entry['body']) || ($entry['body'] = utf8_bad_replace($entry['body']));
if (empty($entry['body'])) {
$messages[] = iaLanguage::getf('field_is_empty', array('field' => iaLanguage::get('body')));
}
$entry['alias'] = $iaBlog->titleAlias(empty($_POST['alias']) ? $entry['title'] : $_POST['alias']);
if (!$messages) {
if (isset($_FILES['image']['tmp_name']) && $_FILES['image']['tmp_name']) {
$iaPicture = $iaCore->factory('picture');
$info = array('image_width' => 1000, 'image_height' => 750, 'thumb_width' => 250, 'thumb_height' => 250, 'resize_mode' => iaPicture::CROP);
if ($image = $iaPicture->processImage($_FILES['image'], iaUtil::getAccountDir(), iaUtil::generateToken(), $info)) {
if ($entry['image']) {
$iaPicture = $iaCore->factory('picture');
$iaPicture->delete($entry['image']);
}
$entry['image'] = $image;
}
}
$result = iaCore::ACTION_ADD == $pageAction ? $iaBlog->insert($entry) : $iaBlog->update($entry, $id);
示例7: _importPage
private function _importPage(&$iaView)
{
if (isset($_POST['import'])) {
$filename = isset($_POST['sqlfile']) ? $_POST['sqlfile'] : '';
$extension = '';
if ($_FILES) {
$filename = $_FILES['sql_file']['tmp_name'];
$extension = end(explode('.', $_FILES['sql_file']['name']));
}
if (!is_file($filename)) {
$this->_error = true;
$this->addMessage('no_file');
} elseif ($extension && 'sql' != $extension) {
$this->_error = true;
$this->addMessage(iaLanguage::getf('cant_open_incorrect_format', array('filename' => $filename)), false);
} elseif (!($f = fopen($filename, 'r'))) {
$this->_error = true;
$this->addMessage(iaLanguage::getf('cant_open_sql', array('filename' => $filename)), false);
} else {
$sql = '';
while ($s = fgets($f, 10240)) {
$s = trim($s);
if ($s) {
if ($s[0] == '#' || $s[0] == '') {
continue;
}
} else {
continue;
}
if ($s[strlen($s) - 1] == ';') {
$sql .= $s;
} else {
$sql .= $s;
continue;
}
$this->_iaDb->query(str_replace('{prefix}', $this->_iaDb->prefix, $sql));
$sql = '';
}
fclose($f);
$this->addMessage('upgrade_completed');
$this->_iaCore->iaCache->clearAll();
}
}
// generate list of available folders for dump files
$dumpFolders = array('Updates' => IA_HOME . 'updates' . IA_DS);
$packages = $this->_iaDb->onefield('name', "`type` = 'package' AND `status` = 'active'", null, null, 'extras');
foreach ($packages as $package) {
$dumpFolders[iaLanguage::get($package)] = IA_PACKAGES . $package . IA_DS . 'includes' . IA_DS . 'dumps' . IA_DS;
}
// generate list of available dump files
$dumpFiles = array();
foreach ($dumpFolders as $name => $path) {
if (is_dir($path)) {
$files = scandir($path);
foreach ($files as $file) {
if (substr($file, 0, 1) != '.' && is_file($path . $file)) {
$dumpFiles[$name][] = array('filename' => $path . $file, 'title' => substr($file, 0, count($file) - 5));
}
}
}
}
$iaView->assign('dumpFiles', $dumpFiles);
}
示例8: _preSaveEntry
protected function _preSaveEntry(array &$entry, array $data, $action)
{
$entry['item'] = in_array($data['item'], $this->_items) ? $data['item'] : null;
if (!$entry['item']) {
$this->addMessage('incorrect_item');
}
if ($entry['item'] == iaUsers::getItemName()) {
if (isset($data['usergroup'])) {
$entry['usergroup'] = (int) $data['usergroup'];
}
}
if (isset($this->_fields[$entry['item']])) {
$entry['data'] = array();
if (!empty($data['fields']) && !$this->getMessages()) {
$f = $this->_fields[$entry['item']];
$array = array();
foreach ($data['fields'] as $field) {
if (in_array($field, $f[0])) {
$entry['data']['fields'][] = $field;
$array[] = $field;
} elseif (in_array($field, $f[1])) {
$entry['data']['fields'][] = $field;
}
}
if ($array) {
$this->_iaDb->update(array('for_plan' => 1), "`name` IN ('" . implode("','", $entry['data']['fields']) . "')", null, iaField::getTable());
}
}
$entry['data'] = serialize($entry['data']);
}
$this->_iaCore->startHook('phpAdminAddPlanValidation');
iaUtil::loadUTF8Functions('ascii', 'validation', 'bad', 'utf8_to_ascii');
$lang = array('title' => $data['title'], 'description' => $data['description']);
foreach ($this->_iaCore->languages as $code => $language) {
if (isset($lang['title'][$code])) {
if (empty($lang['title'][$code])) {
$this->addMessage(iaLanguage::getf('error_lang_title', array('lang' => $language['title'])), false);
} elseif (!utf8_is_valid($lang['title'][$code])) {
$lang['title'][$code] = utf8_bad_replace($lang['title'][$code]);
}
}
if (isset($lang['description'][$code])) {
if (empty($lang['description'][$code])) {
$this->addMessage(iaLanguage::getf('error_lang_description', array('lang' => $language['title'])), false);
} elseif (!utf8_is_valid($lang['description'][$code])) {
$lang['description'][$code] = utf8_bad_replace($lang['description'][$code]);
}
}
}
$this->_languages = $lang;
$entry['duration'] = isset($data['duration']) ? $data['duration'] : 0;
if (!is_numeric($entry['duration'])) {
$this->addMessage('error_plan_duration');
}
$entry['cost'] = (double) $data['cost'];
$entry['cycles'] = (int) $data['cycles'];
$entry['unit'] = $data['unit'];
$entry['status'] = $data['status'];
$entry['recurring'] = (int) $data['recurring'];
$entry['expiration_status'] = $data['expiration_status'];
$this->_iaCore->startHook('phpAdminPlanCommonFieldFilled', array('item' => &$entry));
$entry['cost'] || ($this->_phraseAddSuccess = 'free_plan_added');
return !$this->getMessages();
}
示例9: _processFileField
protected static function _processFileField(array $field, array $file, $path)
{
$error = false;
$message = null;
list($filename, $extension) = self::_generateFileName($file['name'], $field['file_prefix'], false);
$filename = $path . $filename . '.' . $extension;
// get available extensions
$allowedExtensions = empty($field['file_types']) ? false : explode(',', str_replace(' ', '', $field['file_types']));
if ($extension && $allowedExtensions && in_array($extension, $allowedExtensions)) {
move_uploaded_file($file['tmp_name'], IA_UPLOADS . $filename);
chmod(IA_UPLOADS . $filename, 0644);
} else {
$error = true;
$message = iaLanguage::getf('file_type_error', array('extension' => $field['file_types']));
}
return array($filename, $error, $message);
}
示例10: _setPageTitle
protected function _setPageTitle(&$iaView, array $entryData, $action)
{
if (in_array($action, array(iaCore::ACTION_ADD, iaCore::ACTION_EDIT))) {
$entryName = empty($entryData['name']) ? '' : iaLanguage::get('field_' . $entryData['name']);
$title = iaLanguage::getf($action . '_field', array('field' => $entryName));
$iaView->title($title);
}
}
示例11: install
public function install()
{
$iaDb =& $this->iaDb;
$this->iaCore->startHook('phpExtrasInstallBefore', array('extra' => $this->itemData['name']));
$extrasList = array();
$array = $iaDb->all(array('id', 'name', 'version'), "`status` = 'active'", null, null, self::getTable());
foreach ($array as $item) {
$extrasList[$item['name']] = $item;
}
// TODO: check for relations and deactivate all needed extras
if ($this->itemData['requirements']) {
$messages = array();
foreach ($this->itemData['requirements'] as $requirement) {
if ($requirement['min'] || $requirement['max']) {
$min = $max = false;
if (isset($extrasList[$requirement['name']])) {
$info = $extrasList[$requirement['name']];
$min = $requirement['min'] ? version_compare($requirement['min'], $info['version'], '<=') : true;
$max = $requirement['max'] ? version_compare($requirement['max'], $info['version'], '>=') : true;
}
if (!$max || !$min) {
$ver = '';
if ($requirement['min']) {
$ver .= $requirement['min'];
}
if ($requirement['max']) {
if ($requirement['min']) {
$ver .= '-';
}
$ver .= $requirement['max'];
}
$values = array(':extra' => $requirement['type'], ':name' => $requirement['name'], ':version' => $ver);
$messages[] = iaLanguage::getf('required_extras_error', $values);
$this->error = true;
} else {
// TODO: add relations in database to deactivate when parent is uninstalled
}
}
}
if ($this->error) {
$this->setMessage(implode('<br />', $messages));
return false;
}
}
$this->uninstall($this->itemData['name']);
if (false !== stristr('update', $this->itemData['name'])) {
$this->isUpdate = true;
}
$this->_processQueries('install', self::SQL_STAGE_START);
if ($this->itemData['groups']) {
$iaDb->setTable('admin_pages_groups');
$maxOrder = $iaDb->getMaxOrder();
foreach ($this->itemData['groups'] as $title => $entry) {
$iaDb->insert($entry, array('order' => ++$maxOrder));
$this->_addPhrase('pages_group_' . $entry['name'], $title, iaLanguage::CATEGORY_ADMIN);
}
$iaDb->resetTable();
}
if ($this->itemData['pages']['admin']) {
$this->_processAdminPages($this->itemData['pages']['admin']);
}
if ($this->itemData['actions']) {
$iaDb->setTable('admin_actions');
foreach ($this->itemData['actions'] as $action) {
$action['name'] = strtolower(str_replace(' ', '_', $action['name']));
if ($action['name'] && !$iaDb->exists('`name` = :name', array('name' => $action['name']))) {
$action['order'] = empty($action['order']) || !is_numeric($action['order']) ? $iaDb->getMaxOrder() + 1 : $action['order'];
$iaDb->insert($action);
}
}
$iaDb->resetTable();
}
if ($this->itemData['phrases']) {
$this->_processPhrases($this->itemData['phrases']);
}
if ($this->itemData['config_groups']) {
$iaDb->setTable(iaCore::getConfigGroupsTable());
$maxOrder = $iaDb->getMaxOrder();
foreach ($this->itemData['config_groups'] as $title => $entry) {
$iaDb->insert($entry, array('order' => ++$maxOrder));
$this->_addPhrase('config_group_' . $entry['name'], $title, iaLanguage::CATEGORY_ADMIN);
}
$iaDb->resetTable();
}
if ($this->itemData['objects']) {
$iaDb->setTable('acl_objects');
foreach ($this->itemData['objects'] as $obj) {
if ($obj['title']) {
$key = ($obj['object'] == $obj['pre_object'] ? '' : $obj['pre_object'] . '-') . $obj['object'] . '--' . $obj['action'];
iaLanguage::addPhrase($key, $obj['title'], null, $this->itemData['name'], iaLanguage::CATEGORY_COMMON, false);
unset($obj['title']);
}
$iaDb->insert($obj);
}
$iaDb->resetTable();
}
if ($this->itemData['permissions']) {
$iaDb->setTable('acl_privileges');
foreach ($this->itemData['permissions'] as $permission) {
$iaDb->insert($permission);
//.........这里部分代码省略.........
示例12: 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 = $this->_iaDb->delete('`id` IN (' . implode(',', $params['id']) . ')');
if (1 == $total) {
$result['result'] = 1 == $affected;
$result['message'] = $result['result'] ? iaLanguage::get($languagePhraseKey) : iaLanguage::get('db_error');
} else {
$result['result'] = $affected == $total;
$result['message'] = $result['result'] ? iaLanguage::getf('items_deleted', array('num' => $affected)) : iaLanguage::getf('items_deleted_of', array('num' => $affected, 'total' => $total));
}
}
return $result;
}
示例13: _preSaveEntry
protected function _preSaveEntry(array &$entry, array $data, $action)
{
$this->_iaCore->startHook('adminAddBlockValidation');
iaUtil::loadUTF8Functions('ascii', 'validation', 'bad', 'utf8_to_ascii');
// validate block name
if (iaCore::ACTION_ADD == $action) {
if (empty($data['name'])) {
$entry['name'] = 'block_' . mt_rand(1000, 9999);
} else {
$entry['name'] = strtolower(iaSanitize::paranoid($data['name']));
if (!iaValidate::isAlphaNumericValid($entry['name'])) {
$this->addMessage('error_block_name');
} elseif ($this->_iaDb->exists('`name` = :name', array('name' => $entry['name']))) {
$this->addMessage('error_block_name_duplicate');
}
}
}
$entry['classname'] = $data['classname'];
$entry['position'] = $data['position'];
$entry['type'] = $data['type'];
$entry['status'] = isset($data['status']) ? in_array($data['status'], array(iaCore::STATUS_ACTIVE, iaCore::STATUS_INACTIVE)) ? $data['status'] : iaCore::STATUS_ACTIVE : iaCore::STATUS_ACTIVE;
$entry['header'] = (int) $data['header'];
$entry['collapsible'] = (int) $data['collapsible'];
$entry['collapsed'] = (int) $data['collapsed'];
$entry['multilingual'] = (int) $data['multilingual'];
$entry['sticky'] = (int) $data['sticky'];
$entry['external'] = (int) $data['external'];
$entry['filename'] = $data['filename'];
$entry['pages'] = isset($data['pages']) ? $data['pages'] : array();
$entry['title'] = $data['title'];
$entry['contents'] = $data['content'];
if ($entry['multilingual']) {
if (empty($entry['title'])) {
$this->addMessage('title_is_empty');
} elseif (!utf8_is_valid($entry['title'])) {
$entry['title'] = utf8_bad_replace($entry['title']);
}
if (empty($entry['contents']) && !$entry['external']) {
$this->addMessage('error_contents');
} elseif (empty($entry['filename']) && $entry['external']) {
$this->addMessage('error_filename');
}
if (iaBlock::TYPE_HTML != $entry['type']) {
if (!utf8_is_valid($entry['contents'])) {
$entry['contents'] = utf8_bad_replace($entry['contents']);
}
}
} else {
$this->_multilingualContent = $data['content'];
if (isset($data['languages']) && $data['languages']) {
$entry['languages'] = $data['languages'];
$entry['titles'] = $data['titles'];
$entry['contents'] = $data['contents'];
foreach ($entry['languages'] as $langCode) {
if (isset($entry['titles'][$langCode])) {
if (empty($entry['titles'][$langCode])) {
$this->addMessage(iaLanguage::getf('error_lang_title', array('lang' => $this->_iaCore->languages[$langCode]['title'])), false);
} elseif (!utf8_is_valid($entry['titles'][$langCode])) {
$entry['titles'][$langCode] = utf8_bad_replace($entry['titles'][$langCode]);
}
}
if (isset($entry['contents'][$langCode])) {
if (empty($entry['contents'][$langCode])) {
$this->addMessage(iaLanguage::getf('error_lang_contents', array('lang' => $this->_iaCore->languages[$langCode]['title'])), false);
}
if (iaBlock::TYPE_HTML != $entry['type']) {
if (!utf8_is_valid($entry['contents'][$langCode])) {
$entry['contents'][$langCode] = utf8_bad_replace($entry['contents'][$langCode]);
}
}
}
}
} else {
$this->addMessage('block_languages_empty');
}
}
$this->_iaCore->startHook('phpAdminBlocksEdit', array('block' => &$entry));
return !$this->getMessages();
}
示例14: _preSaveEntry
protected function _preSaveEntry(array &$entry, array $data, $action)
{
$this->_iaCore->startHook('phpAdminAddPageValidation', array('entry' => &$entry));
iaUtil::loadUTF8Functions('ascii', 'bad', 'utf8_to_ascii', 'validation');
$entry['name'] = preg_replace('#[^a-z0-9-_]#iu', '', strtolower($data['name'] = !utf8_is_ascii($data['name']) ? utf8_to_ascii($data['name']) : $data['name']));
$entry['meta_description'] = utf8_is_valid($data['meta_description']) ? $data['meta_description'] : utf8_bad_replace($data['meta_description']);
$entry['meta_keywords'] = utf8_is_valid($data['meta_keywords']) ? $data['meta_keywords'] : utf8_bad_replace($data['meta_keywords']);
$entry['status'] = isset($data['preview']) ? iaCore::STATUS_DRAFT : $data['status'];
if (iaCore::ACTION_ADD == $action) {
$entry['group'] = 2;
$entry['filename'] = 'page';
}
foreach ($data['titles'] as $key => $title) {
if (empty($title)) {
$this->addMessage(iaLanguage::getf('field_is_empty', array('field' => iaLanguage::get('title') . ' (' . $key . ')')), false);
break;
}
}
if (!isset($data['service']) || !$data['service']) {
$entry['alias'] = empty($data['alias']) ? $data['name'] : $data['alias'];
$entry['custom_url'] = empty($data['custom_url']) ? '' : $data['custom_url'];
$entry['passw'] = empty($data['passw']) ? '' : $data['passw'];
$entry['alias'] = utf8_is_ascii($entry['alias']) ? $entry['alias'] : utf8_to_ascii($entry['alias']);
$entry['alias'] = empty($entry['alias']) ? '' : iaSanitize::alias($entry['alias']);
$entry['alias'] .= $data['extension'];
if ($data['parent_id']) {
$parentPage = $this->getById($data['parent_id']);
$parentAlias = empty($parentPage['alias']) ? $parentPage['name'] . IA_URL_DELIMITER : $parentPage['alias'];
$entry['parent'] = $parentPage['name'];
$entry['alias'] = $parentAlias . (IA_URL_DELIMITER == substr($parentAlias, -1, 1) ? '' : IA_URL_DELIMITER) . $entry['alias'];
} else {
$entry['parent'] = '';
}
if ($this->_iaDb->exists('`id` != :id AND `alias` = :alias', array('id' => $this->getEntryId(), 'alias' => $entry['alias']))) {
$this->addMessage('page_alias_exists');
}
if (isset($data['nofollow'])) {
$entry['nofollow'] = (int) $data['nofollow'];
}
if (isset($data['new_window'])) {
$entry['new_window'] = (int) $data['new_window'];
}
// delete custom url
if (isset($data['unique']) && 0 == $data['unique']) {
$entry['custom_url'] = '';
}
if (isset($data['custom_tpl']) && $data['custom_tpl']) {
$entry['custom_tpl'] = (int) $data['custom_tpl'];
$entry['template_filename'] = $data['template_filename'];
if (!$data['template_filename']) {
$this->addMessage('page_incorrect_template_filename');
}
} else {
$entry['custom_tpl'] = 0;
$entry['template_filename'] = '';
}
}
if (empty($entry['name'])) {
$this->addMessage(iaLanguage::getf('field_is_empty', array('field' => iaLanguage::get('name'))), false);
} elseif (iaCore::ACTION_ADD == $action && $this->_iaDb->exists('`name` = :name', array('name' => $entry['name']))) {
$this->addMessage('page_name_exists');
}
return !$this->getMessages();
}
示例15: array
$iaView->assign('items', $iaInvoice->getItemsByInvoiceId($invoice['id']));
$iaView->disableLayout();
echo $iaView->display('invoice');
return;
} else {
return iaView::errorPage(iaView::ERROR_NOT_FOUND);
}
}
iaUsers::reloadIdentity();
if (isset($_POST['amount'])) {
$amount = (double) $_POST['amount'];
if ($amount > 0) {
if ($amount >= (double) $iaCore->get('funds_min_deposit') && $amount <= (double) $iaCore->get('funds_max_deposit')) {
$iaTransaction->createInvoice(iaLanguage::get('funds'), $amount, iaTransaction::TRANSACTION_MEMBER_BALANCE, iaUsers::getIdentity(true), $profilePageUrl);
} else {
iaLanguage::set('amount_incorrect', iaLanguage::getf('amount_incorrect', array('min' => $iaCore->get('funds_min_deposit'), 'max' => $iaCore->get('funds_max_deposit'), 'currency' => $iaCore->get('currency'))));
$iaView->setMessages(iaLanguage::get('amount_incorrect'));
}
} else {
$iaView->setMessages(iaLanguage::get('amount_incorrect'));
}
}
$pagination = array('page' => 1, 'limit' => 10, 'total' => 0, 'template' => $profilePageUrl . 'funds/?page={page}');
$pagination['page'] = isset($_GET['page']) && 1 < $_GET['page'] ? (int) $_GET['page'] : $pagination['page'];
$pagination['page'] = ($pagination['page'] - 1) * $pagination['limit'];
$transactions = $iaDb->all('SQL_CALC_FOUND_ROWS *', '`member_id` = ' . iaUsers::getIdentity()->id . ' ORDER BY `status`', $pagination['page'], $pagination['limit'], iaTransaction::getTable());
$pagination['total'] = $iaDb->foundRows();
$iaView->caption($iaView->title() . ': ' . number_format(iaUsers::getIdentity()->funds, 2, '.', '') . ' ' . $iaCore->get('currency'));
$iaView->assign('pagination', $pagination);
$iaView->assign('transactions', $transactions);
$iaView->display('transactions');