当前位置: 首页>>代码示例>>PHP>>正文


PHP SPRequest::cmd方法代码示例

本文整理汇总了PHP中SPRequest::cmd方法的典型用法代码示例。如果您正苦于以下问题:PHP SPRequest::cmd方法的具体用法?PHP SPRequest::cmd怎么用?PHP SPRequest::cmd使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SPRequest的用法示例。


在下文中一共展示了SPRequest::cmd方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: progress

 public function progress($percent, $message = null, $type = SPC::INFO_MSG, $interval = 1000)
 {
     $this->id = SPRequest::cmd('ProgressMsg', null, 'cookie');
     $percent = ceil($percent);
     $this->msg = strlen($message) ? $message : $this->msg;
     $this->status($message, $percent, $interval, $type);
 }
开发者ID:ranrolls,项目名称:ras-full-portal,代码行数:7,代码来源:progress.php

示例2: upload

 protected function upload()
 {
     $ident = SPRequest::cmd('ident', null, 'post');
     $data = SPRequest::file($ident, 'tmp_name');
     $secret = md5(Sobi::Cfg('secret'));
     if ($data) {
         $properties = SPRequest::file($ident);
         $fileName = md5(SPRequest::file($ident, 'name') . time() . $secret);
         $path = SPLoader::dirPath("tmp.files.{$secret}", 'front', false) . '/' . $fileName;
         /** @var $file SPFile */
         $file = SPFactory::Instance('base.fs.file');
         if (!$file->upload($data, $path)) {
             $this->message(array('type' => 'error', 'text' => SPLang::e('CANNOT_UPLOAD_FILE'), 'id' => ''));
         }
         $path = $file->getPathname();
         $type = $this->check($path);
         $properties['tmp_name'] = $path;
         SPFs::write($path . '.var', SPConfig::serialize($properties));
         $response = array('type' => 'success', 'text' => Sobi::Txt('FILE_UPLOADED', $properties['name'], $type), 'id' => 'file://' . $fileName, 'data' => array('name' => $properties['name'], 'type' => $properties['type'], 'size' => $properties['size']));
     } else {
         $response = array('type' => 'error', 'text' => SPLang::e('CANNOT_UPLOAD_FILE_NO_DATA'), 'id' => '');
     }
     //		$field = SPRequest::cmd( 'field', null );
     $this->message($response);
 }
开发者ID:pelloq1,项目名称:SobiPro,代码行数:25,代码来源:file.php

示例3: display

 /**
  * @param    string    The control name
  * @param    string    The contents of the text area
  * @param    string    The width of the text area (px or %)
  * @param    string    The height of the text area (px or %)
  * @param    boolean    True and the editor buttons will be displayed
  * @param    array    Associative array of editor parameters
  * @return string
  */
 public function display($name, $html, $width, $height, $buttons, $params)
 {
     if (SPRequest::cmd('format') != 'raw') {
         // public function display($name, $html, $width, $height, $col, $row, $buttons = true, $id = null, $asset = null, $author = null, $params = array())
         $editor = JEditor::getInstance(JFactory::getConfig()->get('editor'));
         //			JFactory::getEditor()->display( $name, $html, $width, $height, '75', '20', $buttons, $params );
         return $editor->display($name, $html, $width, $height, 75, 20, $buttons, null, null, null, $params);
     }
 }
开发者ID:kishoreweblabs,项目名称:SobiPro,代码行数:18,代码来源:editor.php

示例4: execute

 public function execute()
 {
     $function = SPRequest::cmd('function');
     SPFactory::header()->addJsFile('jnmenu', true);
     SPLang::load('com_sobipro.sys');
     if (!$function) {
         $this->listFunctions();
     } else {
         $this->loadFunction($function);
     }
 }
开发者ID:kishoreweblabs,项目名称:SobiPro,代码行数:11,代码来源:menu.php

