本文整理汇总了PHP中iaCore::instance方法的典型用法代码示例。如果您正苦于以下问题:PHP iaCore::instance方法的具体用法?PHP iaCore::instance怎么用?PHP iaCore::instance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类iaCore
的用法示例。
在下文中一共展示了iaCore::instance方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: init
public function init()
{
$this->_iaCore = iaCore::instance();
$this->CharSet = 'UTF-8';
$this->From = $this->_iaCore->get('site_email');
$this->FromName = $this->_iaCore->get('site_from_name', 'Subrion CMS');
$this->SingleTo = true;
$this->isHTML($this->_iaCore->get('mimetype'));
switch ($this->_iaCore->get('mail_function')) {
case 'smtp':
$this->isSMTP();
$this->Host = $this->_iaCore->get('smtp_server');
$this->SMTPAuth = (bool) $this->_iaCore->get('smtp_auth');
$this->Username = $this->_iaCore->get('smtp_user');
$this->Password = $this->_iaCore->get('smtp_password');
$this->SMTPSecure = 'ssl';
if ($port = $this->_iaCore->get('smtp_port')) {
$this->Port = (int) $port;
}
break;
case 'sendmail':
$this->isSendmail();
$this->Sendmail = $this->_iaCore->get('sendmail_path');
break;
default:
// PHP's mail function
$this->isMail();
}
// global patterns
$this->setReplacements(array('site_url' => IA_URL, 'site_name' => $this->_iaCore->get('site'), 'site_email' => $this->_iaCore->get('site_email')));
}
示例2: _launchFile
protected function _launchFile($file)
{
ignore_user_abort(1);
@set_time_limit(0);
$iaCore = iaCore::instance();
$iaDb =& $iaCore->iaDb;
$iaView =& $iaCore->iaView;
include IA_HOME . $file;
}
示例3: _getExtraType
private function _getExtraType($extraName)
{
if (is_null(self::$_extraTypes)) {
$iaCore = iaCore::instance();
$iaCore->factory('item');
self::$_extraTypes = $iaCore->iaDb->keyvalue(array('name', 'type'), iaDb::convertIds(iaCore::STATUS_ACTIVE, 'status'), iaItem::getExtrasTable());
}
return isset(self::$_extraTypes[$extraName]) ? self::$_extraTypes[$extraName] : null;
}
示例4: reloadIdentity
public static function reloadIdentity()
{
$sql = 'SELECT u.*, g.`name` `usergroup` ' . 'FROM `:prefix_:table_users` u ' . 'LEFT JOIN `:prefix_:table_groups` g ON (g.`id` = u.`usergroup_id`) ' . "WHERE u.`id` = :id AND u.`status` = ':status' " . 'LIMIT 1';
$iaDb = iaCore::instance()->iaDb;
$sql = iaDb::printf($sql, array('prefix_' => $iaDb->prefix, 'table_users' => self::getTable(), 'table_groups' => self::getUsergroupsTable(), 'id' => self::getIdentity()->id, 'status' => iaCore::STATUS_ACTIVE));
$row = $iaDb->getRow($sql);
self::_setIdentity($row);
return (bool) $row;
}
示例5: init
public function init()
{
parent::init();
$this->_cachingEnabled = true;
if (!file_exists($this->_savePath)) {
iaCore::instance()->util()->makeDirCascade($this->_savePath, 0777);
}
$mask = !function_exists('posix_getuid') || function_exists('posix_getuid') && posix_getuid() != fileowner(IA_HOME . 'index' . iaSystem::EXECUTABLE_FILE_EXT) ? 0777 : 0755;
chmod($this->_savePath, $mask);
}
示例6: __construct
public function __construct()
{
$this->_iaCore = iaCore::instance();
$this->_iaDb =& $this->_iaCore->iaDb;
$this->_gridQueryMainTableAlias = empty($this->_gridQueryMainTableAlias) ? '' : $this->_gridQueryMainTableAlias . '.';
$this->_iaCore->factory('util');
$this->_table || $this->setTable($this->getName());
$this->_path = IA_ADMIN_URL . $this->getName() . IA_URL_DELIMITER;
$this->_template = $this->getName();
}
示例7: getAccountsToBePaid
function getAccountsToBePaid($aStart, $aLimit)
{
$iaCore =& iaCore::instance();
$sql = "SELECT SQL_CALC_FOUND_ROWS s.`aff_id` as `id`, SUM(payment) AS `Total`, COUNT(s.`id`) AS `Sales`, s.`aff_id`, a.`username`, 1 as `remove` ";
$sql .= "FROM `{$this->mPrefix}sales` s, `{$this->mPrefix}accounts` a ";
$sql .= "WHERE s.`status` = 'active' AND a.`id` = s.`aff_id` ";
$sql .= "GROUP BY s.`aff_id` ";
$sql .= "HAVING `Total` >= '" . $iaCore->get('payout_balance') * 100 / $iaCore->get('payout_percent') . "' ";
$sql .= $aLimit ? "LIMIT {$aStart}, {$aLimit}" : '';
return $this->iaDb->getAll($sql);
}
示例8: sitemap_recipes
function sitemap_recipes($tpl = '<url><loc>{url}</loc></url>')
{
$iaCore = iaCore::instance();
$iaDb =& $iaCore->iaDb;
$iaRecipe = $iaCore->factoryPackages('recipes', 'front', 'recipe');
$text = '';
$recipes = $iaRecipe->getRecipes();
foreach ($recipes as $row) {
list($url, $output) = $iaRecipe->goToItem(array('item' => $row));
$text .= str_replace(array('{url}', '{site}'), array($url, ''), $tpl);
}
return $text;
}
示例9: albums_search
function albums_search($aQuery, $aFields, $aStart, $aLimit, &$aNumAll, $aWhere = '', $cond = 'AND')
{
$iaCore =& iaCore::instance();
$iaAlbum = $iaCore->factoryPackage('album', 'lyrics');
$ret = array();
$where = "`title` LIKE '%{$aQuery}%' OR `description` LIKE '%{$aQuery}%'";
$albums = $iaCore->iaDb->all('sql_calc_found_rows `title`, `title_alias`, `artist_alias`', $where, $aStart, $aLimit, iaAlbum::getTable());
$aNumAll += $iaCore->iaDb->foundRows();
foreach ($albums as $album) {
$album_url = $iaCore->iaSmarty->ia_url(array('item' => $iaAlbum->getItemName(), 'data' => $album, 'type' => 'url'));
$ret[] = sprintf('<p><a href="%s">%s</a></p>', $album_url, $album['title']);
}
return $ret;
}
示例10: recipes_search
function recipes_search($aQuery, $aFields, $aStart, $aLimit, &$aNumAll, $aWhere = '', $cond = 'AND')
{
$iaCore =& iaCore::instance();
$ret = array();
$match = array();
if ($aQuery) {
$match[] = sprintf(" MATCH (`title`, `ingredients`, `procedures`) AGAINST('%s') ", $iaCore->sql($aQuery));
}
if ($aWhere) {
$match[] = '' . $aWhere;
}
// additional fields
if ($aFields && is_array($aFields)) {
foreach ($aFields as $fname => $data) {
if ('LIKE' == $data['cond']) {
$data['val'] = "%{$data['val']}%";
}
// for multiple values, like combo or checkboxes
if (is_array($data['val'])) {
if ('!=' == $data['cond']) {
$data['cond'] = count($data['val']) > 1 ? 'NOT IN' : '!=';
} else {
$data['cond'] = count($data['val']) > 1 ? 'IN' : '=';
}
$data['val'] = count($data['val']) > 1 ? '(' . implode(',', $data['val']) . ')' : array_shift($data['val']);
} else {
if (preg_match('/^(\\d+)\\s*-\\s*(\\d+)$/', $data['val'], $range)) {
// search in range
$data['cond'] = sprintf('BETWEEN %d AND %d', $range[1], $range[2]);
$data['val'] = '';
} else {
$data['val'] = "'" . $iaCore->sql($data['val']) . "'";
}
}
$match[] = "`{$fname}` {$data['cond']} {$data['val']} ";
}
}
$iaRecipe = $iaCore->factoryPackages('recipes', 'front', 'recipe');
$recipes = $match ? $iaRecipe->getRecipes(' AND (' . implode(' ' . $cond . ' ', $match) . ')', $aStart, $aLimit) : array();
$aNumAll = $iaRecipe->getRecipesNum(' AND (' . implode(' ' . $cond . ' ', $match) . ')');
if ($recipes && SMARTY) {
$iaCore->iaSmarty->assign('all_items', $recipes);
$fields = $iaCore->getAcoFieldsList('recipes_home', 'recipes', '', true);
$iaCore->iaSmarty->assign_by_ref('all_item_fields', $fields);
$iaCore->iaSmarty->assign('all_item_type', 'recipes');
$ret[] = $iaCore->iaSmarty->fetch('all-items-page.tpl');
}
return $ret;
}
示例11: init
public function init()
{
$this->iaCore = iaCore::instance();
parent::init();
foreach ($this->iaCore->packagesData as $packageName => $packageData) {
$this->registerResource($packageName, $this->_createPackageTemplateHandlers($packageName));
}
iaSystem::renderTime('main', 'afterSmartyFuncInit');
$this->assign('tabs_content', array());
$this->assign('tabs_before', array());
$this->assign('tabs_after', array());
$this->assign('fieldset_before', array());
$this->assign('fieldset_after', array());
$this->assign('field_before', array());
$this->assign('field_after', array());
$this->resources = array('jquery' => 'text:Loading jQuery API..., js:jquery/jquery', 'subrion' => 'text:Loading Subrion Awesome Stuff..., js:intelli/intelli, js:_IA_URL_tmp/cache/intelli.config, ' . (iaCore::ACCESS_ADMIN == $this->iaCore->getAccessType() ? 'js:_IA_TPL_bootstrap.min, js:bootstrap/js/bootstrap-switch.min, js:bootstrap/js/passfield.min, js:intelli/intelli.admin, js:admin/footer, css:_IA_URL_js/bootstrap/css/passfield' : 'js:intelli/intelli.minmax, js:frontend/footer') . ',js:_IA_URL_tmp/cache/intelli' . (iaCore::ACCESS_ADMIN == $this->iaCore->getAccessType() ? '.admin' : '') . '.lang.' . $this->iaCore->iaView->language, 'extjs' => 'text:Loading ExtJS..., css:_IA_URL_js/extjs/resources/ext-theme-neptune/ext-theme-neptune-all' . ($this->iaCore->get('sap_style', false) ? '-' . $this->iaCore->get('sap_style') : '') . ', js:extjs/ext-all', 'manage_mode' => 'css:_IA_URL_js/visual/css/visual, js:visual/js/slidebars.min, js:visual/js/jqueryui.min, js:visual/js/visual', 'tree' => 'js:jquery/plugins/jstree/jstree.min, js:intelli/intelli.tree, css:_IA_URL_js/jquery/plugins/jstree/themes/default/style', 'jcal' => 'js:jquery/plugins/jcal/jquery.jcal, css:_IA_URL_js/jquery/plugins/jcal/jquery.jcal', 'bootstrap' => 'js:bootstrap/js/bootstrap.min, css:iabootstrap, css:iabootstrap-responsive, css:user-style', 'datepicker' => 'js:bootstrap/js/datepicker/bootstrap-datepicker, js:bootstrap/js/datepicker/locales/bootstrap-datepicker.' . $this->iaCore->get('lang') . ', css:_IA_URL_js/bootstrap/css/datepicker' . (iaCore::ACCESS_ADMIN == $this->iaCore->getAccessType() ? '3' : ''), 'tagsinput' => 'js:jquery/plugins/tagsinput/jquery.tagsinput.min, css:_IA_URL_js/jquery/plugins/tagsinput/jquery.tagsinput', 'underscore' => 'js:utils/underscore.min', 'iadropdown' => 'js:jquery/plugins/jquery.ia-dropdown.min', 'flexslider' => 'js:jquery/plugins/flexslider/jquery.flexslider.min, css:_IA_URL_js/jquery/plugins/flexslider/flexslider');
$this->iaCore->startHook('phpSmartyAfterMediaInit', array('iaSmarty' => &$this));
}
示例12: smarty_function_ia_hooker
function smarty_function_ia_hooker($params, &$smarty)
{
if (!isset($params['name'])) {
return;
}
$name = $params['name'];
iaDebug::debug('smarty', $name, 'hooks');
iaSystem::renderTime('smarty', $name);
$iaCore = iaCore::instance();
$hooks = $iaCore->getHooks();
if (!array_key_exists($name, $hooks) || empty($hooks[$name])) {
return;
}
foreach ($hooks[$name] as $hook) {
$hook['type'] = in_array($hook['type'], array('php', 'html', 'plain', 'smarty')) ? $hook['type'] : 'php';
if (empty($hook['pages']) || in_array($iaCore->iaView->name(), $hook['pages'])) {
if ($hook['filename']) {
switch ($hook['type']) {
case 'php':
if (file_exists(IA_HOME . $hook['filename'])) {
include IA_HOME . $hook['filename'];
}
break;
case 'smarty':
echo $smarty->fetch(IA_HOME . $hook['filename']);
}
} else {
switch ($hook['type']) {
case 'php':
eval($hook['code']);
break;
case 'smarty':
echo $smarty->fetch('eval:' . $hook['code']);
break;
case 'html':
echo $hook['code'];
break;
case 'plain':
echo iaSanitize::html($hook['code']);
}
}
}
}
}
示例13: write
public function write($actionCode, $params = null, $pluginName = null)
{
if (!in_array($actionCode, $this->_validActions)) {
return false;
}
if (iaUsers::hasIdentity()) {
$params['user'] = iaUsers::getIdentity()->fullname;
}
empty($params['title']) || ($params['title'] = iaSanitize::html($params['title']));
$row = array('date' => date(iaDb::DATETIME_FORMAT), 'action' => $actionCode, 'user_id' => iaUsers::hasIdentity() ? iaUsers::getIdentity()->id : null, 'params' => serialize($params));
if ($pluginName) {
$row['extras'] = $pluginName;
} else {
$iaView =& iaCore::instance()->iaView;
if ($value = $iaView->get('extras')) {
$row['extras'] = $value;
}
}
return (bool) $this->iaDb->insert($row, null, self::getTable());
}
示例14: smarty_function_ia_print_img
/**
* Smarty plugin
* @package Smarty
* @subpackage plugins
*/
function smarty_function_ia_print_img($params, &$smarty)
{
$out = IA_CLEAR_URL;
$folder = isset($params['folder']) ? $params['folder'] : '';
if (isset($params['ups']) && !empty($params['ups'])) {
$out .= 'uploads/' . $folder . $params['fl'];
} elseif (isset($params['pl']) && !empty($params['pl'])) {
$admin = isset($params['admin']) && $params['admin'] ? 'admin/' : 'front/';
$out .= 'plugins/' . $params['pl'] . '/' . $admin . 'templates/img/' . $folder . $params['fl'];
} elseif (isset($params['package']) && $params['package']) {
$iaCore = iaCore::instance();
$packages = $iaCore->packagesData;
$template = $iaCore->iaView->theme;
$admin = isset($params['admin']) && $params['admin'];
$design = $admin ? 'admin/' : $template . '/';
if (isset($packages[$params['package']])) {
$out = $packages[$params['package']]['tpl_url'] . $design . 'images/' . $folder . $params['fl'];
} else {
$out = ($admin ? 'admin/' : '') . 'templates/' . $template . '/img/' . $folder . $params['fl'];
}
} else {
$admin = isset($params['admin']) && $params['admin'] ? 'admin/templates/' : '';
if ($admin) {
$out .= $admin . 'default/img/' . $folder . $params['fl'];
} else {
$out .= 'templates/' . $smarty->tmpl . '/img/' . $folder . $params['fl'];
}
}
// prints including image tag
if (isset($params['full'])) {
$attrs = array('id', 'title', 'width', 'height', 'border', 'style', 'class', 'alt');
$params['alt'] = isset($params['alt']) ? $params['alt'] : '';
$atrs = '';
foreach ($params as $key => $attr) {
$atrs .= in_array($key, $attrs) && isset($attr) ? $key . '="' . $attr . '" ' : '';
}
$out = '<img src="' . $out . '" ' . $atrs . '/>';
}
echo $out;
}
示例15: setDebugMode
public static function setDebugMode()
{
if ($debuggerPassword = iaCore::instance()->get('debug_pass')) {
if (isset($_GET['debugger']) && $debuggerPassword == $_GET['debugger']) {
$_SESSION['debugger'] = $_GET['debugger'];
}
if (isset($_SESSION['debugger']) && $debuggerPassword == $_SESSION['debugger']) {
define('INTELLI_QDEBUG', true);
}
}
defined('INTELLI_QDEBUG') || define('INTELLI_QDEBUG', false);
}