本文整理汇总了PHP中Sobi::Section方法的典型用法代码示例。如果您正苦于以下问题:PHP Sobi::Section方法的具体用法?PHP Sobi::Section怎么用?PHP Sobi::Section使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Sobi
的用法示例。
在下文中一共展示了Sobi::Section方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: menu
protected function menu(&$data)
{
if (Sobi::Cfg('general.top_menu', true)) {
$data['menu'] = array('front' => array('_complex' => 1, '_data' => Sobi::Reg('current_section_name'), '_attributes' => array('lang' => Sobi::Lang(false), 'url' => Sobi::Url(array('sid' => Sobi::Section())))));
if (Sobi::Can('section.search')) {
$data['menu']['search'] = array('_complex' => 1, '_data' => Sobi::Txt('MN.SEARCH'), '_attributes' => array('lang' => Sobi::Lang(false), 'url' => Sobi::Url(array('task' => 'search', 'sid' => Sobi::Section()))));
}
if (Sobi::Can('entry', 'add', 'own', Sobi::Section())) {
$data['menu']['add'] = array('_complex' => 1, '_data' => Sobi::Txt('MN.ADD_ENTRY'), '_attributes' => array('lang' => Sobi::Lang(false), 'url' => Sobi::Url(array('task' => 'entry.add', 'sid' => SPRequest::sid()))));
}
}
}
示例2: 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'));
}
}
}
}
示例3: load
private function load($task)
{
$db =& SPFactory::db();
$adm = defined('SOBIPRO_ADM') ? 'adm.' : null;
$cond = array($adm . '*', $adm . $task);
if (strstr($task, '.')) {
$t = explode('.', $task);
$cond[] = $adm . $t[0] . '.*';
$task = $t[0] . '.' . $t[1];
}
$this->_actions[$task] = null;
try {
$pids = $db->select('pid', 'spdb_plugin_task', array('onAction' => $cond))->loadResultArray();
} catch (SPException $x) {
Sobi::Error('Plugins', $x->getMessage(), SPC::WARNING, 0, __LINE__, __FILE__);
}
if (!count($pids)) {
$this->_actions[$task] = array();
}
// get section depend apps
if (Sobi::Section() && count($pids)) {
try {
$this->_actions[$task] = $db->select('pid', 'spdb_plugin_section', array('section' => Sobi::Section(), 'enabled' => 1, 'pid' => $pids))->loadResultArray();
} catch (SPException $x) {
Sobi::Error('Plugins', $x->getMessage(), SPC::WARNING, 0, __LINE__, __FILE__);
}
} elseif (!(SPRequest::sid() || SPRequest::int('pid'))) {
$this->_actions[$task] = $pids;
}
// here is a special exception for the custom listings
// it can be l.alpha or list.alpha or listing.alpha
if (preg_match('/^list\\..*/', $task) || preg_match('/^l\\..*/', $task)) {
$this->_actions['listing' . '.' . $t[1]] = $pids;
}
}
示例4: 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();
}
示例5: nameField
private function nameField()
{
/* get the field id of the field contains the entry name */
if ($this->section == Sobi::Section() || !$this->section) {
$nameField = Sobi::Cfg('entry.name_field');
} else {
$nameField = SPFactory::db()->select('sValue', 'spdb_config', array('section' => $this->section, 'sKey' => 'name_field', 'cSection' => 'entry'))->loadResult();
}
return $nameField ? $nameField : Sobi::Cfg('entry.name_field');
}
示例6: 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);
}
示例7: 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;
}
示例8: 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));
}
示例9: 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();
}
示例10: struct
/**
* @return array
* Ausgabe des Feldes in DV and vCard
*/
public function struct()
{
$data = SPLang::getValue($this->nid . '-viewInfo', 'field_information', Sobi::Section());
$attributes = array();
if (strlen($data)) {
$this->cssClass = strlen($this->cssClass) ? $this->cssClass : 'spFieldsData';
$this->cssClass = $this->cssClass . ' ' . $this->nid;
$this->cleanCss();
$attributes = array('lang' => Sobi::Lang(), 'class' => $this->cssClass);
} else {
$this->cssClass = strlen($this->cssClass) ? $this->cssClass : 'spField';
}
return array('_complex' => 1, '_data' => $data, '_attributes' => $attributes);
}
示例11: browse
private function browse()
{
/* create the header */
$list =& $this->get('applications');
$plugins = array();
if (count($list)) {
$c = 0;
foreach ($list as $plugin) {
$plugin['id'] = $plugin['type'] . '.' . $plugin['pid'];
$plugins[$c++] = $plugin;
}
}
$this->assign($plugins, 'applications');
$this->assign(Sobi::Section(true), 'section');
}
示例12: addSection
public function addSection($name, $section)
{
Sobi::Trigger('addSection', 'SPAdmSiteMenu', array($name, $section));
if ($name == 'AMN.APPS_HEAD' || $name == 'AMN.APPS_SECTION_HEAD') {
$p = SPFactory::Controller('extensions', true);
$links = $p->appsMenu();
if (is_array($links)) {
$section = array_merge($section, $links);
}
} elseif ($name == 'AMN.APPS_SECTION_TPL' && Sobi::Section() && Sobi::Cfg('section.template', SPC::DEFAULT_TEMPLATE)) {
$p = SPFactory::Controller('template', true);
$this->_custom[$name]['after'][] = $p->getTemplateTree(Sobi::Cfg('section.template', SPC::DEFAULT_TEMPLATE));
}
$this->_sections[$name] =& $section;
}
示例13: saveAttr
/**
* @param $attr
* @return mixed
* @throws SPException
*/
protected function saveAttr(&$attr)
{
if ($this->nid) {
$this->nid = $attr['nid'];
}
if (!isset($attr['viewInfo'])) {
$attr['viewInfo'] = $this->viewInfo;
$attr['entryInfo'] = $this->entryInfo;
}
$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;
return $attr;
}
示例14: 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
* @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'));
}
示例15: editFile
private function editFile()
{
if (Sobi::Section() && Sobi::Cfg('section.template') == SPC::DEFAULT_TEMPLATE) {
SPFactory::message()->warning(Sobi::Txt('TP.DEFAULT_WARN', 'https://www.sigsiu.net/help_screen/template.info'), false)->setSystemMessage();
}
$file = SPRequest::cmd('file');
$file = $this->file($file);
$ext = SPFs::getExt($file);
$fileContent = SPFs::read($file);
$path = str_replace('\\', '/', SOBI_PATH);
if (strstr($file, $path)) {
$filename = str_replace($path . '/usr/templates/', null, $file);
} else {
$filename = str_replace(SOBI_ROOT, null, $file);
}
$menu = $this->createMenu();
if (Sobi::Section()) {
$menu->setOpen('AMN.APPS_SECTION_TPL');
} else {
$menu->setOpen('GB.CFG.GLOBAL_TEMPLATES');
}
/** @var $view SPAdmTemplateView */
$view = SPFactory::View('template', true)->assign($fileContent, 'file_content')->assign($filename, 'file_name')->assign($ext, 'file_ext')->assign($menu, 'menu')->assign($this->_task, 'task')->assign(Sobi::Section(), 'sid')->addHidden(SPRequest::cmd('file'), 'fileName')->addHidden($filename, 'filePath')->determineTemplate('template', 'edit');
Sobi::Trigger('Edit', $this->name(), array(&$file, &$view));
$view->display();
}