示例5: view

 /**
  */
 protected function view()
 {
     /* determine template package */
     $tplPackage = Sobi::Cfg('section.template', SPC::DEFAULT_TEMPLATE);
     Sobi::ReturnPoint();
     /* 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));
     $cInLine = $this->tKey($this->template, 'categories_in_line', Sobi::Cfg('list.categories_in_line', 2));
     $cLim = $this->tKey($this->template, 'categories_limit', -1);
     $entriesRecursive = $this->tKey($this->template, 'entries_recursive', Sobi::Cfg('list.entries_recursive', false));
     /* get the site to display */
     $site = SPRequest::int('site', 1);
     $eLimStart = ($site - 1) * $eLimit;
     /* get the right ordering */
     $eOrder = $this->parseOrdering('entries', 'eorder', $this->tKey($this->template, 'entries_ordering', Sobi::Cfg('list.entries_ordering', 'name.asc')));
     $cOrder = $this->parseOrdering('categories', 'corder', $this->tKey($this->template, 'categories_ordering', Sobi::Cfg('list.categories_ordering', 'name.asc')));
     $orderings = array('entries' => $eOrder, 'categories' => $cOrder);
     /* get entries */
     $eCount = count($this->getEntries($eOrder, 0, 0, true, null, $entriesRecursive));
     $entries = $this->getEntries($eOrder, $eLimit, $eLimStart, false, null, $entriesRecursive);
     $categories = array();
     if ($cLim) {
         $categories = $this->getCats($cOrder, $cLim);
     }
     /* create page navigation */
     $url = array('sid' => SPRequest::sid(), 'title' => Sobi::Cfg('sef.alias', true) ? $this->_model->get('nid') : $this->_model->get('name'));
     if (SPRequest::cmd('sptpl')) {
         $url['sptpl'] = SPRequest::cmd('sptpl');
     }
     $pnc = SPLoader::loadClass('helpers.pagenav_' . $this->tKey($this->template, 'template_type', 'xslt'));
     /* @var SPPageNavXSLT $pn */
     $pn = new $pnc($eLimit, $eCount, $site, array('sid' => SPRequest::sid(), 'title' => Sobi::Cfg('sef.alias', true) ? $this->_model->get('nid') : $this->_model->get('name')));
     /* handle meta data */
     SPFactory::header()->objMeta($this->_model);
     /* add pathway */
     SPFactory::mainframe()->addObjToPathway($this->_model, array(ceil($eCount / $eLimit), $site));
     $this->_model->countVisit();
     /* get view class */
     //		$class = SPLoader::loadView( $this->_type );
     $view = SPFactory::View($this->_type);
     //		$view = new $class( $this->template );
     $view->assign($eLimit, '$eLimit')->assign($eLimStart, '$eLimStart')->assign($eCount, '$eCount')->assign($cInLine, '$cInLine')->assign($eInLine, '$eInLine')->assign($this->_task, 'task')->assign($this->_model, $this->_type)->setConfig($this->_tCfg, $this->template)->setTemplate($tplPackage . '.' . $this->templateType . '.' . $this->template)->assign($categories, 'categories')->assign($pn->get(), 'navigation')->assign(SPFactory::user()->getCurrent(), 'visitor')->assign($entries, 'entries')->assign($orderings, 'orderings');
     Sobi::Trigger($this->name(), 'View', array(&$view));
     $view->display($this->_type);
 }
开发者ID:ranrolls,项目名称:ras-full-portal,代码行数:51,代码来源:section.php

示例6: messages

 protected function messages()
 {
     $messages = SPFactory::message()->getReports(SPRequest::cmd('spsid'));
     $response = array();
     if (count($messages)) {
         foreach ($messages as $type => $content) {
             if (count($content)) {
                 foreach ($content as $message) {
                     $response[] = array('type' => $type, 'text' => $message);
                 }
             }
         }
     }
     $this->response(null, null, false, SPC::INFO_MSG, array('messages' => $response));
 }
开发者ID:kishoreweblabs,项目名称:SobiPro,代码行数:15,代码来源:txt.php

示例7: cachedView

 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));
 }
