• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP Sobi类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: extract

 /**
  * @param string $to - path where the archive should be extracted to
  * @return bool
  */
 public function extract($to)
 {
     $r = false;
     $ext = SPFs::getExt($this->_filename);
     switch ($ext) {
         case 'zip':
             $zip = new ZipArchive();
             if ($zip->open($this->_filename) === true) {
                 SPException::catchErrors(SPC::WARNING);
                 try {
                     $zip->extractTo($to);
                     $zip->close();
                     $r = true;
                 } catch (SPException $x) {
                     $t = Sobi::FixPath(Sobi::Cfg('fs.temp') . DS . md5(microtime()));
                     SPFs::mkdir($t, 0777);
                     $dir = SPFactory::Instance('base.fs.directory', $t);
                     if ($zip->extractTo($t)) {
                         $zip->close();
                         $dir->moveFiles($to);
                         $r = true;
                     }
                     SPFs::delete($dir->getPathname());
                 }
                 SPException::catchErrors(0);
             }
             break;
     }
     return $r;
 }
开发者ID:kishoreweblabs,项目名称:SobiPro,代码行数:34,代码来源:archive.php


示例2: getGroupsField

    public static function getGroupsField()
    {
        $db =& JFactory::getDbo();
        $db->setQuery('
				 SELECT a.id AS value, a.title AS text, COUNT(DISTINCT b.id) AS level
				 FROM #__usergroups AS a
				 LEFT JOIN `#__usergroups` AS b ON a.lft > b.lft AND a.rgt < b.rgt
				 GROUP BY a.id
				 ORDER BY a.lft ASC');
        $options = $db->loadObjectList();
        // Check for a database error.
        if ($db->getErrorNum()) {
            JError::raiseNotice(500, $db->getErrorMsg());
            return null;
        }
        for ($i = 0, $n = count($options); $i < $n; $i++) {
            $options[$i]->text = str_repeat('- ', $options[$i]->level) . $options[$i]->text;
        }
        $gids = array();
        foreach ($options as $k => $v) {
            $gids[] = get_object_vars($v);
        }
        $gids[0] = array('value' => 0, 'text' => Sobi::Txt('ACL.REG_VISITOR'), 'level' => 0);
        return $gids;
    }
开发者ID:ranrolls,项目名称:ras-full-portal,代码行数:25,代码来源:users.php


示例3: save

 public function save(&$attr)
 {
     parent::save($attr);
     if ($attr['method'] == 'fixed') {
         if (!$attr['fixedCid']) {
             throw new SPException(SPLang::e('FIELD_FIXED_CID_MISSING'));
         } else {
             $cids = explode(',', $attr['fixedCid']);
             if (count($cids)) {
                 foreach ($cids as $cid) {
                     $catId = (int) $cid;
                     if (!$catId) {
                         throw new SPException(SPLang::e('FIELD_FIXED_CID_INVALID', $cid));
                     }
                     if ($catId == Sobi::Section()) {
                         throw new SPException(SPLang::e('FIELD_FIXED_CID_INVALID', $cid));
                     } else {
                         $parents = SPFactory::config()->getParentPath($catId);
                         if (!isset($parents[0]) || $parents[0] != Sobi::Section()) {
                             throw new SPException(SPLang::e('FIELD_FIXED_CID_INVALID_SECTION', $catId));
                         }
                     }
                 }
             } else {
                 throw new SPException(SPLang::e('FIELD_FIXED_CID_MISSING'));
             }
         }
     }
 }
开发者ID:ranrolls,项目名称:ras-full-portal,代码行数:29,代码来源:category.php


示例4: 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


示例5: display

 /**
  *
  */
 public function display()
 {
     $sections =& $this->get('sections');
     $_sections = array();
     if (count($sections)) {
         foreach ($sections as $section) {
             $name = $section->get('name');
             $id = $section->get('id');
             $url = Sobi::Url(array('sid' => $id));
             $_section = array();
             $_section['id'] = $id;
             $_section['nid'] = $section->get('nid');
             $_section['name'] = "<a href=\"{$url}\">{$name}</a>";
             //				$_section[ 'entries_counter' ] 		= $section->countChilds( 'entry' );
             //				$_section[ 'categories_counter' ] 	= $section->countChilds( 'category' );
             //				$_section[ 'state' ] = SPLists::state( $section );
             //				$_section[ 'checkbox' ] = SPLists::checkedOut( $section, 'sid' );
             $_section['createdTime'] = $section->get('createdTime');
             $_section['metaDesc'] = $section->get('metaDesc');
             $_section['metaKey'] = $section->get('metaKey');
             $_section['description'] = $section->get('description');
             $_section['url'] = $url;
             $_sections[] = $_section;
         }
     }
     $this->set($_sections, 'sections');
     parent::display();
 }
开发者ID:kishoreweblabs,项目名称:SobiPro,代码行数:31,代码来源:front.php


示例6: translate

 protected function translate()
 {
     $term = Sobi::Txt(SPRequest::cmd('term'));
     Sobi::Trigger('Translate', 'Text', array(&$term));
     SPFactory::mainframe()->cleanBuffer()->customHeader();
     echo json_encode(array('translation' => $term));
     exit;
 }
开发者ID:kishoreweblabs,项目名称:SobiPro,代码行数:8,代码来源:txt.php


示例7: __construct

 /**
  * @param string $definition
  * @param string $type
  * @return SPInstaller
  */
 public function __construct($definition, $type = null)
 {
     $this->type = $type;
     $this->xmlFile = $definition;
     $this->definition = new DOMDocument(Sobi::Cfg('xml.version', '1.0'), Sobi::Cfg('xml.encoding', 'UTF-8'));
     $this->definition->load($this->xmlFile);
     $this->xdef = new DOMXPath($this->definition);
     $this->root = dirname($this->xmlFile);
 }
开发者ID:kishoreweblabs,项目名称:SobiPro,代码行数:14,代码来源:installer.php


示例8: __call

 public function __call($method, $params)
 {
     if (function_exists($method)) {
         $this->string = $method($this->string);
     } else {
         Sobi::Error('String', "Function {$method} does not exist!", SPC::WARNING);
     }
     return $this;
 }
开发者ID:kishoreweblabs,项目名称:SobiPro,代码行数:9,代码来源:string.php


示例9: __construct

 /**
  * @param string $dir - path
  * @return SPDirectoryIterator
  */
 public function __construct($dir)
 {
     $Dir = scandir($dir);
     $this->_dir = new ArrayObject();
     foreach ($Dir as $file) {
         $this->append(new SPFile(Sobi::FixPath($dir . '/' . $file)));
     }
     $this->uasort(array($this, '_spSort'));
 }
开发者ID:kishoreweblabs,项目名称:SobiPro,代码行数:13,代码来源:directory_iterator.php


示例10: edit

 /**
  */
 private function edit()
 {
     $id = $this->get('entry.id');
     if ($id) {
         $this->addHidden($id, 'entry.id');
     }
     $sid = SPRequest::int('pid') ? SPRequest::int('pid') : SPRequest::sid();
     $this->assign(Sobi::Url(array('task' => 'category.chooser', 'sid' => $sid, 'out' => 'html', 'multiple' => 1), true), 'cat_chooser_url');
 }
开发者ID:kishoreweblabs,项目名称:SobiPro,代码行数:11,代码来源:entry.php


示例11: screen

 private function screen()
 {
     $bankData = SPLang::getValue('bankdata', 'application', Sobi::Section());
     if (!strlen($bankData)) {
         SPLang::getValue('bankdata', 'application');
     }
     $tile = Sobi::Txt('APP.BANK_TRANSFER_NAME');
     $this->getView('bank_transfer')->assign($tile, 'title')->assign($bankData, 'bankdata')->determineTemplate('extensions', 'bank-transfer')->display();
 }
开发者ID:kishoreweblabs,项目名称:SobiPro,代码行数:9,代码来源:bank_transfer.php


示例12: execute

 public function execute()
 {
     $method = explode('.', $this->_task);
     $this->nid = 'field_' . $method[0];
     $method = 'Proxy' . ucfirst($method[1]);
     $this->fid = SPFactory::db()->select('fid', 'spdb_field', array('nid' => $this->nid, 'section' => Sobi::Section()))->loadResult();
     $this->field = SPFactory::Model('field');
     $this->field->init($this->fid);
     $this->field->{$method}();
     return true;
 }
开发者ID:pelloq1,项目名称:SobiPro,代码行数:11,代码来源:field.php


示例13: save

 public function save(&$attr)
 {
     $data = array('key' => $this->nid . '-viewInfo', 'value' => $attr['viewInfo'], 'type' => 'field_information', 'fid' => $this->fid, 'id' => Sobi::Section(), 'section' => Sobi::Section());
     SPLang::saveValues($data);
     $data = array('key' => $this->nid . '-entryInfo', 'value' => $attr['entryInfo'], 'type' => 'field_information', 'fid' => $this->fid, 'id' => Sobi::Section(), 'section' => Sobi::Section());
     SPLang::saveValues($data);
     $attr['required'] = 0;
     $attr['fee'] = 0;
     $attr['isFree'] = 1;
     parent::save($attr);
 }
开发者ID:kishoreweblabs,项目名称:SobiPro,代码行数:11,代码来源:info.php


示例14: getGroupsField

 public static function getGroupsField()
 {
     $acl =& JFactory::getACL();
     $g = $acl->get_group_children_tree(null, 'USERS', false);
     $gids = array();
     foreach ($g as $k => $v) {
         $gids[] = get_object_vars($v);
     }
     array_unshift($gids, array('value' => '0', 'text' => Sobi::Txt('ACL.REG_VISITOR'), 'disable' => null));
     return $gids;
 }
开发者ID:kishoreweblabs,项目名称:SobiPro,代码行数:11,代码来源:users.php


示例15: search

 protected function search()
 {
     if (!SPFactory::mainframe()->checkToken()) {
         Sobi::Error('Token', SPLang::e('UNAUTHORIZED_ACCESS_TASK', SPRequest::task()), SPC::ERROR, 403, __LINE__, __FILE__);
     }
     //		$selected = SPRequest::int( 'selected', 0 );
     $ssid = SPRequest::base64('ssid');
     $query = SPRequest::string('q', null);
     $session = SPFactory::user()->getUserState('userSelector', null, array());
     $setting = $session[$ssid];
     /* get the site to display */
     $site = SPRequest::int('site', 1);
     $eLim = Sobi::Cfg('user_selector.entries_limit', 18);
     $eLimStart = ($site - 1) * $eLim;
     $params = array();
     if ($query) {
         $q = '%' . $query . '%';
         $params = SPFactory::db()->where(array('name' => $q, 'username' => $q, 'email' => $q), 'OR');
     }
     try {
         $count = SPFactory::db()->select('COUNT(*)', '#__users', $params, $setting['ordering'])->loadResult();
         $data = SPFactory::db()->select(array('id', 'name', 'username', 'email', 'registerDate', 'lastvisitDate'), '#__users', $params, $setting['ordering'], $eLim, $eLimStart)->loadAssocList();
     } catch (SPException $x) {
         echo $x->getMessage();
         exit;
     }
     $response = array('sites' => ceil($count / $eLim), 'site' => $site);
     if (count($data)) {
         $replacements = array();
         preg_match_all('/\\%[a-z]*/', $setting['format'], $replacements);
         $placeholders = array();
         if (isset($replacements[0]) && count($replacements[0])) {
             foreach ($replacements[0] as $placeholder) {
                 $placeholders[] = str_replace('%', null, $placeholder);
             }
         }
         if (count($replacements)) {
             foreach ($data as $index => $user) {
                 $txt = $setting['format'];
                 foreach ($placeholders as $attribute) {
                     if (isset($user[$attribute])) {
                         $txt = str_replace('%' . $attribute, $user[$attribute], $txt);
                     }
                 }
                 $data[$index]['text'] = $txt;
             }
         }
         $response['users'] = $data;
     }
     SPFactory::mainframe()->cleanBuffer();
     echo json_encode($response);
     exit;
 }
开发者ID:kishoreweblabs,项目名称:SobiPro,代码行数:53,代码来源:user.php


示例16: view

 private function view()
 {
     $type = $this->key('template_type', 'xslt');
     if ($type != 'php' && Sobi::Cfg('global.disable_xslt', false)) {
         $type = 'php';
     }
     if ($type == 'xslt') {
         $visitor = $this->get('visitor');
         $current = $this->get('section');
         $categories = $this->get('categories');
         $entries = $this->get('entries');
         $data = array();
         $data['id'] = $current->get('id');
         $data['section'] = array('_complex' => 1, '_data' => Sobi::Section(true), '_attributes' => array('id' => Sobi::Section(), 'lang' => Sobi::Lang(false)));
         $data['name'] = array('_complex' => 1, '_data' => $this->get('listing_name'), '_attributes' => array('lang' => Sobi::Lang(false)));
         if (Sobi::Cfg('category.show_desc')) {
             $desc = $current->get('description');
             if (Sobi::Cfg('category.parse_desc')) {
                 Sobi::Trigger('prepare', 'Content', array(&$desc, $current));
             }
             $data['description'] = array('_complex' => 1, '_cdata' => 1, '_data' => $desc, '_attributes' => array('lang' => Sobi::Lang(false)));
         }
         $data['meta'] = array('description' => $current->get('metaDesc'), 'keys' => $this->metaKeys($current), 'author' => $current->get('metaAuthor'), 'robots' => $current->get('metaRobots'));
         $data['entries_in_line'] = $this->get('$eInLine');
         $data['categories_in_line'] = $this->get('$cInLine');
         $this->menu($data);
         $this->alphaMenu($data);
         $data['visitor'] = $this->visitorArray($visitor);
         if (count($categories)) {
             foreach ($categories as $category) {
                 if (is_numeric($category)) {
                     $category = SPFactory::Category($category);
                 }
                 $data['categories'][] = array('_complex' => 1, '_attributes' => array('id' => $category->get('id'), 'nid' => $category->get('nid')), '_data' => $this->category($category));
                 unset($category);
             }
         }
         if (count($entries)) {
             $this->loadNonStaticData($entries);
             $manager = Sobi::Can('entry', 'edit', '*', Sobi::Section()) ? true : false;
             foreach ($entries as $eid) {
                 $en = $this->entry($eid, $manager);
                 $data['entries'][] = array('_complex' => 1, '_attributes' => array('id' => $en['id']), '_data' => $en);
             }
             $this->navigation($data);
         }
         $this->_attr = $data;
     }
     // general listing trigger
     Sobi::Trigger('Listing', ucfirst(__FUNCTION__), array(&$this->_attr));
     // specific lisitng trigger
     Sobi::Trigger($this->_type, ucfirst(__FUNCTION__), array(&$this->_attr));
 }
开发者ID:kishoreweblabs,项目名称:SobiPro,代码行数:53,代码来源:listing.php


示例17: __construct

 public function __construct($id = 0)
 {
     parent::__construct($id);
     if (is_numeric($this->gid)) {
         $this->gid = array($this->gid);
     }
     $this->spGroups();
     /* include default visitor permissions */
     $this->gid[] = 0;
     $this->parentGids();
     Sobi::Trigger('UserGroup', 'Appoint', array($id, &$this->gid));
 }
开发者ID:kishoreweblabs,项目名称:SobiPro,代码行数:12,代码来源:user.php


示例18: moveFiles

 /**
  * Move files from directory to given path
  * @param string $target - target path
  * @return array
  */
 public function moveFiles($target)
 {
     $this->iterator();
     $log = array();
     foreach ($this->_dirIterator as $child) {
         if (!$child->isDot() && !SPFs::exists(Sobi::FixPath($target . DS . $child->getFileName()))) {
             if (SPFs::move($child->getPathname(), Sobi::FixPath($target . DS . $child->getFileName()))) {
                 $log[] = Sobi::FixPath($target . DS . $child->getFileName());
             }
         }
     }
     return $log;
 }
开发者ID:ranrolls,项目名称:ras-full-portal,代码行数:18,代码来源:directory.php


示例19: screen

 private function screen()
 {
     $data = SPFactory::registry()->loadDBSection('paypal_' . Sobi::Section())->get('paypal_' . Sobi::Section());
     if (!count($data)) {
         $data = SPFactory::registry()->loadDBSection('paypal')->get('paypal');
     }
     $ppexpl = SPLang::getValue('ppexpl', 'application', Sobi::Section());
     $ppsubj = SPLang::getValue('ppsubject', 'application', Sobi::Section());
     if (!strlen($ppsubj)) {
         $ppsubj = SPLang::getValue('ppsubject', 'application');
     }
     $this->getView('paypal')->assign($tile, 'title')->assign($data['ppurl']['value'], 'ppurl')->assign($data['ppemail']['value'], 'ppemail')->assign($data['pprurl']['value'], 'pprurl')->assign($data['ppcc']['value'], 'ppcc')->assign($ppexpl, 'ppexpl')->assign($ppsubj, 'ppsubject')->determineTemplate('extensions', 'paypal')->display();
 }
开发者ID:ranrolls,项目名称:ras-full-portal,代码行数:13,代码来源:paypal.php


示例20: remove

 public function remove($def)
 {
     $eid = $def->getElementsByTagName('id')->item(0)->nodeValue;
     $name = $def->getElementsByTagName('name')->item(0)->nodeValue;
     $type = $def->getElementsByTagName('type')->item(0)->nodeValue;
     $id = SPFactory::db()->select('extension_id', '#__extensions', array('type' => $type, 'element' => $eid))->loadResult();
     jimport('joomla.installer.installer');
     if (JInstaller::getInstance()->uninstall($type, $id)) {
         SPFactory::db()->delete('spdb_plugins', array('pid' => $eid, 'type' => $type), 1);
         return Sobi::Txt('CMS_EXT_REMOVED', $name);
     }
     return array('msg' => Sobi::Txt('CMS_EXT_NOT_REMOVED', $name), 'msgtype' => 'error');
 }
开发者ID:ranrolls,项目名称:ras-full-portal,代码行数:13,代码来源:installer.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP Social类代码示例发布时间:2022-05-23
下一篇:
PHP SoapServer类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap