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


PHP SPLang::clean方法代码示例

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


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

示例1: save

 protected function save()
 {
     if (!SPFactory::mainframe()->checkToken()) {
         Sobi::Error('Token', SPLang::e('UNAUTHORIZED_ACCESS_TASK', SPRequest::task()), SPC::ERROR, 403, __LINE__, __FILE__);
     }
     $id = SPRequest::cmd('filter_id');
     if ($id) {
         $this->validate('field.filter', 'filter');
         $filters = $this->getFilters();
         $name = SPRequest::string('filter_name', 'Filter Name');
         $msg = str_replace(array("\n", "\t", "\r"), null, SPLang::clean(SPRequest::string('filter_message', 'The data entered in the $field field contains not allowed characters')));
         $regex = SPLang::clean(SPRequest::raw('filter_regex', '/^[\\.*]+$/'));
         $regex = str_replace('[:apostrophes:]', '\\"' . "\\'", $regex);
         $regex = base64_encode(str_replace(array("\n", "\t", "\r"), null, $regex));
         $custom = 'custom';
         if (isset($filters[$id]) && !strlen($filters[$id]['options'])) {
             $regex = $filters[$id]['params'];
             $custom = null;
         }
         $filters[$id] = array('params' => $regex, 'key' => $id, 'value' => $name, 'description' => $msg, 'options' => $custom);
         SPFactory::registry()->saveDBSection($filters, 'fields_filter');
         $this->response(Sobi::Url('filter'), Sobi::Txt('FLR.MSG_FILTER_SAVED'), false, 'success');
     } else {
         $this->response(Sobi::Url('filter'), SPLang::e('FILTER_NOT_FOUND'), true, SPC::ERROR_MSG);
     }
 }
开发者ID:ranrolls,项目名称:ras-full-portal,代码行数:26,代码来源:filter.php

示例2: loadObject

 /**
  * Loads the first row of a query into an object
  *
  * @throws SPException
  * @return stdObject
  */
 public function loadObject()
 {
     try {
         $r = $this->db->loadObject();
         $this->count++;
     } catch (Exception $e) {
     }
     if ($this->db->getErrorNum()) {
         throw new SPException($this->db->stderr());
     } else {
         if ($r && is_object($r)) {
             $attr = get_object_vars($r);
             foreach ($attr as $property => $value) {
                 if (is_string($value) && strstr($value, '"')) {
                     $r->{$property} = class_exists('SPLang') ? SPLang::clean($value) : $value;
                 }
             }
         }
         return $r;
     }
 }
开发者ID:kishoreweblabs,项目名称:SobiPro,代码行数:27,代码来源:database.php

示例3: searchForm

 /**
  * Shows the field in the search form
  * @param bool $return return or display directly
  * @return string
  */
 public function searchForm($return = false)
 {
     if ($this->searchMethod == 'general') {
         return false;
     }
     $hidden = null;
     $d = $this->getValues(false);
     $data = array('' => Sobi::Txt('FD.SEARCH_SELECT_LIST', array('name' => $this->name)));
     foreach ($d as $k => $v) {
         $data[$k] = $v;
     }
     $params = array('id' => $this->nid, 'size' => $this->ssize, 'class' => $this->cssClass . ' ' . Sobi::Cfg('search.form_list_def_css', 'SPSearchSelect'));
     //still there for compatibility reason
     if ($this->swidth) {
         $params['style'] = "width: {$this->swidth}px;";
     }
     if ($this->dependency) {
         SPFactory::header()->addJsFile('opt.field_select');
         $request = json_decode(SPLang::clean(SPRequest::raw($this->nid . '_path', null, 'requestcache')), true);
         $params['class'] .= ' ctrl-dependency-field';
         $hidden = $this->travelDependencyPath($request, $params);
         $this->_selected = isset($request[1]) ? $request[1] : null;
         $hiddenValue = str_replace('"', "'", json_encode((object) $request));
         $hidden .= SPHtml_Input::hidden($this->nid . '_path', $hiddenValue, null, array('data' => array('selected' => '', 'section' => Sobi::Section())));
         $params['data'] = array('order' => '1');
     }
     return SPHtml_Input::select($this->nid, $data, $this->_selected, $this->searchMethod == 'mselect', $params) . $hidden;
 }