开发者ID:kishoreweblabs,项目名称:SobiPro,代码行数:39,代码来源:cache.php

示例8: 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();
 }
开发者ID:ranrolls,项目名称:ras-full-portal,代码行数:23,代码来源:help.php

示例9: addHead

 /**
  * @param array $head
  * @return bool
  */
 public function addHead($head)
 {
     if (strlen(SPRequest::cmd('format')) && SPRequest::cmd('format') != 'html') {
         return true;
     }
     /** @var JDocument $document */
     $document = JFactory::getDocument();
     $c = 0;
     if (count($head)) {
         $document->addCustomTag("\n\t<!--  SobiPro Head Tags Output  -->\n");
         $document->addCustomTag("\n\t<script type=\"text/javascript\">/*\n<![CDATA[*/ \n\tvar SobiProUrl = '" . Sobi::FixPath(self::Url(array('task' => '%task%'), true, false, true)) . "'; \n\tvar SobiProSection = " . (Sobi::Section() ? Sobi::Section() : 0) . "; \n\tvar SPLiveSite = '" . Sobi::Cfg('live_site') . "'; \n/*]]>*/\n</script>\n");
         if (defined('SOBI_ADM_PATH')) {
             $document->addCustomTag("\n\t<script type=\"text/javascript\">/* <![CDATA[ */ \n\tvar SobiProAdmUrl = '" . Sobi::FixPath(Sobi::Cfg('live_site') . SOBI_ADM_FOLDER . '/' . self::Url(array('task' => '%task%'), true, false)) . "'; \n/* ]]> */</script>\n");
         }
         foreach ($head as $type => $code) {
             switch ($type) {
                 default:
                     if (count($code)) {
                         foreach ($code as $html) {
                             ++$c;
                             $document->addCustomTag($html);
                         }
                     }
                     break;
                 case 'robots':
                 case 'author':
                     $document->setMetaData($type, implode(', ', $code));
                     //						$document->setHeadData( array( $type => implode( ', ', $code ) ) );
                     break;
                 case 'keywords':
                     $metaKeys = trim(implode(', ', $code));
                     if (Sobi::Cfg('meta.keys_append', true)) {
                         $metaKeys .= Sobi::Cfg('string.meta_keys_separator', ',') . $document->getMetaData('keywords');
                     }
                     $metaKeys = explode(Sobi::Cfg('string.meta_keys_separator', ','), $metaKeys);
                     if (count($metaKeys)) {
                         $metaKeys = array_unique($metaKeys);
                         foreach ($metaKeys as $i => $p) {
                             if (strlen(trim($p))) {
                                 $metaKeys[$i] = trim($p);
                             } else {
                                 unset($metaKeys[$i]);
                             }
                         }
                         $metaKeys = implode(', ', $metaKeys);
                     } else {
                         $metaKeys = null;
                     }
                     $document->setMetadata('keywords', $metaKeys);
                     break;
                 case 'description':
                     $metaDesc = implode(Sobi::Cfg('string.meta_desc_separator', ' '), $code);
                     if (strlen($metaDesc)) {
                         if (Sobi::Cfg('meta.desc_append', true)) {
                             $metaDesc .= $this->getMetaDescription($document);
                         }
                         $metaDesc = explode(' ', $metaDesc);
                         if (count($metaDesc)) {
                             foreach ($metaDesc as $i => $p) {
                                 if (strlen(trim($p))) {
                                     $metaDesc[$i] = trim($p);
                                 } else {
                                     unset($metaDesc[$i]);
                                 }
                             }
                             $metaDesc = implode(' ', $metaDesc);
                         } else {
                             $metaDesc = null;
                         }
                         $document->setDescription($metaDesc);
                     }
                     break;
             }
         }
         $jsUrl = Sobi::FixPath(self::Url(array('task' => 'txt.js', 'format' => 'json'), true, false, false));
         $document->addCustomTag("\n\t<script type=\"text/javascript\" src=\"" . str_replace('&', '&amp;', $jsUrl) . "\"></script>\n");
         $c++;
         $document->addCustomTag("\n\t<!--  SobiPro ({$c}) Head Tags Output -->\n");
         // we would like to set our own canonical please :P
         // https://groups.google.com/forum/?fromgroups=#!topic/joomla-dev-cms/sF3-JBQspQU
         if (count($document->_links)) {
             foreach ($document->_links as $index => $link) {
                 if ($link['relation'] == 'canonical') {
                     unset($document->_links[$index]);
                 }
             }
         }
     }
 }
