本文整理汇总了PHP中SPLang::e方法的典型用法代码示例。如果您正苦于以下问题:PHP SPLang::e方法的具体用法?PHP SPLang::e怎么用?PHP SPLang::e使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SPLang
的用法示例。
在下文中一共展示了SPLang::e方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: save
public function save(&$attr)
{
if (($attr['resize'] || $attr['crop']) && !($attr['resizeWidth'] && $attr['resizeHeight'])) {
throw new SPException(SPLang::e('IMG_FIELD_RESIZE_NO_SIZE'));
}
parent::save($attr);
}
示例2: __callStatic
public static function __callStatic($name, $args)
{
if (defined('SOBIPRO_ADM')) {
return call_user_func_array(array('self', '_' . $name), $args);
} else {
static $className = false;
if (!$className) {
$package = Sobi::Reg('current_template');
if (SPFs::exists(Sobi::FixPath($package . '/input.php'))) {
$path = Sobi::FixPath($package . '/input.php');
ob_start();
$content = file_get_contents($path);
$class = array();
preg_match('/\\s*(class)\\s+(\\w+)/', $content, $class);
if (isset($class[2])) {
$className = $class[2];
} else {
Sobi::Error('Custom Input Class', SPLang::e('Cannot determine class name in file %s.', str_replace(SOBI_ROOT, null, $path)), SPC::WARNING, 0);
return false;
}
require_once $path;
} else {
$className = true;
}
}
if (is_string($className) && method_exists($className, $name)) {
return call_user_func_array(array($className, $name), $args);
} else {
return call_user_func_array(array('self', '_' . $name), $args);
}
}
}
示例3: save
public function save(&$attr)
{
parent::save($attr);
if ($attr['method'] == 'fixed') {
if (!$attr['fixedCid']) {
throw new SPException(SPLang::e('FIELD_FIXED_CID_MISSING'));
} else {
$cids = explode(',', $attr['fixedCid']);
if (count($cids)) {
foreach ($cids as $cid) {
$catId = (int) $cid;
if (!$catId) {
throw new SPException(SPLang::e('FIELD_FIXED_CID_INVALID', $cid));
}
if ($catId == Sobi::Section()) {
throw new SPException(SPLang::e('FIELD_FIXED_CID_INVALID', $cid));
} else {
$parents = SPFactory::config()->getParentPath($catId);
if (!isset($parents[0]) || $parents[0] != Sobi::Section()) {
throw new SPException(SPLang::e('FIELD_FIXED_CID_INVALID_SECTION', $catId));
}
}
}
} else {
throw new SPException(SPLang::e('FIELD_FIXED_CID_MISSING'));
}
}
}
}
示例4: execute
/**
*/
public function execute()
{
$r = false;
switch ($this->_task) {
case 'chooser':
case 'expand':
SPLoader::loadClass('html.input');
$r = true;
$this->chooser($this->_task == 'expand');
break;
case 'parents':
$r = true;
$this->parents();
break;
case 'icon':
$r = true;
$this->iconChooser();
break;
default:
/* case parent didn't registered this task, it was an error */
if (!parent::execute() && $this->name() == __CLASS__) {
Sobi::Error($this->name(), SPLang::e('SUCH_TASK_NOT_FOUND', SPRequest::task()), SPC::NOTICE, 404, __LINE__, __FILE__);
} else {
$r = true;
}
break;
}
return $r;
}
示例5: __construct
/**
*
*/
public function __construct()
{
if (self::$cs) {
Sobi::Error('mainframe', SPLang::e('CRITICAL_SECTION'), SPC::ERROR, 500, __LINE__, __CLASS__);
} else {
self::$cs = true;
self::$cs = false;
}
}
示例6: display
public function display()
{
$template = SPLoader::loadTemplate($this->_tpl, 'php');
if ($template) {
include $template;
} else {
throw new SPException(SPLang::e('CANNOT_LOAD_TEMPLATE_FILE_AT', SPLoader::loadTemplate($this->_tpl, 'php', false)));
}
}
示例7: check
protected function check($file)
{
$allowed = SPLoader::loadIniFile('etc.files');
$mType = SPFactory::Instance('services.fileinfo', $file)->mimeType();
if (strlen($mType) && !in_array($mType, $allowed)) {
SPFs::delete($file);
$this->message(array('type' => 'error', 'text' => SPLang::e('FILE_WRONG_TYPE', $mType), 'id' => ''));
}
return $mType;
}
示例8: search
protected function search()
{
if (!SPFactory::mainframe()->checkToken()) {
Sobi::Error('Token', SPLang::e('UNAUTHORIZED_ACCESS_TASK', SPRequest::task()), SPC::ERROR, 403, __LINE__, __FILE__);
}
// $selected = SPRequest::int( 'selected', 0 );
$ssid = SPRequest::base64('ssid');
$query = SPRequest::string('q', null);
$session = SPFactory::user()->getUserState('userSelector', null, array());
$setting = $session[$ssid];
/* get the site to display */
$site = SPRequest::int('site', 1);
$eLim = Sobi::Cfg('user_selector.entries_limit', 18);
$eLimStart = ($site - 1) * $eLim;
$params = array();
if ($query) {
$q = '%' . $query . '%';
$params = SPFactory::db()->where(array('name' => $q, 'username' => $q, 'email' => $q), 'OR');
}
try {
$count = SPFactory::db()->select('COUNT(*)', '#__users', $params, $setting['ordering'])->loadResult();
$data = SPFactory::db()->select(array('id', 'name', 'username', 'email', 'registerDate', 'lastvisitDate'), '#__users', $params, $setting['ordering'], $eLim, $eLimStart)->loadAssocList();
} catch (SPException $x) {
echo $x->getMessage();
exit;
}
$response = array('sites' => ceil($count / $eLim), 'site' => $site);
if (count($data)) {
$replacements = array();
preg_match_all('/\\%[a-z]*/', $setting['format'], $replacements);
$placeholders = array();
if (isset($replacements[0]) && count($replacements[0])) {
foreach ($replacements[0] as $placeholder) {
$placeholders[] = str_replace('%', null, $placeholder);
}
}
if (count($replacements)) {
foreach ($data as $index => $user) {
$txt = $setting['format'];
foreach ($placeholders as $attribute) {
if (isset($user[$attribute])) {
$txt = str_replace('%' . $attribute, $user[$attribute], $txt);
}
}
$data[$index]['text'] = $txt;
}
}
$response['users'] = $data;
}
SPFactory::mainframe()->cleanBuffer();
echo json_encode($response);
exit;
}
示例9: save
protected function save()
{
if (!SPFactory::mainframe()->checkToken()) {
Sobi::Error('Token', SPLang::e('UNAUTHORIZED_ACCESS_TASK', SPRequest::task()), SPC::ERROR, 403, __LINE__, __FILE__);
}
$data = SPRequest::string('bankdata', null, true);
$data = array('key' => 'bankdata', 'value' => $data, 'type' => 'application', 'id' => Sobi::Section(), 'section' => Sobi::Section());
try {
SPLang::saveValues($data);
} catch (SPException $x) {
$message = SPLang::e('DB_REPORTS_ERR', $x->getMessage());
Sobi::Error('SPPaymentBt', $message, SPC::WARNING, 0, __LINE__, __FILE__);
$this->response(Sobi::Back(), $message, false, 'error');
}
$this->response(Sobi::Back(), Sobi::Txt('MSG.ALL_CHANGES_SAVED'), false, 'success');
}
示例10: save
protected function save()
{
if (!SPFactory::mainframe()->checkToken()) {
Sobi::Error('Token', SPLang::e('UNAUTHORIZED_ACCESS_TASK', SPRequest::task()), SPC::ERROR, 403, __LINE__, __FILE__);
}
$this->validate('extensions.paypal', array('task' => 'paypal', 'pid' => Sobi::Section()));
SPFactory::registry()->saveDBSection(array(array('key' => 'ppurl', 'value' => SPRequest::string('ppurl')), array('key' => 'ppemail', 'value' => SPRequest::string('ppemail')), array('key' => 'ppcc', 'value' => SPRequest::string('ppcc')), array('key' => 'pprurl', 'value' => SPRequest::string('pprurl'))), 'paypal_' . Sobi::Section());
$data = array('key' => 'ppexpl', 'value' => SPRequest::string('ppexpl', null, true), 'type' => 'application', 'id' => Sobi::Section(), 'section' => Sobi::Section());
try {
SPLang::saveValues($data);
$data['key'] = 'ppsubject';
$data['value'] = SPRequest::string('ppsubject', true);
SPLang::saveValues($data);
} catch (SPException $x) {
$message = SPLang::e('DB_REPORTS_ERR', $x->getMessage());
Sobi::Error('SPPaymentBt', $message, SPC::WARNING, 0, __LINE__, __FILE__);
$this->response(Sobi::Back(), $message, false, 'error');
}
$this->response(Sobi::Back(), Sobi::Txt('MSG.ALL_CHANGES_SAVED'), false, 'success');
}
示例11: screen
private function screen()
{
$view =& SPFactory::View('view', true);
$view->setTemplate('config.help');
if (SPLoader::path('etc.repos.sobipro_core.repository', 'front', true, 'xml')) {
$repository = SPFactory::Instance('services.installers.repository');
$repository->loadDefinition(SPLoader::path("etc.repos.sobipro_core.repository", 'front', true, 'xml'));
try {
$repository->connect();
} catch (SPException $x) {
$view->assign(SPLang::e('REPO_ERR', $x->getMessage()), 'message');
}
try {
$response = $repository->help($repository->get('token'), SPRequest::cmd('mid'));
$view->assign($response, 'message');
} catch (SPException $x) {
$view->assign(SPLang::e('REPO_ERR', $x->getMessage()), 'message');
}
} else {
$view->assign(Sobi::Txt('MSG.HELP_ADD_CORE_REPO'), 'message');
}
$view->display();
}
示例12: execute
public function execute()
{
SPRequest::set('task', $this->_type . '.' . $this->_task);
if (strstr($this->_task, '.')) {
$task = explode('.', $this->_task);
$class = SPLoader::loadClass('opt.listing.' . $task[0], false, null, true);
} else {
$class = SPLoader::loadClass('opt.listing.' . $this->_task, false, null, true);
}
if ($class) {
$imp = class_implements($class);
if (is_array($imp) && in_array('SPListing', $imp)) {
/** @noinspection PhpIncludeInspection $compatibility */
$listing = new $class();
if (!isset($class::$compatibility)) {
define('SOBI_LEGACY_LISTING', true);
if (strstr($this->_task, '.')) {
$t = explode('.', $this->_task);
$listing->setTask($t[0]);
} else {
$listing->setTask($this->_task);
}
} else {
$listing->setTask($this->_task);
}
return $listing->execute();
} else {
Sobi::Error($this->name(), SPLang::e('SUCH_TASK_NOT_FOUND Wrong class definition', SPRequest::task()), SPC::NOTICE, 404, __LINE__, __FILE__);
}
} else {
/* case parent didn't registered this task, it was an error */
if (!parent::execute() && $this->name() == __CLASS__) {
Sobi::Error($this->name(), SPLang::e('SUCH_TASK_NOT_FOUND', SPRequest::task()), SPC::NOTICE, 404, __LINE__, __FILE__);
}
}
}
示例13: execute
/**
*/
public function execute()
{
/* parent class executes the plugins */
SPRequest::set('task', $this->_type . '.' . $this->_task);
switch ($this->_task) {
case 'front':
$this->getSections();
/** @var $view SPAdmPanelView */
$view = SPFactory::View('front');
/* load template config */
// $this->tplCfg( 'front' );
// $view->setConfig( $this->_tCfg, 'general' );
$view->determineTemplate('front', SPC::DEFAULT_TEMPLATE);
$view->assign($this->_sections, 'sections');
$view->display();
break;
default:
/* case parents or plugin didn't registered this task, it was an error */
if (!parent::execute()) {
Sobi::Error($this->name(), SPLang::e('SUCH_TASK_NOT_FOUND', SPRequest::task()), SPC::NOTICE, 404, __LINE__, __FILE__);
}
break;
}
}
示例14: view
protected function view()
{
/* determine template package */
$tplPackage = Sobi::Cfg('section.template', SPC::DEFAULT_TEMPLATE);
Sobi::ReturnPoint();
$this->_task = 'user';
if (!$this->_model) {
$this->setModel('section');
$this->_model->init(Sobi::Section());
}
$this->visible();
/* load template config */
$this->template();
$this->tplCfg($tplPackage);
/* get limits - if defined in template config - otherwise from the section config */
$eLimit = $this->tKey($this->template, 'entries_limit', Sobi::Cfg('list.entries_limit', 2));
$eInLine = $this->tKey($this->template, 'entries_in_line', Sobi::Cfg('list.entries_in_line', 2));
$url = array('sid' => SPRequest::sid(), 'task' => 'list.user');
if (SPRequest::int('uid')) {
$url['uid'] = SPRequest::int('uid');
$this->uid = (int) SPRequest::int('uid');
} else {
$this->uid = (int) Sobi::My('id');
}
$this->user = SPJoomlaUser::getBaseData((int) $this->uid);
if (!$this->user) {
throw new SPException(SPLang::e('UNAUTHORIZED_ACCESS'));
}
/* get the site to display */
$site = SPRequest::int('site', 1);
$eLimStart = ($site - 1) * $eLimit;
$eOrder = $this->parseOrdering('entries', 'eorder', $this->tKey($this->template, 'entries_ordering', Sobi::Cfg('list.entries_ordering', 'name.asc')));
$eCount = count($this->getEntries($eOrder, 0, 0, true, array('spo.owner' => $this->uid), true, Sobi::Section()));
$entries = $this->getEntries($eOrder, $eLimit, $eLimStart, true, array('spo.owner' => $this->uid), true, Sobi::Section());
// $eCount = count( $this->_getEntries( 0, 0, true ) );
// $entries = $this->_getEntries( $eLimit, $site );
$pn = SPFactory::Instance('helpers.pagenav_' . $this->tKey($this->template, 'template_type', 'xslt'), $eLimit, $eCount, $site, $url);
if (SPRequest::int('site', 0)) {
$url['site'] = SPRequest::int('site', 0);
}
SPFactory::header()->addCanonical(Sobi::Url($url, true, true, true));
/* handle meta data */
SPFactory::header()->objMeta($this->_model);
SPFactory::mainframe()->addToPathway(Sobi::Txt('UL.PATH_TITLE', array('username' => $this->user->username, 'user' => $this->user->name)), Sobi::Url('current'));
SPFactory::header()->addTitle(Sobi::Txt('UL.TITLE', array('username' => $this->user->username, 'user' => $this->user->name, 'section' => $this->_model->get('name'))), array(ceil($eCount / $eLimit), $site));
/* add pathway */
/* get view class */
$view = SPFactory::View('listing');
$view->assign($eLimit, '$eLimit');
$view->assign($eLimStart, '$eLimStart');
$view->assign($eCount, '$eCount');
$view->assign($eInLine, '$eInLine');
$view->assign($this->_task, 'task');
$view->assign($this->_model, 'section');
$view->setConfig($this->_tCfg, $this->template);
$view->setTemplate($tplPackage . '.' . $this->templateType . '.' . $this->template);
$view->assign($pn->get(), 'navigation');
$view->assign(SPFactory::user()->getCurrent(), 'visitor');
$view->assign($entries, 'entries');
Sobi::Trigger('UserListing', 'View', array(&$view));
$view->display();
}
示例15: fetchData
protected function fetchData($data)
{
if (is_array($data) && count($data)) {
$selected = array();
foreach ($data as $opt) {
/* check if such option exist at all */
if (!isset($this->optionsById[$opt])) {
throw new SPException(SPLang::e('FIELD_NO_SUCH_OPT', $opt, $this->name));
}
$selected[] = preg_replace('/^[a-z0-9]\\.\\-\\_/ei', null, $opt);
}
return $selected;
} else {
return array();
}
}