开发者ID:kishoreweblabs,项目名称:SobiPro,代码行数:33,代码来源:select.php

示例4: entryData

 protected function entryData($getFields = true)
 {
     /** @var SPEntry $entry */
     $entry = $this->get('entry');
     $visitor = $this->get('visitor');
     $data = array();
     $data['section'] = array('_complex' => 1, '_data' => Sobi::Section(true), '_attributes' => array('id' => Sobi::Section(), 'lang' => Sobi::Lang(false)));
     $en = array();
     $en['name'] = array('_complex' => 1, '_data' => $entry->get('name'), '_attributes' => array('lang' => Sobi::Lang(false)));
     $en['created_time'] = $entry->get('createdTime');
     $en['updated_time'] = $entry->get('updatedTime');
     $en['valid_since'] = $entry->get('validSince');
     $en['valid_until'] = $entry->get('validUntil');
     $en['author'] = $entry->get('owner');
     $en['counter'] = $entry->get('counter');
     $en['approved'] = $entry->get('approved');
     $this->fixTimes($en);
     //       $mytime = date( 'Y-m-d H:i:s', time());
     if ($entry->get('state') == 0) {
         $en['state'] = 'unpublished';
     } else {
         if (strtotime($entry->get('validUntil')) != 0 && strtotime($entry->get('validUntil')) < time()) {
             $en['state'] = 'expired';
         } elseif (strtotime($entry->get('validSince')) != 0 && strtotime($entry->get('validSince')) > time()) {
             $en['state'] = 'pending';
         } else {
             $en['state'] = 'published';
         }
     }
     $en['url'] = Sobi::Url(array('pid' => $entry->get('parent'), 'sid' => $entry->get('id'), 'title' => Sobi::Cfg('sef.alias', true) ? $entry->get('nid') : $entry->get('name')), true, true, true);
     if (Sobi::Can('entry', 'edit', '*') || Sobi::My('id') == $entry->get('owner') && Sobi::Can('entry', 'edit', 'own')) {
         $en['edit_url'] = Sobi::Url(array('task' => 'entry.edit', 'sid' => $entry->get('id')));
     }
     if (Sobi::Can('entry', 'manage', '*')) {
         $en['approve_url'] = Sobi::Url(array('task' => $entry->get('approved') ? 'entry.unapprove' : 'entry.approve', 'sid' => $entry->get('id')));
     }
     if ($entry->get('owner') == Sobi::My('id') && Sobi::Can('entry', 'delete', 'own') || Sobi::Can('entry', 'delete', '*')) {
         $en['delete_url'] = Sobi::Url(array('task' => 'entry.delete', 'sid' => $entry->get('id')));
     }
     if (Sobi::Can('entry', 'publish', '*') || Sobi::My('id') == $entry->get('owner') && Sobi::Can('entry', 'publish', 'own')) {
         $en['publish_url'] = Sobi::Url(array('task' => $entry->get('state') ? 'entry.unpublish' : 'entry.publish', 'sid' => $entry->get('id')));
     }
     $cats = $entry->get('categories');
     $categories = array();
     if (count($cats)) {
         $cn = SPLang::translateObject(array_keys($cats), array('name', 'alias'), 'category');
     }
     $primaryCat = $entry->get('parent');
     foreach ($cats as $cid => $cat) {
         $cAttr = array('lang' => Sobi::Lang(false), 'id' => $cat['pid'], 'alias' => $cat['alias'], 'position' => $cat['position'], 'url' => Sobi::Url(array('sid' => $cat['pid'], 'title' => Sobi::Cfg('sef.alias', true) ? $cat['alias'] : $cat['name'])));
         if ($cat['pid'] == $primaryCat) {
             $cAttr['primary'] = 'true';
         }
         $categories[] = array('_complex' => 1, '_data' => SPLang::clean($cn[$cid]['value']), '_attributes' => $cAttr);
     }
     $en['categories'] = $categories;
     $en['meta'] = array('description' => $entry->get('metaDesc'), 'keys' => $this->metaKeys($entry), 'author' => $entry->get('metaAuthor'), 'robots' => $entry->get('metaRobots'));
     if ($getFields) {
         $fields = $entry->getFields();
         if (count($fields)) {
             $en['fields'] = $this->fieldStruct($fields, 'details');
         }
     }
     $this->menu($data);
     $this->alphaMenu($data);
     $data['entry'] = array('_complex' => 1, '_data' => $en, '_attributes' => array('id' => $entry->get('id'), 'nid' => $entry->get('nid'), 'version' => $entry->get('version')));
     $data['visitor'] = $this->visitorArray($visitor);
     return $data;
 }