开发者ID:kishoreweblabs,项目名称:SobiPro,代码行数:93,代码来源:mainframe.php

示例10: save

 /**
  * Save existing field
  */
 protected function save($clone = false)
 {
     $sets = array();
     if (!SPFactory::mainframe()->checkToken()) {
         Sobi::Error('Token', SPLang::e('UNAUTHORIZED_ACCESS_TASK', SPRequest::task()), SPC::ERROR, 403, __LINE__, __FILE__);
     }
     $fid = SPRequest::int('fid');
     $field = SPFactory::Model('field', true);
     if ($fid) {
         $f = $this->loadField($fid);
         $field->extend($f);
     } else {
         $field->loadType(SPRequest::cmd('field_fieldType'));
     }
     $nid = SPRequest::cmd('field_nid');
     if (!$nid || !strstr($nid, 'field_')) {
         /** give me my spaces back!!! */
         $nid = strtolower(str_replace('-', '_', SPLang::nid('field_' . SPRequest::string('field_name'))));
         SPRequest::set('field_nid', $nid);
     }
     $this->getRequest();
     $this->validate($field);
     if ($clone || !$fid) {
         try {
             $fid = $field->saveNew($this->attr);
             $field->save($this->attr);
         } catch (SPException $x) {
             $this->response(Sobi::Url(array('task' => 'field.edit', 'fid' => $fid, 'sid' => SPRequest::sid())), $x->getMessage(), false, SPC::ERROR_MSG);
         }
     } else {
         try {
             $field->save($this->attr);
         } catch (SPException $x) {
             $this->response(Sobi::Url(array('task' => 'field.edit', 'fid' => $fid, 'sid' => SPRequest::sid())), $x->getMessage(), false, SPC::ERROR_MSG);
         }
     }
     $alias = $field->get('nid');
     $fieldSets = $field->get('sets');
     if (is_array($fieldSets) && count($fieldSets)) {
         $sets = array_merge($fieldSets, $sets);
     }
     $sets['fid'] = $field->get('fid');
     $sets['field.nid'] = $alias;
     /* in case we are changing the sort by field */
     if (Sobi::Cfg('list.entries_ordering') == $alias && $field->get('nid') != $alias) {
         SPFactory::config()->saveCfg('list.entries_ordering', $field->get('nid'));
     }
     SPFactory::cache()->cleanSection();
     if ($this->_task == 'apply' || $clone) {
         if ($clone) {
             $msg = Sobi::Txt('FM.FIELD_CLONED');
             $this->response(Sobi::Url(array('task' => 'field.edit', 'fid' => $fid, 'sid' => SPRequest::sid())), $msg);
         } else {
             $msg = Sobi::Txt('MSG.ALL_CHANGES_SAVED');
             $this->response(Sobi::Url(array('task' => 'field.edit', 'fid' => $fid, 'sid' => SPRequest::sid())), $msg, false, 'success', array('sets' => $sets));
         }
     } else {
         $this->response(Sobi::Back(), Sobi::Txt('MSG.ALL_CHANGES_SAVED'));
     }
 }
开发者ID:kishoreweblabs,项目名称:SobiPro,代码行数:63,代码来源:field.php

