/** * */ 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()); }
/** * */ public function display() { $tpl = SPLoader::path($this->_template . '_override', 'adm.template'); if (!$tpl) { $tpl = SPLoader::path($this->_template, 'adm.template'); } if (!$tpl) { $tpl = SPLoader::translatePath($this->_template, 'adm.template', false); Sobi::Error($this->name(), SPLang::e('TEMPLATE_DOES_NOT_EXISTS', $tpl), SPC::ERROR, 500, __LINE__, __FILE__); exit; } Sobi::Trigger('Display', $this->name(), array(&$this)); $action = $this->key('action'); echo "\n<!-- SobiPro output -->\n"; echo '<div class="SobiPro" id="SobiPro">' . "\n"; if ($this->_legacy) { echo SPFactory::AdmToolbar()->render(); echo $this->legacyMessages(); echo '<div class="row-fluid">' . "\n"; } echo $action ? "\n<form action=\"{$action}\" method=\"post\" name=\"adminForm\" id=\"SPAdminForm\" enctype=\"multipart/form-data\" accept-charset=\"utf-8\" >\n" : null; $prefix = null; if (!$this->_legacy) { $prefix = 'SP_'; } include $tpl; if (count($this->_hidden)) { $this->_hidden[SPFactory::mainframe()->token()] = 1; $this->_hidden['spsid'] = microtime(true) + Sobi::My('id') * mt_rand(5, 15) / mt_rand(5, 15); foreach ($this->_hidden as $name => $value) { echo "\n<input type=\"hidden\" name=\"{$name}\" id=\"{$prefix}{$name}\" value=\"{$value}\"/>"; } } echo $action ? "\n</form>\n" : null; if ($this->_legacy) { echo '</div>' . "\n"; } echo '</div>' . "\n"; echo "\n<!-- SobiPro output end -->\n"; Sobi::Trigger('AfterDisplay', $this->name()); }