开发者ID:pelloq1,项目名称:SobiPro,代码行数:69,代码来源:entry.php

示例5: array

 /**
  * Set Site title
  * @param string $title
  * @return SPHeader
  */
 public function &setTitle($title)
 {
     if (defined('SOBIPRO_ADM')) {
         SPFactory::mainframe()->setTitle(SPLang::clean($title));
     }
     if (is_array($title)) {
         $this->title = $title;
     } else {
         $this->title = array(SPLang::clean($title));
     }
     return $this;
 }
开发者ID:ranrolls,项目名称:ras-full-portal,代码行数:17,代码来源:header.php

示例6: __construct

 /**
  * @param string $task
  * @return \SobiProCtrl
  */
 function __construct($task)
 {
     $this->_mem = memory_get_usage();
     $this->_time = microtime(true);
     SPLoader::loadClass('base.exception');
     set_error_handler('SPExceptionHandler');
     $this->_err = ini_set('display_errors', 'on');
     $this->_task = $task;
     /* load all needed classes */
     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('cms.base.lang');
     /* get sid if any */
     $this->_sid = SPRequest::sid();
     /* determine section */
     $access = $this->getSection();
     /* initialise mainframe interface to CMS */
     $this->_mainframe = SPFactory::mainframe();
     /* initialise config */
     $this->createConfig();
     ini_set('display_errors', Sobi::Cfg('debug.display_errors', false));
     $this->_deb = error_reporting(Sobi::Cfg('debug.level', 0));
     /* trigger plugin */
     Sobi::Trigger('Start');
     /* initialise translator and load language files */
     SPLang::setLang(Sobi::Lang(false));
     try {
         SPLang::registerDomain('site');
     } catch (SPException $x) {
         Sobi::Error('CoreCtrl', SPLang::e('Cannot register language domain: %s.', $x->getMessage()), SPC::WARNING, 0, __LINE__, __FILE__);
     }
     if (!$access) {
         if (Sobi::Cfg('redirects.section_enabled', false)) {
             $redirect = Sobi::Cfg('redirects.section_url', null);
             $msg = Sobi::Cfg('redirects.section_msg', SPLang::e('UNAUTHORIZED_ACCESS', SPRequest::task()));
             $msgtype = Sobi::Cfg('redirects.section_msgtype', 'message');
             Sobi::Redirect(Sobi::Url($redirect), Sobi::Txt($msg), $msgtype, true);
         } else {
             SPFactory::mainframe()->runAway('You have no permission to access this site', 403, null, true);
         }
     }
     /* load css and js files */
     SPFactory::header()->initBase();
     $sectionName = SPLang::translateObject($this->_section, 'name', 'section');
     if ($this->_section) {
         SPFactory::registry()->set('current_section_name', SPLang::clean($sectionName[$this->_section]['value']));
     }
     $start = array($this->_mem, $this->_time);
     SPFactory::registry()->set('start', $start);
     /* check if it wasn't plugin custom task */
     if (!Sobi::Trigger('custom', 'task', array(&$this, SPRequest::task()))) {
         /* if not, start to route */
         try {
             $this->route();
         } catch (SPException $x) {
             if (defined('SOBI_TESTS')) {
                 Sobi::Error('CoreCtrl', SPLang::e('Cannot route: %s.', $x->getMessage()), SPC::ERROR, 500, __LINE__, __FILE__);
             } else {
                 SPFactory::mainframe()->setRedirect(Sobi::Reg('live_site'), SPLang::e('PAGE_NOT_FOUND'), SPC::ERROR_MSG, true);
             }
         }
     }
     return true;
 }
开发者ID:ranrolls,项目名称:ras-full-portal,代码行数:73,代码来源:sobipro.php