示例11: session

 protected function session(&$ssid)
 {
     /* if it wasn't new search */
     $ssid = SPRequest::cmd('ssid', SPRequest::cmd('ssid', null, 'cookie'));
     $new = false;
     /* otherwise create new ssid */
     if (!$ssid) {
         $ssid = microtime(true) * 100 . '.' . rand(0, 99);
         $new = true;
     }
     $attr = array('ssid' => $ssid, 'uid' => Sobi::My('id'), 'browserData' => SPConfig::serialize(SPBrowser::getInstance()));
     /* get search request */
     if (!count($this->_request)) {
         $r = SPRequest::search('field_');
         if (is_array($r) && count($r)) {
             $attr['requestData'] = SPConfig::serialize($r);
         }
     }
     /* determine the search parameters */
     if ($new) {
         $attr['searchCreated'] = 'FUNCTION:NOW()';
     }
     /* finally save */
     try {
         $this->_db->insertUpdate('spdb_search', $attr);
     } catch (SPException $x) {
         Sobi::Error($this->name(), SPLang::e('CANNOT_CREATE_SESSION_DB_ERR', $x->getMessage()), SPC::ERROR, 500, __LINE__, __FILE__);
     }
     return SPCookie::set('ssid', $ssid, SPCookie::days(7));
 }
开发者ID:ranrolls,项目名称:ras-full-portal,代码行数:30,代码来源:search.php

