public function __construct($component) { if (!defined('SOBIPRO')) { define('SOBIPRO', true); defined('SOBI_CMS') || version_compare(JVERSION, '1.6.0', 'ge') ? define('SOBI_CMS', 'joomla16') : define('SOBI_CMS', 'joomla15'); defined('SOBI_TASK') || define('SOBI_TASK', 'task'); defined('SOBI_DEFLANG') || define('SOBI_DEFLANG', JFactory::getConfig()->get('config.language')); defined('SOBI_ACL') || define('SOBI_ACL', 'front'); defined('SOBI_ROOT') || define('SOBI_ROOT', JPATH_ROOT); defined('SOBI_MEDIA') || define('SOBI_MEDIA', implode(DIRECTORY_SEPARATOR, array(JPATH_ROOT, 'media', 'sobipro'))); defined('SOBI_MEDIA_LIVE') || define('SOBI_MEDIA_LIVE', JURI::root() . '/media/sobipro'); defined('SOBI_PATH') || define('SOBI_PATH', SOBI_ROOT . DIRECTORY_SEPARATOR . 'components' . DIRECTORY_SEPARATOR . 'com_sobipro'); defined('SOBI_LIVE_PATH') || define('SOBI_LIVE_PATH', 'components/com_sobipro'); $this->addFile(SOBI_PATH . DIRECTORY_SEPARATOR . 'lib' . DIRECTORY_SEPARATOR . 'base' . DIRECTORY_SEPARATOR . 'fs' . DIRECTORY_SEPARATOR . 'loader.php'); } SPLoader::loadController('interface'); SPLoader::loadClass('base.filter'); SPLoader::loadClass('base.request'); SPLoader::loadClass('base.const'); SPLoader::loadClass('base.factory'); SPLoader::loadClass('base.object'); SPLoader::loadClass('base.filter'); SPLoader::loadClass('base.request'); SPLoader::loadClass('sobi'); SPLoader::loadClass('base.config'); SPLoader::loadClass('base.exception'); SPLoader::loadClass('cms.base.lang'); SPLoader::loadClass('mlo.input'); parent::__construct($component); }
private function initialise() { static $loaded = false; if (!$loaded || true) { defined('DS') || define('DS', DIRECTORY_SEPARATOR); require_once JPATH_SITE . '/components/com_sobipro/lib/sobi.php'; Sobi::Initialise(); if (SOBI_CMS == 'joomla3') { SPFactory::header()->initBase(true)->addJsFile(array('sobipro', 'jqnc', 'adm.sobipro', 'adm.jnmenu', 'jquery-base64')); } else { SPFactory::header()->initBase(true)->addJsFile(array('sobipro', 'jquery', 'adm.sobipro', 'adm.jnmenu', 'jquery-migrate', 'jquery-base64'))->addCSSCode('#toolbar-box { display: block }'); } $loaded = true; SPLoader::loadClass('mlo.input'); SPLoader::loadClass('models.datamodel'); SPLoader::loadClass('models.dbobject'); SPLoader::loadModel('section'); $model = JModelLegacy::getInstance('MenusModelItem')->getItem(); self::$mid = $model->id; if (isset($model->params['SobiProSettings']) && strlen($model->params['SobiProSettings'])) { $this->params = json_decode(base64_decode($model->params['SobiProSettings'])); } $jsString = json_encode(array('component' => Sobi::Txt('SOBI_NATIVE_TASKS'), 'buttonLabel' => Sobi::Txt('SOBI_SELECT_FUNCTIONALITY'))); SPFactory::header()->addJsCode("SpStrings = {$jsString}; "); } }
public function saveToken($token) { $arrdef = SPFactory::Instance('types.array'); $def = $arrdef->fromXML($this->definition, 'repository'); $ndef = array(); $u = false; $rid = null; foreach ($def['repository'] as $k => $v) { if ($u) { $ndef['token'] = $token; } if ($k == 'id') { $rid = $v; } if ($k == 'url') { $u = true; } $ndef[$k] = $v; } $path = SPLoader::path("etc.repos.{$rid}.repository", 'front', true, 'xml'); $file = SPFactory::Instance('base.fs.file', $path); $xdef = SPFactory::Instance('types.array'); $file->content($xdef->toXML($ndef, 'repository')); $file->save(); }
protected function edit() { SPLoader::loadClass('html.tooltip'); $this->_type = 'entry_form'; $id = $this->get('entry.id'); if ($id) { $this->addHidden($id, 'entry.id'); } if (Sobi::Cfg('legacy.sigsiutree', false)) { /* load the SigsiuTree class */ $tree = SPLoader::loadClass('mlo.tree'); /* create new instance */ $tree = new $tree(Sobi::Cfg('list.categories_ordering')); $link = "javascript:SP_selectCat( '{sid}' )"; $tree->setHref($link); $tree->setTask('category.chooser'); $tree->disable(Sobi::Section()); $tree->init(Sobi::Section()); $head = SPFactory::header(); $params = array(); $params['URL'] = Sobi::Url(array('task' => 'category.parents', 'out' => 'json'), true, false, true); $params['MAXCATS'] = Sobi::Cfg('legacy.maxCats', '5'); $params['SEPARATOR'] = Sobi::Cfg('string.path_separator', ' > '); $head->addJsVarFile('edit', md5(Sobi::Section() . Sobi::Section(true) . serialize($params)), $params); } $type = $this->key('template_type', 'xslt'); if ($type != 'php' && Sobi::Cfg('global.disable_xslt', false)) { $type = 'php'; } if ($type == 'xslt') { $data = $this->entryData(false); $fields = $this->get('fields'); $f = array(); if (count($fields)) { foreach ($fields as $field) { if ($field->enabled('form')) { $pf = null; $pfm = null; if (!$field->get('isFree') && $field->get('fee') && !Sobi::Can('entry.payment.free')) { $pf = SPLang::currency($field->get('fee')); $pfm = Sobi::Txt('EN.FIELD_NOT_FREE_MSG', array('fee' => $pf, 'fieldname' => $field->get('name'))); } $f[$field->get('nid')] = array('_complex' => 1, '_data' => array('label' => array('_complex' => 1, '_data' => $field->get('name'), '_attributes' => array('lang' => Sobi::Lang(false), 'show' => $field->__get('showEditLabel'))), 'data' => array('_complex' => 1, '_xml' => 1, '_data' => $field->field(true)), 'description' => array('_complex' => 1, '_xml' => 1, '_data' => $field->get('description')), 'fee' => $pf, 'fee_msg' => $pfm), '_attributes' => array('id' => $field->get('id'), 'type' => $field->get('type'), 'suffix' => $field->get('suffix'), 'position' => $field->get('position'), 'required' => $field->get('required'), 'css_edit' => $field->get('cssClassEdit'), 'width' => $field->get('bsWidth'), 'css_class' => strlen($field->get('cssClass')) ? $field->get('cssClass') : 'spField')); } } } $f['save_button'] = array('_complex' => 1, '_data' => array('data' => array('_complex' => 1, '_xml' => 1, '_data' => SPHtml_Input::submit('save', Sobi::Txt('EN.SAVE_ENTRY_BT'))))); $f['cancel_button'] = array('_complex' => 1, '_data' => array('data' => array('_complex' => 1, '_xml' => 1, '_data' => SPHtml_Input::button('cancel', Sobi::Txt('EN.CANCEL_BT'), array('onclick' => 'SPcancelEdit();'))))); if (Sobi::Cfg('legacy.sigsiutree', false)) { $data['entry']['_data']['category_chooser'] = array('path' => array('_complex' => 1, '_xml' => 1, '_data' => SPHtml_Input::textarea('parent_path', $this->get('parent_path'), false, 500, 60, array('id' => 'entry.path', 'class' => 'inputbox required', 'readonly' => 'readonly'))), 'selected' => array('_complex' => 1, '_xml' => 1, '_data' => SPHtml_Input::text('entry.parent', $this->get('parents'), array('id' => 'entry.parent', 'size' => 15, 'maxlength' => 50, 'class' => 'inputbox required', 'readonly' => 'readonly', 'style' => 'text-align:center;')))); } $data['entry']['_data']['fields'] = array('_complex' => 1, '_data' => $f, '_attributes' => array('lang' => Sobi::Lang(false))); if (Sobi::Cfg('legacy.sigsiutree', false)) { $data['tree'] = array('_complex' => 1, '_xml' => 1, '_data' => SPLang::entities($tree->display(true), true)); } $this->_attr = $data; Sobi::Trigger($this->_type, ucfirst(__FUNCTION__), array(&$this->_attr)); } }
public function install() { $id = $this->xGetString('id'); $name = $this->xGetString('name'); if (SPLoader::dirPath('usr.templates.' . $id) && !SPRequest::bool('force')) { throw new SPException(SPLang::e('TEMPLATE_INST_DUPLICATE', $name) . ' ' . Sobi::Txt('FORCE_TPL_UPDATE', Sobi::Url(array('task' => 'extensions.install', 'force' => 1, 'root' => basename($this->root) . '/' . basename($this->xmlFile))))); } $requirements = $this->xGetChilds('requirements/*'); if ($requirements && $requirements instanceof DOMNodeList) { SPFactory::Instance('services.installers.requirements')->check($requirements); } $language = $this->xGetChilds('language/file'); $folder = @$this->xGetChilds('language/@folder')->item(0)->nodeValue; if ($language && $language instanceof DOMNodeList && $language->length) { $langFiles = array(); foreach ($language as $file) { $adm = false; if ($file->attributes->getNamedItem('admin')) { $adm = $file->attributes->getNamedItem('admin')->nodeValue == 'true' ? true : false; } $langFiles[$file->attributes->getNamedItem('lang')->nodeValue][] = array('path' => Sobi::FixPath("{$this->root}/{$folder}/" . trim($file->nodeValue)), 'name' => $file->nodeValue, 'adm' => $adm); } SPFactory::CmsHelper()->installLang($langFiles, false, true); } $path = SPLoader::dirPath('usr.templates.' . $id, 'front', false); if (SPRequest::bool('force')) { /** @var $from SPDirectory */ $from = SPFactory::Instance('base.fs.directory', $this->root); $from->moveFiles($path); } else { if (!SPFs::move($this->root, $path)) { throw new SPException(SPLang::e('CANNOT_MOVE_DIRECTORY', $this->root, $path)); } } if (!SPRequest::bool('force')) { $section = $this->xGetChilds('install'); if ($section instanceof DOMNodeList && $section->length) { $this->section($id); } } //05 Oct 2015 Kishore $exec = $this->xGetString('exec'); if ($exec && SPFs::exists($path . DS . $exec)) { include_once "{$path}/{$exec}"; } /** @var $dir SPDirectory */ $dir =& SPFactory::Instance('base.fs.directory', $path); $zip = array_keys($dir->searchFile('.zip', false)); if (count($zip)) { foreach ($zip as $file) { SPFs::delete($file); } } Sobi::Trigger('After', 'InstallTemplate', array($id)); $dir =& SPFactory::Instance('base.fs.directory', SPLoader::dirPath('tmp.install')); $dir->deleteFiles(); return Sobi::Txt('TP.TEMPLATE_HAS_BEEN_INSTALLED', array('template' => $name)); }
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))); } }
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; }
/** * @param int $limit * @param int $count * @param int $current * @param string $func * @param array $limits * @deprecated */ public function __construct($limit, $count, $current, $func, $box, $boxFunc, $limits = array(5, 10, 15, 25, 50)) { $this->limit = $limit; $this->count = $count; $this->current = $current ? $current : 1; $this->limits = is_array($limits) && count($limits) ? $limits : $this->limits; $this->func = $func; $this->boxFunc = $boxFunc; $this->box = $box; SPLoader::loadClass('mlo.input'); }
public function __construct() { $ident = SPRequest::cmd('session') ? SPRequest::cmd('ProgressMsg' . SPRequest::cmd('session'), null, 'cookie') : SPRequest::cmd('ProgressMsg', null, 'cookie'); $this->file = SPLoader::path('tmp.' . $ident, 'front', false, 'tmp'); if (SPFs::exists($this->file)) { $content = json_decode(SPFs::read($this->file), true); $this->message = $content['message']; $this->type = $content['type']; $this->progress = $content['progress']; $this->interval = $content['interval']; } }
/** * */ public function _display() { SPLoader::loadClass('html.tooltip'); switch ($this->get('task')) { case 'edit': $this->assign($this->languages(), 'languages-list'); case 'add': $this->edit(); break; } parent::display(); }
function getObjectInfo($id, $language = null) { $info = new JCommentsObjectInfo(); $app = JFactory::getApplication(); if (!$app->isAdmin()) { $db = JFactory::getDBO(); $query = "SELECT o.id, o.name, o.owner, o.parent, fd.baseData" . " FROM #__sobipro_object as o" . " LEFT JOIN #__sobipro_field_data AS fd ON o.id = fd.sid" . " JOIN #__sobipro_field AS f ON fd.fid = f.fid AND f.nid = 'field_name'" . " WHERE o.id = " . $id . " AND o.oType = 'entry'"; $db->setQuery($query); $row = $db->loadObject(); if (!empty($row)) { $sobiCore = JPATH_SITE . '/components/com_sobipro/lib/base/fs/loader.php'; if (is_file($sobiCore)) { if (!defined('SOBIPRO')) { $ver = new JVersion(); $ver = str_replace('.', null, $ver->RELEASE); if ($ver > '15') { $ver = '16'; } define('SOBI_CMS', 'joomla' . $ver); define('SOBIPRO', true); define('SOBI_TASK', 'task'); define('SOBI_DEFLANG', JFactory::getLanguage()->getDefault()); define('SOBI_ACL', 'front'); define('SOBI_ROOT', JPATH_ROOT); define('SOBI_MEDIA', implode(DS, array(JPATH_ROOT, 'media', 'sobipro'))); define('SOBI_MEDIA_LIVE', JURI::root() . '/media/sobipro'); define('SOBI_PATH', JPATH_ROOT . '/components/com_sobipro'); define('SOBI_LIVE_PATH', 'components/com_sobipro'); require_once JPATH_ROOT . '/components/com_sobipro/lib/base/fs/loader.php'; } SPLoader::loadClass('sobi'); SPLoader::loadClass('base.request'); SPLoader::loadClass('base.object'); SPLoader::loadClass('base.factory'); SPLoader::loadClass('base.mainframe'); SPLoader::loadClass('base.const'); SPLoader::loadClass('cms.base.mainframe'); SPLoader::loadClass('cms.base.lang'); $info->title = empty($row->name) ? isset($row->baseData) ? $row->baseData : '' : $row->name; $info->access = NULL; $info->userid = $row->owner; $info->link = Sobi::Url(array('title' => $row->name, 'pid' => $row->parent, 'sid' => $row->id)); } } } return $info; }
/** * This function have to add own string into the given array * Basically: $methods[ $this->id ] = "Some String To Output"; * Optionally the value can be also SobiPro Arr2XML array. * Check the documentation for more information * @param array $methods * @param SPEntry $entry * @param array $payment * @param bool $message * @return void */ public function PaymentMethodView(&$methods, $entry, &$payment, $message = false) { $data = SPFactory::registry()->loadDBSection('paypal_' . Sobi::Section())->get('paypal_' . Sobi::Section()); if (!count($data)) { $data = SPFactory::registry()->loadDBSection('paypal')->get('paypal'); } $cfg = SPLoader::loadIniFile('etc.paypal'); $rp = $cfg['general']['replace']; $to = $cfg['general']['replace'] == ',' ? '.' : ','; $amount = str_replace($rp, $to, $payment['summary']['sum_brutto']); $values = array('entry' => $entry, 'amount' => preg_replace('/[^0-9\\.,]/', null, $amount), 'ppurl' => SPLang::replacePlaceHolders($data['ppurl']['value'], $entry), 'ppemail' => SPLang::replacePlaceHolders($data['ppemail']['value'], $entry), 'pprurl' => SPLang::replacePlaceHolders($data['pprurl']['value'], $entry), 'ppcc' => SPLang::replacePlaceHolders($data['ppcc']['value'], $entry)); $expl = SPLang::replacePlaceHolders(SPLang::getValue('ppexpl', 'plugin', Sobi::Section()), $values); $subject = SPLang::replacePlaceHolders(SPLang::getValue('ppsubject', 'plugin', Sobi::Section()), $values); $values['expl'] = $expl; $values['subject'] = $subject; $values['ip'] = SPRequest::ip('REMOTE_ADDR', 0, 'SERVER'); $methods[$this->id] = array('content' => $message ? $this->raw($cfg, $values) : $this->content($cfg, $values), 'title' => Sobi::Txt('APP.PPP.PAY_TITLE')); }
public function install() { $id = $this->xGetString('id'); $name = $this->xGetString('name'); if (SPLoader::dirPath('usr.templates.' . $id) && !SPRequest::bool('force')) { throw new SPException(SPLang::e('TEMPLATE_INST_DUPLICATE', $name) . ' ' . Sobi::Txt('FORCE_TPL_UPDATE', Sobi::Url(array('task' => 'extensions.install', 'force' => 1, 'root' => basename($this->root) . '/' . basename($this->xmlFile))))); } $requirements = $this->xGetChilds('requirements/*'); if ($requirements && $requirements instanceof DOMNodeList) { SPFactory::Instance('services.installers.requirements')->check($requirements); } $path = SPLoader::dirPath('usr.templates.' . $id, 'front', false); if (SPRequest::bool('force')) { /** @var $from SPDirectory */ $from = SPFactory::Instance('base.fs.directory', $this->root); $from->moveFiles($path); } else { if (!SPFs::move($this->root, $path)) { throw new SPException(SPLang::e('CANNOT_MOVE_DIRECTORY', $this->root, $path)); } } if (!SPRequest::bool('force')) { $section = $this->xGetChilds('install'); if ($section instanceof DOMNodeList && $section->length) { $this->section($id); } } $exec = $this->xGetString('exec'); if ($exec && SPFs::exists($this->root . DS . $exec)) { include_once "{$this->root}/{$exec}"; } /** @var $dir SPDirectory */ $dir =& SPFactory::Instance('base.fs.directory', $path); $zip = array_keys($dir->searchFile('.zip', false)); if (count($zip)) { foreach ($zip as $file) { SPFs::delete($file); } } Sobi::Trigger('After', 'InstallTemplate', array($id)); $dir =& SPFactory::Instance('base.fs.directory', SPLoader::dirPath('tmp.install')); $dir->deleteFiles(); return Sobi::Txt('TP.TEMPLATE_HAS_BEEN_INSTALLED', array('template' => $name)); }
public function validate() { $type = $this->type == 'SobiProApp' ? 'application' : $this->type; $schemaDef = SPLoader::path('lib.services.installers.schemas.' . $type, 'front', false, 'xsd'); if (!SPFs::exists($schemaDef) || time() - filemtime($schemaDef) > 60 * 60 * 24 * 7) { $connection = SPFactory::Instance('services.remote'); $def = "https://xml.sigsiu.net/SobiPro/{$type}.xsd"; $connection->setOptions(array('url' => $def, 'connecttimeout' => 10, 'header' => false, 'returntransfer' => true, 'ssl_verifypeer' => false, 'ssl_verifyhost' => 2)); $schema =& SPFactory::Instance('base.fs.file', SPLoader::path('lib.services.installers.schemas.' . $type, 'front', false, 'xsd')); $file = $connection->exec(); if (!strlen($file)) { throw new SPException(SPLang::e('CANNOT_ACCESS_SCHEMA_DEF', $def)); } $schema->content($file); $schema->save(); $schemaDef = $schema->filename(); } if (!$this->definition->schemaValidate($schemaDef)) { throw new SPException(SPLang::e('CANNOT_VALIDATE_SCHEMA_DEF_AT', str_replace(SOBI_ROOT . DS, null, $this->xmlFile), $def)); } }
public function cachedView($xml, $template, $cacheId, $config = array()) { $this->_xml = $xml; Sobi::Trigger('Start', ucfirst(__FUNCTION__), array(&$this->_xml)); $templatePackage = SPLoader::translateDirPath(Sobi::Cfg('section.template'), 'templates'); $templateOverride = SPRequest::cmd('sptpl'); if ($templateOverride) { if (strstr($templateOverride, '.')) { $templateOverride = str_replace('.', '/', $templateOverride); } $template = $templateOverride . '.xsl'; } if (file_exists(Sobi::FixPath($templatePackage . '/' . $template))) { $template = Sobi::FixPath($templatePackage . '/' . $template); } else { $type = SPFactory::db()->select('oType', 'spdb_object', array('id' => SPRequest::sid()))->loadResult(); $template = $templatePackage . '/' . $type . '/' . $template; } SPFactory::registry()->set('current_template', $templatePackage); $this->_templatePath = $templatePackage; $this->_template = str_replace('.xsl', null, $template); $ini = array(); if (count($config)) { foreach ($config as $file) { $file = parse_ini_file($file, true); foreach ($file as $section => $keys) { if (isset($ini[$section])) { $ini[$section] = array_merge($ini[$section], $keys); } else { $ini[$section] = $keys; } } } } $this->setConfig($ini, SPRequest::task('get')); $this->parseXml(); $this->validateData($cacheId); Sobi::Trigger('After', ucfirst(__FUNCTION__), array(&$this->_xml)); }
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(); }
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__); } } }
* @author * Name: Sigrid Suski & Radek Suski, Sigsiu.NET GmbH * Email: sobi[at]sigsiu.net * Url: http://www.Sigsiu.NET * @copyright Copyright (C) 2006 - 2015 Sigsiu.NET GmbH (http://www.sigsiu.net). All rights reserved. * @license GNU/GPL Version 3 * This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License version 3 as published by the Free Software Foundation, and under the additional terms according section 7 of GPL v3. * See http://www.gnu.org/licenses/gpl.html and http://sobipro.sigsiu.net/licenses. * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. * $Date: 2015-02-19 13:24:35 +0100 (Thu, 19 Feb 2015) $ * $Revision: 4387 $ * $Author: Radek Suski $ * $HeadURL: file:///opt/svn/SobiPro/Component/branches/SobiPro-1.1/Site/opt/fields/adm/url.php $ */ defined('SOBIPRO') || exit('Restricted access'); SPLoader::loadClass('opt.fields.url'); /** * @author Radek Suski * @version 1.0 * @created 14-Sep-2009 11:37:11 */ class SPField_UrlAdm extends SPField_Url { /** * @var string */ public $cssClass = "inputbox"; public function onFieldEdit() { $this->allowedProtocols = is_array($this->allowedProtocols) ? implode(',', $this->allowedProtocols) : null; }
* @author * Name: Sigrid Suski & Radek Suski, Sigsiu.NET GmbH * Email: sobi[at]sigsiu.net * Url: http://www.Sigsiu.NET * @copyright Copyright (C) 2006 - 2015 Sigsiu.NET GmbH (http://www.sigsiu.net). All rights reserved. * @license GNU/LGPL Version 3 * This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License version 3 as published by the Free Software Foundation, and under the additional terms according section 7 of GPL v3. * See http://www.gnu.org/licenses/lgpl.html and http://sobipro.sigsiu.net/licenses. * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. * $Date$ * $Revision$ * $Author$ * $HeadURL$ */ defined('SOBIPRO') || exit('Restricted access'); SPLoader::loadController('controller'); /** * @author Radek Suski * @version 1.0 * @created 10-Jan-2009 4:38:03 PM */ class SPFront extends SPController { /** * @var array */ private $_sections = array(); /** * @var string */ protected $_defTask = 'front';
* Name: Sigrid Suski & Radek Suski, Sigsiu.NET GmbH * Email: sobi[at]sigsiu.net * Url: http://www.Sigsiu.NET * @copyright Copyright (C) 2006 - 2015 Sigsiu.NET GmbH (http://www.sigsiu.net). All rights reserved. * @license GNU/GPL Version 3 * This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License version 3 as published by the Free Software Foundation, and under the additional terms according section 7 of GPL v3. * See http://www.gnu.org/licenses/gpl.html and http://sobipro.sigsiu.net/licenses. * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. * $Date: 2015-02-19 13:24:35 +0100 (Thu, 19 Feb 2015) $ * $Revision: 4387 $ * $Author: Radek Suski $ * $HeadURL: file:///opt/svn/SobiPro/Component/branches/SobiPro-1.1/Site/opt/listing/user.php $ */ defined('SOBIPRO') || exit('Restricted access'); SPLoader::loadController('listing_interface'); SPLoader::loadController('section'); /** * @author Radek Suski * @version 1.0 * @created 16-Aug-2010 16:14:15 */ class SPUserListing extends SPSectionCtrl implements SPListing { /** @var string */ protected $_type = 'listing'; /** @var string */ public static $compatibility = '1.1'; /** @var int */ protected $uid = 0; /** @var stdClass */ protected $user = 0;
<?php /** * @package: SobiPro Component for Joomla! * @author * Name: Sigrid Suski & Radek Suski, Sigsiu.NET GmbH * Email: sobi[at]sigsiu.net * Url: http://www.Sigsiu.NET * @copyright Copyright (C) 2006 - 2015 Sigsiu.NET GmbH (https://www.sigsiu.net). All rights reserved. * @license GNU/GPL Version 3 * This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License version 3 as published by the Free Software Foundation, and under the additional terms according section 7 of GPL v3. * See http://www.gnu.org/licenses/gpl.html and https://www.sigsiu.net/licenses. * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. */ defined('SOBIPRO') || exit('Restricted access'); SPLoader::loadClass('opt.fields.radio'); /** * @author Radek Suski * @version 1.0 * @created 27-Nov-2009 17:10:15 */ class SPField_ChbxGr extends SPField_Radio implements SPFieldInterface { /** * @var string */ protected $cssClass = 'spClassCheckbox'; /** * @var string */ protected $cssClassView = 'spClassViewCheckbox'; /** * @var string */ protected $cssClassEdit = 'spClassEditCheckbox'; /** * @var string */ protected $cssClassSearch = 'spClassSearchCheckbox';
public static function validateVisibility(&$data) { SPLoader::loadClass('env.browser'); $humanity = SPBrowser::getInstance()->get('humanity'); $display = Sobi::Cfg('mail_protection.show'); if (!($humanity >= $display)) { $data['_data'] = array(); } }
* @package: SobiPro Library * @author * Name: Sigrid Suski & Radek Suski, Sigsiu.NET GmbH * Email: sobi[at]sigsiu.net * Url: https://www.Sigsiu.NET * @copyright Copyright (C) 2006 - 2015 Sigsiu.NET GmbH (https://www.sigsiu.net). All rights reserved. * @license GNU/LGPL Version 3 * This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License version 3 * as published by the Free Software Foundation, and under the additional terms according section 7 of GPL v3. * See http://www.gnu.org/licenses/lgpl.html and https://www.sigsiu.net/licenses. * * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. */ defined('SOBIPRO') || exit('Restricted access'); SPLoader::loadView('view', true); /** * @author Radek Suski * @version 1.0 * @created 14-Jan-2009 2:44:34 PM */ class SPAclView extends SPAdmView { /** * */ public function display() { switch ($this->get('task')) { case 'add': case 'edit':
/** * @param $directory * @return array */ private function getAjaxFiles($directory) { $secret = md5(Sobi::Cfg('secret')); $coordinates = null; $dirNameHash = str_replace('directory://', null, $directory); if (strstr($dirNameHash, '::coordinates://')) { $struct = explode('::coordinates://', $dirNameHash); $dirNameHash = $struct[0]; $coordinates = $struct[1]; } $data = $dirNameHash; $dirName = SPLoader::dirPath("tmp.files.{$secret}.{$dirNameHash}", 'front', false); $files = scandir($dirName); return array($data, $dirName, $files, $coordinates); }
* @author * Name: Sigrid Suski & Radek Suski, Sigsiu.NET GmbH * Email: sobi[at]sigsiu.net * Url: http://www.Sigsiu.NET * @copyright Copyright (C) 2006 - 2015 Sigsiu.NET GmbH (http://www.sigsiu.net). All rights reserved. * @license GNU/GPL Version 3 * This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License version 3 as published by the Free Software Foundation, and under the additional terms according section 7 of GPL v3. * See http://www.gnu.org/licenses/gpl.html and http://sobipro.sigsiu.net/licenses. * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. * $Date$ * $Revision$ * $Author$ * $HeadURL$ */ defined('SOBIPRO') || exit('Restricted access'); SPLoader::loadClass('opt.fields.chbxgroup'); /** * @author Radek Suski * @version 1.0 * @created 27-Nov-2009 17:10:03 */ class SPField_ChbxGrAdm extends SPField_ChbxGr { public function save(&$attr) { static $lang = null; static $defLang = null; if (!$lang) { $lang = Sobi::Lang(); $defLang = Sobi::DefLang(); }
* Name: Sigrid Suski & Radek Suski, Sigsiu.NET GmbH * Email: sobi[at]sigsiu.net * Url: http://www.Sigsiu.NET * @copyright Copyright (C) 2006 - 2014 Sigsiu.NET GmbH (http://www.sigsiu.net). All rights reserved. * @license GNU/GPL Version 3 * This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License version 3 * as published by the Free Software Foundation, and under the additional terms according section 7 of GPL v3. * See http://www.gnu.org/licenses/gpl.html and http://sobipro.sigsiu.net/licenses. * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. * $Date: 2015-02-04 18:50:21 +0100 (Wed, 04 Feb 2015) $ * $Revision: 49 $ * $Author: szymon $ */ defined('_JEXEC') || die('Direct Access to this location is not allowed.'); SPLoader::loadView('section'); /** * @author Radek Suski * @version 1.0 * @created 04-Apr-2011 10:13:08 */ class SPEntriesDJMTView extends SPSectionView { public function getEntires() { $data = array(); $entries = $this->get('entries'); $params = $this->get('params'); if (count($entries)) { $this->loadNonStaticData($entries); foreach ($entries as $eid) {
/** * @todo Enter description here... * * @param array $ordering * @param string $type * @param string $id * @param string $fname * @return string */ public static function tableHeader($ordering, $type, $id = 'sid', $fname = 'order', $def = 'position.asc') { $header = array(); $current = SPFactory::user()->getUserState($type . '.order', $fname, $def); if (strstr($current, '.')) { $current = explode('.', $current); $newDirect = trim($current[1]) == 'asc' ? 'desc' : 'asc'; $current = $current[0]; } $sid = SPRequest::sid() ? SPRequest::sid() : SPRequest::int('pid'); if (is_array($ordering) && count($ordering)) { foreach ($ordering as $order => $active) { $class = null; $params = array(); if (is_array($active)) { $params = $active; $active = $active['type']; } switch ($active) { case SP_TBL_HEAD_RAW: $header[$order] = Sobi::Txt($type . '.header_' . $order); break; case 1: case 3: case 4: case 5: case 6: $direction = 'asc'; $ico = null; $aico = null; if (isset($params['order'])) { $sortBy = $params['order']; } else { $sortBy = $order; } $label = Sobi::Txt($type . '.header_' . $order); $title = Sobi::Txt($type . '.header_order_by_' . $order); if ($sortBy == $current) { $class = "class=\"selected\""; $ico = Sobi::Cfg('list_icons.sort_direction_' . ($newDirect == 'asc' ? 'desc' : 'asc')); $ico = " <img src=\"{$ico}\"/> "; $direction = $newDirect; } if ($active == SP_TBL_HEAD_SORTABLE_FIELD) { $label = $params['label']; $title = Sobi::Txt('LIST.ORDER_BY_FIELD', array('field' => $label)); } if ($active == SP_TBL_HEAD_STATE) { SPLoader::loadClass('html.tooltip'); $msg = Sobi::Txt('LIST.MAKE_SELECTION'); $onclk = " onclick=\"if( document.adminForm.boxchecked.value == 0 ) { alert( '{$msg}' ); } else { submitbutton( '{$type}.publish' ); }\""; $url = "#"; $ai = Sobi::Cfg('list_icons.enable'); $s = Sobi::Txt('LIST.ENABLE_S', array('type' => Sobi::Txt(strtoupper($type)))); $a = Sobi::Txt($type . '.enable_expl'); $aico = SPTooltip::toolTip($a, $s, $ai); $aico = " <span class=\"headerStateIcons\"><a href=\"{$url}\"{$onclk}>{$aico}</a></span>"; $ui = Sobi::Cfg('list_icons.disable'); $s = Sobi::Txt('LIST.DISABLE_S', array('type' => Sobi::Txt(strtoupper($type)))); $a = Sobi::Txt($type . '.disable_expl'); $uico = SPTooltip::toolTip($a, $s, $ui); $onclk = " onclick=\"if( document.adminForm.boxchecked.value == 0 ) { alert( '{$msg}' ); } else { submitbutton( '{$type}.hide' ); }\""; $uico = " <span class=\"headerStateIcons\"><a href=\"{$url}\"{$onclk}>{$uico}</a></span>"; $aico .= $uico; } if ($active == SP_TBL_HEAD_APPROVAL) { SPLoader::loadClass('html.tooltip'); $msg = Sobi::Txt('LIST.MAKE_SELECTION'); $onclk = " onclick=\"if( document.adminForm.boxchecked.value == 0 ) { alert( '{$msg}' ); } else { submitbutton( '{$type}.approve' ); }\""; $url = "#"; $ai = Sobi::Cfg('list_icons.approve'); $s = Sobi::Txt($type . '.approve'); $a = Sobi::Txt($type . '.approve_expl'); $aico = SPTooltip::toolTip($a, $s, $ai); $aico = " <span class=\"headerAppIcons\"><a href=\"{$url}\"{$onclk}>{$aico}</a></span>"; $ui = Sobi::Cfg('list_icons.disable'); $s = Sobi::Txt($type . '.unapprove'); $a = Sobi::Txt($type . '.unapprove_expl'); $uico = SPTooltip::toolTip($a, $s, $ui); $onclk = " onclick=\"if( document.adminForm.boxchecked.value == 0 ) { alert( '{$msg}' ); } else { submitbutton( '{$type}.unapprove' ); }\""; $uico = " <span class=\"headerAppIcons\"><a href=\"{$url}\"{$onclk}>{$uico}</a></span>"; $aico .= $uico; } if ($active == SP_TBL_HEAD_ORDER) { SPLoader::loadClass('html.tooltip'); $url = "#"; $onclk = " onclick=\"SPReorder( '{$type}', {$sid} );\" "; $aico = " <span class=\"headerStateIcons\"><a href=\"{$url}\" title=\"{$a}\">{$aico}</a></span>"; $ui = Sobi::Cfg('list_icons.order'); $s = Sobi::Txt($type . '.save_order'); $a = Sobi::Txt($type . '.save_order_expl'); $uico = SPTooltip::toolTip($a, $s, $ui); $uico = " <span class=\"headerOrderIcon\"><a href=\"{$url}\"{$onclk}>{$uico}</a></span>"; $aico .= $uico; } $header[$order] = "<a {$class} href=\"javascript:SPOrdering( '{$sortBy}','{$direction}', '{$fname}', {$sid} );\" title=\"{$title}\">{$label}</a> {$ico}{$aico}"; break; case SP_TBL_HEAD_SELECTION_BOX: $name = Sobi::Txt($type . '.header_toggle'); $header[$order] = "<input type=\"checkbox\" name=\"toggle\" id=\"toggel_{$id}\" title=\"{$name}\" value=\"1\" onclick=\"SPCheckListElements('{$id}', this );\"/>"; break; } } } return $header; }
/** * @deprecated since 1.1 replaced by {@link #Initialise()} * @param int $sid - section id * @param null $root - root of Joomla! * @param null $lang - language * @return null */ public static function Init($root = null, $lang = null, $sid = 0) { static $loaded = false; if (!$loaded) { if (!defined('SOBI_CMS')) { define('SOBI_CMS', version_compare(JVERSION, '3.0.0', 'ge') ? 'joomla3' : (version_compare(JVERSION, '1.6.0', 'ge') ? 'joomla16' : 'joomla15')); } defined('SOBIPRO') || define('SOBIPRO', true); defined('SOBI_TASK') || define('SOBI_TASK', 'task'); defined('SOBI_DEFLANG') || define('SOBI_DEFLANG', $lang); defined('SOBI_ACL') || define('SOBI_ACL', 'front'); defined('SOBI_ROOT') || define('SOBI_ROOT', $root); defined('SOBI_MEDIA') || define('SOBI_MEDIA', implode('/', array($root, 'media', 'sobipro'))); defined('SOBI_PATH') || define('SOBI_PATH', SOBI_ROOT . '/components/com_sobipro'); defined('SOBI_LIVE_PATH') || define('SOBI_LIVE_PATH', 'components/com_sobipro'); require_once SOBI_PATH . '/lib/base/fs/loader.php'; SPLoader::loadController('sobipro'); SPLoader::loadController('interface'); SPLoader::loadClass('base.exception'); SPLoader::loadClass('base.const'); SPLoader::loadClass('base.object'); SPLoader::loadClass('base.filter'); SPLoader::loadClass('base.request'); SPLoader::loadClass('cms.base.lang'); SPLoader::loadClass('models.dbobject'); SPLoader::loadClass('base.factory'); SPLoader::loadClass('base.config'); SPLoader::loadClass('cms.base.fs'); // in case it is a CLI call if (isset($_SERVER['REQUEST_URI'])) { SPFactory::config()->set('live_site', JURI::root()); } $loaded = true; } if ($sid) { $section = null; if ($sid) { $path = array(); $id = $sid; $path[] = (int) $id; while ($id > 0) { try { $id = SPFactory::db()->select('pid', 'spdb_relations', array('id' => $id))->loadResult(); if ($id) { $path[] = (int) $id; } } catch (SPException $x) { Sobi::Error('ExtCoreCtrl', SPLang::e('DB_REPORTS_ERR', $x->getMessage()), SPC::ERROR, 500, __LINE__, __FILE__); } } $path = array_reverse($path); $section = SPFactory::object($path[0]); } /* set current section in the registry */ SPFactory::registry()->set('current_section', $section->id); $_config =& SPFactory::config(); /* load basic configuration settings */ $_config->addIniFile('etc.config', true); $_config->addTable('spdb_config', $sid); /* initialise interface config setting */ SPFactory::mainframe()->getBasicCfg(); /* initialise config */ $_config->init(); } }
/** * */ private function mimeFromExt() { $ext = SPFs::getExt($this->_path); if (!count(self::$_exts)) { self::$_exts = SPLoader::loadIniFile('etc.mime', false); } if (!isset(self::$_exts[$ext])) { Sobi::Error('FileInfo', SPLang::e('Cannot determine the right file type from extension'), SPC::WARNING, 0); } else { $this->_mime = self::$_exts[$ext]; } }
/** * */ public function displayForm() { Sobi::Trigger('Display', $this->name(), array(&$this)); $action = $this->key('action'); echo '<div class="SobiPro" id="SobiPro">' . "\n"; if ($this->get('_compatibility')) { echo SPFactory::AdmToolbar()->render(); echo $this->legacyMessages(); } echo $action ? "\n<form action=\"{$action}\" method=\"post\" name=\"adminForm\" id=\"SPAdminForm\" enctype=\"multipart/form-data\" accept-charset=\"utf-8\" >\n" : null; foreach ($this->_templates as $tpl) { $template = SPLoader::path($tpl, 'adm.template'); if (!$template) { $tpl = SPLoader::translatePath($tpl, 'adm.template', false); Sobi::Error($this->name(), SPLang::e('CANNOT_LOAD_TEMPLATE_AT', $tpl), SPC::ERROR, 500, __LINE__, __FILE__); } else { include $template; } } if (count($this->_hidden)) { $this->_hidden[SPFactory::mainframe()->token()] = 1; $prefix = null; if (!$this->get('_compatibility')) { $prefix = 'SP_'; } foreach ($this->_hidden as $name => $value) { echo "\n<input type=\"hidden\" name=\"{$name}\" id=\"{$prefix}{$name}\" value=\"{$value}\"/>"; } } echo $action ? "\n</form>\n" : null; echo '</div>'; Sobi::Trigger('AfterDisplay', $this->name()); }