示例7: struct

 /**
  * @return array
  */
 public function struct()
 {
     $data = SPConfig::unserialize($this->getRaw());
     if (isset($data['url']) && strlen($data['url'])) {
         $show = true;
         if (!(isset($data['label']) && strlen($data['label']))) {
             $data['label'] = $data['url'];
         }
         /* @TODO: add second step */
         if ($this->botProtection) {
             SPLoader::loadClass('env.browser');
             $humanity = SPBrowser::getInstance()->get('humanity');
             $display = Sobi::Cfg('mail_protection.show');
             $show = $humanity >= $display ? true : false;
         }
         if ($show && strlen($data['url'])) {
             $this->cssClass = strlen($this->cssClass) ? $this->cssClass : 'spFieldsData';
             $this->cssClass = $this->cssClass . ' ' . $this->nid;
             $this->cleanCss();
             $attributes = array('href' => "mailto:{$data['url']}", 'class' => $this->cssClass);
             if ($this->newWindow) {
                 $attributes['target'] = '_blank';
             }
             $data = array('_complex' => 1, '_data' => SPLang::clean($data['label']), '_attributes' => $attributes);
             return array('_complex' => 1, '_validate' => array('class' => str_replace(str_replace('\\', '/', SOBI_PATH), null, str_replace('\\', '/', __FILE__)), 'method' => 'validateVisibility'), '_data' => array('a' => $data), '_attributes' => array('lang' => Sobi::Lang(false), 'class' => $this->cssClass));
         }
     }
 }
开发者ID:kishoreweblabs,项目名称:SobiPro,代码行数:31,代码来源:email.php

示例8: setTitle

 /**
  * @param string $title
  * @param bool $forceAdd
  */
 public function setTitle($title, $forceAdd = false)
 {
     $document = JFactory::getDocument();
     if (!is_array($title) && (Sobi::Cfg('browser.add_title', true) || $forceAdd)) {
         $title = array($title);
     }
     if (is_array($title)) {
         //browser.add_title = true: adds the Joomla part (this is normally the menu item) in front of it (works only if full_title is also set to true)
         $jTitle = $document->getTitle();
         //get the title Joomla has set
         if (Sobi::Cfg('browser.add_title', true) || $forceAdd) {
             if ($title[0] != $jTitle) {
                 array_unshift($title, $jTitle);
             }
         } else {
             if ($title[0] == $jTitle) {
                 array_shift($title);
             }
         }
         //if ( Sobi::Cfg( 'browser.full_title', true ) || true ) {
         //browser.full_title = true: if title is array, use only the last. That's e.g. the entry name without categories for SobiPro standard title
         if (count($title)) {
             if (is_array($title)) {
                 if (Sobi::Cfg('browser.reverse_title', false)) {
                     $title = array_reverse($title);
                 }
                 $title = implode(Sobi::Cfg('browser.title_separator', ' - '), $title);
             } else {
                 $title = isset($title[count($title) - 1]) ? $title[count($title) - 1] : $title[0];
             }
         } else {
             $title = null;
         }
     }
     if (strlen($title)) {
         if (!defined('SOBIPRO_ADM')) {
             if (JFactory::getApplication()->getCfg('sitename_pagetitles', 0) == 1) {
                 $title = JText::sprintf('JPAGETITLE', JFactory::getApplication()->getCfg('sitename'), $title);
             } elseif (JFactory::getApplication()->getCfg('sitename_pagetitles', 0) == 2) {
                 $title = JText::sprintf('JPAGETITLE', $title, JFactory::getApplication()->getCfg('sitename'));
             }
         }
         $document->setTitle(SPLang::clean(html_entity_decode($title)));
     }
 }
开发者ID:pelloq1,项目名称:SobiPro,代码行数:49,代码来源:mainframe.php