示例12: view

 protected function view()
 {
     /* determine template package */
     $tplPckg = Sobi::Cfg('section.template', SPC::DEFAULT_TEMPLATE);
     Sobi::ReturnPoint();
     $this->_task = 'alpha';
     if (!$this->_model) {
         $this->setModel('section');
         $this->_model->init(Sobi::Section());
     }
     $this->visible();
     /* load template config */
     $this->template();
     $this->tplCfg($tplPckg);
     /* 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));
     /* get the site to display */
     $site = SPRequest::int('site', 1);
     $eLimStart = ($site - 1) * $eLimit;
     $eCount = count($this->getEntries(0, 0, true));
     $entries = $this->getEntries($eLimit, $site);
     $compare = $this->_field ? $this->_field : $this->_nid;
     if (strlen($compare) && $compare != Sobi::Cfg('alphamenu.primary_field')) {
         $t = 'list.alpha.' . strtolower($this->_letter) . '.' . $this->_nid;
     } else {
         $t = 'list.alpha.' . strtolower($this->_letter);
     }
     $pn = SPFactory::Instance('helpers.pagenav_' . $this->tKey($this->template, 'template_type', 'xslt'), $eLimit, $eCount, $site, array('sid' => SPRequest::sid(), 'task' => $t));
     $cUrl = array('sid' => SPRequest::sid(), 'task' => $t);
     if (SPRequest::int('site', 0)) {
         $cUrl['site'] = SPRequest::int('site', 0);
     }
     SPFactory::header()->addCanonical(Sobi::Url($cUrl, true, true, true));
     /* handle meta data */
     SPFactory::header()->objMeta($this->_model);
     $letter = urldecode(SPRequest::cmd('letter'));
     /* add pathway */
     if (!$this->_fieldType) {
         SPFactory::mainframe()->addToPathway(Sobi::Txt('AL.PATH_TITLE', array('letter' => $letter)), Sobi::Url('current'));
         SPFactory::header()->addTitle(Sobi::Txt('AL.TITLE', array('letter' => $letter, 'section' => $this->_model->get('name'))), array(ceil($eCount / $eLimit), $site));
     } else {
         $field = SPFactory::Model('field');
         $field->init($this->_field);
         SPFactory::mainframe()->addToPathway(Sobi::Txt('AL.PATH_TITLE_FIELD', array('letter' => $letter, 'field' => $field->get('name'))), Sobi::Url('current'));
         SPFactory::header()->addTitle(Sobi::Txt('AL.TITLE_FIELD', array('letter' => $letter, 'section' => $this->_model->get('name'), 'field' => $field->get('name'))), array(ceil($eCount / $eLimit), $site));
     }
     /* 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->assign(Sobi::Txt('AL.PATH_TITLE', array('letter' => $this->_letter)), 'listing_name');
     $view->setConfig($this->_tCfg, $this->template);
     $view->setTemplate($tplPckg . '.' . $this->templateType . '.' . $this->template);
     $view->assign($pn->get(), 'navigation');
     $view->assign(SPFactory::user()->getCurrent(), 'visitor');
     $view->assign($entries, 'entries');
     Sobi::Trigger('AlphaListing', 'View', array(&$view));
     $view->display();
 }
开发者ID:kishoreweblabs,项目名称:SobiPro,代码行数:64,代码来源:alpha.php

示例13: saveDefaultOrdering

 protected function saveDefaultOrdering()
 {
     $target = SPRequest::cmd('target');
     $order = Sobi::GetUserState($target . '.order', null);
     $saved = false;
     if (strlen($order)) {
         SPFactory::config()->saveCfg('admin.' . $target . '-order', $order);
         $saved = true;
     }
     $limit = Sobi::GetUserState($target . '.limit', 10);
     if ($limit) {
         SPFactory::config()->saveCfg('admin.' . $target . '-limit', $limit);
         $saved = true;
     }
     if ($saved) {
         $this->response(Sobi::Back(), Sobi::Txt('MSG_DEFAULT_ORDERING_SAVED'), false);
     }
 }
开发者ID:kishoreweblabs,项目名称:SobiPro,代码行数:18,代码来源:config.php

示例14: save

 /**
  * Save an entry
  *
  * @param bool $apply
  */
 protected function save($apply)
 {
     $new = true;
     if (!$this->_model) {
         $this->setModel(SPLoader::loadModel($this->_type));
     }
     if ($this->_model->get('oType') != 'entry') {
         Sobi::Error('Entry', sprintf('Serious security violation. Trying to save an object which claims to be an entry but it is a %s. Task was %s', $this->_model->get('oType'), SPRequest::task()), SPC::ERROR, 403, __LINE__, __FILE__);
         exit;
     }
     /* check if we have stored last edit in cache */
     $tsId = SPRequest::string('editentry', null, false, 'cookie');
     if (!$tsId) {
         $tsId = SPRequest::cmd('ssid');
     }
     $request = $this->getCache($tsId);
     $this->_model->init(SPRequest::sid($request));
     $tplPackage = Sobi::Cfg('section.template', SPC::DEFAULT_TEMPLATE);
     $this->tplCfg($tplPackage);
     $customClass = null;
     if (isset($this->_tCfg['general']['functions']) && $this->_tCfg['general']['functions']) {
         $customClass = SPLoader::loadClass('/' . str_replace('.php', null, $this->_tCfg['general']['functions']), false, 'templates');
         if (method_exists($customClass, 'BeforeStoreEntry')) {
             $customClass::BeforeStoreEntry($this->_model, $this->store['post']);
             SPFactory::registry()->set('requestcache_stored', $this->store);
             SPFactory::registry()->set('requestcache', $this->store['post']);
         }
     }
     $preState = array('approved' => $this->_model->get('approved'), 'state' => $this->_model->get('state'), 'new' => !$this->_model->get('id'));
     SPFactory::registry()->set('object_previous_state', $preState);
     $this->_model->getRequest($this->_type, $request);
     Sobi::Trigger($this->name(), __FUNCTION__, array(&$this->_model));
     if ($this->_model->get('id') && $this->_model->get('id') == SPRequest::sid()) {
         $new = false;
         if (Sobi::My('id') && Sobi::My('id') == $this->_model->get('owner')) {
             $this->authorise('edit', 'own');
         } else {
             $this->authorise('edit', '*');
         }
     } else {
         $this->authorise('add', 'own');
     }
     $this->_model->save($request);
     /* if there is something pay */
     $pCount = SPFactory::payment()->count($this->_model->get('id'));
     if ($pCount && !Sobi::Can('entry.payment.free')) {
         //			$this->paymentView( $tsid );
         if ($customClass && method_exists($customClass, 'BeforeStoreEntryPayment')) {
             $customClass::BeforeStoreEntryPayment($this->_model->get('id'));
         }
         SPFactory::payment()->store($this->_model->get('id'));
     }
     /* delete cache files on after */
     $file = str_replace('.', '-', $tsId);
     if (SPLoader::dirPath('tmp.edit.' . $file)) {
         SPFs::delete(SPLoader::dirPath('tmp.edit.' . $file));
     } else {
         SPFactory::cache()->deleteVar('request_cache_' . $tsId);
     }
     SPLoader::loadClass('env.cookie');
     SPCookie::delete('editentry');
     $sid = $this->_model->get('id');
     $pid = SPRequest::int('pid') ? SPRequest::int('pid') : Sobi::Section();
     if ($new) {
         if ($this->_model->get('state') || Sobi::Can('entry.see_unpublished.own')) {
             $msg = $this->_model->get('state') ? Sobi::Txt('EN.ENTRY_SAVED') : Sobi::Txt('EN.ENTRY_SAVED_NP');
             $url = Sobi::Url(array('sid' => $sid, 'pid' => $pid));
         } else {
             // determine if there is a custom redirect
             if (Sobi::Cfg('redirects.entry_save_enabled') && !($pCount && !Sobi::Can('entry.payment.free'))) {
                 $redirect = Sobi::Cfg('redirects.entry_save_url', null);
                 if (!preg_match('/http[s]?:\\/\\/.*/', $redirect) && $redirect != 'index.php') {
                     $redirect = Sobi::Url($redirect);
                 }
                 $this->response($redirect, Sobi::Txt(Sobi::Cfg('redirects.entry_save_msg', 'EN.ENTRY_SAVED_NP')), true, Sobi::Cfg('redirects.entry_save_msgtype', SPC::SUCCESS_MSG));
             } else {
                 $msg = Sobi::Txt('EN.ENTRY_SAVED_NP');
                 $url = Sobi::Url(array('sid' => $pid));
             }
         }
     } elseif ($this->_model->get('approved') || Sobi::Can('entry.see_unapproved.own')) {
         $url = Sobi::Url(array('sid' => $sid, 'pid' => $pid));
         $msg = $this->_model->get('approved') ? Sobi::Txt('EN.ENTRY_SAVED') : Sobi::Txt('EN.ENTRY_SAVED_NA');
     } else {
         if ($this->_model->get('approved')) {
             $msg = Sobi::Txt('EN.ENTRY_SAVED');
         } else {
             $msg = Sobi::Txt('EN.ENTRY_SAVED_NA');
         }
         $url = Sobi::Url(array('sid' => $sid, 'pid' => $pid));
     }
     if ($pCount && !Sobi::Can('entry.payment.free')) {
         $ident = md5(microtime() . $tsId . $sid . time());
         $data = array('data' => SPFactory::payment()->summary($sid), 'ident' => $ident);
         $url = Sobi::Url(array('sid' => $sid, 'task' => 'entry.payment'), false, false);
//.........这里部分代码省略.........
开发者ID:pelloq1,项目名称:SobiPro,代码行数:101,代码来源:entry.php

示例15: parents

 /**
  * @return void
  */
 private function parents()
 {
     //		sleep( 5 );
     $sid = SPRequest::sid();
     $out = SPRequest::cmd('out', 'json');
     $path = SPFactory::config()->getParentPath($sid, true, false, true);
     $cats = array();
     if (count($path)) {
         $childs = 0;
         foreach ($path as $category) {
             if ($category['id'] == $sid) {
                 $childs = count(SPFactory::Category($sid)->getChilds('category', false, 1));
             }
             $cats[] = array('id' => $category['id'], 'name' => $category['name'], 'childsCount' => $childs);
         }
     }
     switch ($out) {
         case 'json':
             SPFactory::mainframe()->cleanBuffer()->customHeader();
             echo json_encode(array('id' => $sid, 'categories' => $cats));
             exit;
     }
 }
开发者ID:ranrolls,项目名称:ras-full-portal,代码行数:26,代码来源:category.php


注:本文中的SPRequest::cmd方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。