示例9: entry

 protected function entry($entry, $manager, $noId = false)
 {
     $en = array();
     if (is_numeric($entry)) {
         $en = $this->cachedEntry($entry, $manager, $noId);
     }
     if (!is_array($en) || !count($en)) {
         if (is_numeric($entry)) {
             $entry = SPFactory::Entry($entry);
         }
         $en['id'] = $entry->get('id');
         $en['nid'] = $entry->get('nid');
         $en['name'] = array('_complex' => 1, '_data' => $entry->get('name'), '_attributes' => array('lang' => Sobi::Lang(false)));
         $en['url_array'] = array('title' => Sobi::Cfg('sef.alias', true) ? $entry->get('nid') : $entry->get('name'), 'pid' => $entry->get('primary'), 'sid' => $entry->get('id'));
         if (strstr(SPRequest::task(), 'search') || $noId || Sobi::Cfg('section.force_category_id', false) && SPRequest::sid() == Sobi::Section()) {
             $en['url'] = Sobi::Url(array('title' => Sobi::Cfg('sef.alias', true) ? $entry->get('nid') : $entry->get('name'), 'pid' => $entry->get('primary'), 'sid' => $entry->get('id')));
         } else {
             $en['url'] = Sobi::Url(array('title' => Sobi::Cfg('sef.alias', true) ? $entry->get('nid') : $entry->get('name'), 'pid' => SPRequest::sid(), 'sid' => $entry->get('id')));
         }
         if (Sobi::Cfg('list.entry_meta', true)) {
             $en['meta'] = array('description' => $entry->get('metaDesc'), 'keys' => $this->metaKeys($entry), 'author' => $entry->get('metaAuthor'), 'robots' => $entry->get('metaRobots'));
         }
         if ($manager || Sobi::My('id') && Sobi::My('id') == $entry->get('owner') && Sobi::Can('entry', 'edit', 'own', Sobi::Section())) {
             $en['edit_url'] = Sobi::Url(array('task' => 'entry.edit', 'pid' => SPRequest::sid(), 'sid' => $entry->get('id')));
         } else {
             if (isset($en['edit_url'])) {
                 unset($en['edit_url']);
             }
         }
         $en['edit_url_array'] = array('task' => 'entry.edit', 'pid' => SPRequest::sid(), 'sid' => $entry->get('id'));
         $en['created_time'] = $entry->get('createdTime');
         $en['updated_time'] = $entry->get('updatedTime');
         $en['valid_since'] = $entry->get('validSince');
         $en['valid_until'] = $entry->get('validUntil');
         $this->fixTimes($en);
         if ($entry->get('state') == 0) {
             $en['state'] = 'unpublished';
         } else {
             if (strtotime($entry->get('validUntil')) != 0 && strtotime($entry->get('validUntil')) < time()) {
                 $en['state'] = 'expired';
             } elseif (strtotime($entry->get('validSince')) != 0 && strtotime($entry->get('validSince')) > time()) {
                 $en['state'] = 'pending';
             } else {
                 $en['state'] = 'published';
             }
         }
         $en['author'] = $entry->get('owner');
         $en['counter'] = $entry->get('counter');
         $en['approved'] = $entry->get('approved');
         //		$en[ 'confirmed' ] = $entry->get( 'confirmed' );
         if (Sobi::Cfg('list.entry_cats', true)) {
             $cats = $entry->get('categories');
             $categories = array();
             if (count($cats)) {
                 $cn = SPLang::translateObject(array_keys($cats), array('name', 'alias'));
             }
             foreach ($cats as $cid => $cat) {
                 $categories[] = array('_complex' => 1, '_data' => SPLang::clean($cn[$cid]['value']), '_attributes' => array('lang' => Sobi::Lang(false), 'id' => $cat['pid'], 'position' => $cat['position'], 'url' => Sobi::Url(array('sid' => $cat['pid'], 'title' => Sobi::Cfg('sef.alias', true) ? $cat['alias'] : $cat['name']))));
             }
             $en['categories'] = $categories;
         }
         $fields = $entry->getFields();
         if (count($fields)) {
             //				foreach ( $fields as $field ) {
             //					if ( $field->enabled( 'vcard' ) && $field->get( 'id' ) != Sobi::Cfg( 'entry.name_field' ) ) {
             //						$struct = $field->struct();
             //						$options = null;
             //						if ( isset( $struct[ '_options' ] ) ) {
             //							$options = $struct[ '_options' ];
             //							unset( $struct[ '_options' ] );
             //						}
             //						$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( 'withLabel' ) )
             //								),
             //								'data' => $struct,
             //							),
             //							'_attributes' => array( 'id' => $field->get( 'id' ), 'type' => $field->get( 'type' ), 'suffix' => $field->get( 'suffix' ), 'position' => $field->get( 'position' ), 'css_class' => ( strlen( $field->get( 'cssClass' ) ) ? $field->get( 'cssClass' ) : 'spField' ) )
             //						);
             //						if ( Sobi::Cfg( 'list.field_description', false ) ) {
             //							$f[ $field->get( 'nid' ) ][ '_data' ][ 'description' ] = array( '_complex' => 1, '_xml' => 1, '_data' => $field->get( 'description' ) );
             //						}
             //						if ( $options ) {
             //							$f[ $field->get( 'nid' ) ][ '_data' ][ 'options' ] = $options;
             //						}
             //						if ( isset( $struct[ '_xml_out' ] ) && count( $struct[ '_xml_out' ] ) ) {
             //							foreach ( $struct[ '_xml_out' ] as $k => $v )
             //								$f[ $field->get( 'nid' ) ][ '_data' ][ $k ] = $v;
             //						}
             //					}
             //				}
             $en['fields'] = $this->fieldStruct($fields, 'vcard');
         }
         SPFactory::cache()->addObj($entry, 'entry', $entry->get('id'))->addObj($en, 'entry_struct', $entry->get('id'));
         unset($en['url_array']);
         unset($en['edit_url_array']);
//.........这里部分代码省略.........
开发者ID:ranrolls,项目名称:ras-full-portal,代码行数:101,代码来源:section.php

示例10: struct

 /**
  * @return array
  */
 public function struct()
 {
     $data = SPConfig::unserialize($this->getRaw());
     if (isset($data['url']) && strlen($data['url'])) {
         $counter = -1;
         if ($data['protocol'] == 'relative') {
             $url = $data['url'];
         } else {
             $url = $data['protocol'] . '://' . $data['url'];
         }
         if (!(isset($data['label']) && strlen($data['label']))) {
             $data['label'] = $url;
         }
         $this->cssClass = strlen($this->cssClass) ? $this->cssClass : 'spFieldsData';
         $this->cssClass = $this->cssClass . ' ' . $this->nid;
         $attributes = array('href' => $url, 'class' => $this->cssClass);
         if ($this->countClicks) {
             SPFactory::header()->addJsFile('opt.field_url');
             $this->cssClass = $this->cssClass . ' ctrl-visit-countable';
             $counter = $this->getCounter();
             $attributes['data-sid'] = $this->sid;
             if (Sobi::Cfg('cache.xml_enabled')) {
                 $attributes['data-counter'] = $counter;
                 $attributes['data-refresh'] = 'true';
             }
             $attributes['class'] = $this->cssClass;
             if ($this->counterToLabel) {
                 $data['label'] = Sobi::Txt('FM.URL.COUNTER_WITH_LABEL', array('label' => $data['label'], 'counter' => $counter));
             }
         }
         $this->cleanCss();
         if (strlen($url)) {
             if ($this->newWindow) {
                 $attributes['target'] = '_blank';
             }
             if ($this->noFollow) {
                 $attributes['rel'] = 'nofollow';
             }
             $data = array('_complex' => 1, '_data' => SPLang::clean($data['label']), '_attributes' => $attributes);
             return array('_complex' => 1, '_data' => array('a' => $data), '_attributes' => array('lang' => Sobi::Lang(false), 'class' => $this->cssClass, 'counter' => $counter));
         }
     }
 }
开发者ID:kishoreweblabs,项目名称:SobiPro,代码行数:46,代码来源:url.php

示例11: parentPath

 /**
  * @param int $id
  * @param bool $parents
  * @param bool $last
  * @param int $offset
  * @return array
  */
 protected function parentPath($id, $parents = false, $last = false, $offset = 2)
 {
     static $pathArray = null;
     $path = null;
     if (!$pathArray) {
         $pathArray = SPFactory::config()->getParentPath($id, true, $parents);
     }
     if (!$last) {
         if (is_array($pathArray)) {
             //				if ( strstr( $this->get( 'task' ), 'edit' ) ) {
             //					unset( $path[ count( $path ) - 1 ] );
             //				}
             $path = implode(Sobi::Cfg('string.path_separator', ' > '), $pathArray);
         }
     } else {
         if (is_array($pathArray) && isset($pathArray[count($pathArray) - $offset])) {
             $path = $pathArray[count($pathArray) - $offset];
         }
     }
     return SPLang::clean($path);
 }
开发者ID:ranrolls,项目名称:ras-full-portal,代码行数:28,代码来源:view.php

示例12: PaymentMethodView

 /**
  * 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
  * @return void
  */
 public function PaymentMethodView(&$methods, $entry, &$payment)
 {
     $bankdata = SPLang::getValue('bankdata', 'plugin', Sobi::Section());
     $bankdata = SPLang::replacePlaceHolders($bankdata, array('entry' => $entry));
     $methods[$this->id] = array('content' => SPLang::clean($bankdata), 'title' => Sobi::Txt('APP.PBT.PAY_TITLE'));
 }
开发者ID:ranrolls,项目名称:ras-full-portal,代码行数:16,代码来源:init.php

示例13: searchSuggest

 /**
  * @param string $data
  * @param int $section
  * @param bool $startWith
  * @param bool $ids
  * @return array
  */
 public function searchSuggest($data, $section, $startWith = true, $ids = false)
 {
     $terms = array();
     $data = $startWith ? "{$data}%" : "%{$data}%";
     $request = array('baseData');
     if ($ids) {
         $request[] = 'sid';
     }
     try {
         if ($ids) {
             $conditions = array('fid' => $this->fid, 'baseData' => $data, 'section' => $section);
             if (!defined('SOBIPRO_ADM')) {
                 $conditions['copy'] = 0;
                 $conditions['enabled'] = 1;
             }
             $result = SPFactory::db()->dselect($request, 'spdb_field_data', $conditions)->loadAssocList();
             $terms = array();
             if (count($result)) {
                 foreach ($result as $row) {
                     $terms[] = array('id' => $row['sid'], 'name' => SPLang::clean($row['baseData']));
                 }
             }
         } else {
             $terms = SPFactory::db()->select($request, 'spdb_field_data', array('fid' => $this->fid, 'copy' => '0', 'enabled' => 1, 'baseData' => $data, 'section' => $section))->loadResultArray();
         }
     } catch (SPException $x) {
         Sobi::Error($this->name(), SPLang::e('CANNOT_SEARCH_DB_ERR', $x->getMessage()), SPC::WARNING, 0, __LINE__, __FILE__);
     }
     return $terms;
 }
开发者ID:ranrolls,项目名称:ras-full-portal,代码行数:37,代码来源:inbox.php

示例14: content

 /**
  * @param array $config
  * @param array $values
  * @return string
  */
 private function content($config, $values)
 {
     $out = "\n";
     $out .= $values['expl'];
     $out .= "\n";
     $out .= '<form action="' . $values['ppurl'] . '" method="post">' . "\n";
     foreach ($config['fields'] as $field => $value) {
         $out .= '<input name="' . $field . '" value="' . SPLang::replacePlaceHolders($value, $values) . '" type="hidden"/>' . "\n";
     }
     $img = SPLang::replacePlaceHolders($config['general']['image']);
     $out .= '<input src="' . $img . '" name="submit" alt="" type="image"/>' . "\n";
     $out .= '</form>' . "\n";
     return SPLang::clean($out);
 }
开发者ID:kishoreweblabs,项目名称:SobiPro,代码行数:19,代码来源:init.php

示例15: get

 /**
  * Std. getter. Returns a property of the object or the default value if the property is not set.
  * @param string $attr
  * @param mixed $default
  * @return mixed
  */
 public function get($attr, $default = null)
 {
     if ($attr == 'value') {
         return $this->getRaw();
     }
     if (isset($this->{$attr})) {
         return is_string($this->{$attr}) && class_exists('SPLang') ? SPLang::clean($this->{$attr}) : $this->{$attr};
     }
     if (!$this->_type && !$this->_off) {
         $this->fullInit();
     }
     if ($this->_type && $this->_type->has($attr) && $this->_type->get($attr)) {
         return $this->_type->get($attr);
     } else {
         return $default;
     }
 }
开发者ID:ranrolls,项目名称:ras-full-portal,代码行数:23,代码来源:field.php


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