本文整理汇总了PHP中Section类的典型用法代码示例。如果您正苦于以下问题:PHP Section类的具体用法?PHP Section怎么用?PHP Section使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Section类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: validate
protected function validate()
{
$required = array("class_level" => "Class", "section" => "Section", "code" => "Code");
global $user;
if ($user->checkAdmin() == true) {
if (isset($_POST)) {
foreach ($required as $key => $value) {
if (!isset($_POST[$key]) || $_POST[$key] == '' || $_POST[$key] == 'select') {
echo $value . ' is Required<br/>';
return;
}
}
echo 'Saving...';
global $objPDO;
require_once $_SERVER['DOCUMENT_ROOT'] . '/cloud/model/section_class.php';
$section = new Section($objPDO);
$section->setClass($_POST['class_level']);
$section->setSection($_POST['section']);
$section->setCode($_POST['code']);
$section->save();
echo '<meta http-equiv="Refresh" content="0;url=http://localhost/cloud/miscellaneous"/>';
}
} else {
header('Location:http://localhost/cloud');
}
}
示例2: GetURI
public static function GetURI($p_publicationId, $p_languageId, $p_issueNo = null, $p_sectionNo = null, $p_articleNo = null)
{
$translator = \Zend_Registry::get('container')->getService('translator');
$languageObj = new Language($p_languageId);
if (!$languageObj->exists()) {
return new PEAR_Error($translator->trans('Language does not exist.'));
}
$uri = '/' . $languageObj->getCode() . '/';
if (!is_null($p_issueNo) && is_null($p_articleNo)) {
$issueObj = new Issue($p_publicationId, $p_languageId, $p_issueNo);
if (!$issueObj->exists()) {
return new PEAR_Error($translator->trans('Issue does not exist.'));
}
$uri .= $issueObj->getUrlName() . '/';
}
if (!is_null($p_sectionNo) && is_null($p_articleNo)) {
$sectionObj = new Section($p_publicationId, $p_issueNo, $p_languageId, $p_sectionNo);
if (!$sectionObj->exists()) {
return new PEAR_Error($translator->trans('Section does not exist.'));
}
$uri .= $sectionObj->getUrlName() . '/';
}
if (!is_null($p_articleNo)) {
$articleObj = new Article($p_languageId, $p_articleNo);
if (!$articleObj->exists()) {
return new PEAR_Error($translator->trans('Article does not exist.'));
}
$issueObj = new Issue($p_publicationId, $p_languageId, $articleObj->getIssueNumber());
$sectionObj = new Section($p_publicationId, $articleObj->getIssueNumber(), $p_languageId, $articleObj->getSectionNumber());
$uri .= $issueObj->getUrlName() . '/';
$uri .= $sectionObj->getUrlName() . '/';
$uri .= $articleObj->getUrlName() . '/';
}
return $uri;
}
示例3: GetURI
public static function GetURI($p_publicationId, $p_languageId, $p_issueNo = null, $p_sectionNo = null, $p_articleNo = null)
{
$languageObj = new Language($p_languageId);
if (!$languageObj->exists()) {
return new PEAR_Error(getGS('Language does not exist.'));
}
$uri = $GLOBALS['Campsite']['SUBDIR'] . '/' . $languageObj->getCode() . '/';
if (!is_null($p_issueNo) && is_null($p_articleNo)) {
$issueObj = new Issue($p_publicationId, $p_languageId, $p_issueNo);
if (!$issueObj->exists()) {
return new PEAR_Error(getGS('Issue does not exist.'));
}
$uri .= $issueObj->getUrlName() . '/';
}
if (!is_null($p_sectionNo) && is_null($p_articleNo)) {
$sectionObj = new Section($p_publicationId, $p_issueNo, $p_languageId, $p_sectionNo);
if (!$sectionObj->exists()) {
return new PEAR_Error(getGS('Section does not exist.'));
}
$uri .= $sectionObj->getUrlName() . '/';
}
if (!is_null($p_articleNo)) {
$articleObj = new Article($p_languageId, $p_articleNo);
if (!$articleObj->exists()) {
return new PEAR_Error(getGS('Article does not exist.'));
}
$issueObj = new Issue($p_publicationId, $p_languageId, $articleObj->getIssueNumber());
$sectionObj = new Section($p_publicationId, $articleObj->getIssueNumber(), $p_languageId, $articleObj->getSectionNumber());
$uri .= $issueObj->getUrlName() . '/';
$uri .= $sectionObj->getUrlName() . '/';
$uri .= $articleObj->getUrlName() . '/';
}
return $uri;
}
示例4: getCriteria
function getCriteria()
{
$total_crit = array();
$article_search = new Article($this->dbcon);
if ($crit = $this->getData('sqlwhere')) {
if ($bad_spot = strpos($crit, "or typeid")) {
$crit = substr($crit, 0, $bad_spot) . ")";
}
$total_crit[] = $crit;
}
if ($id = $this->getData('class_id')) {
#$total_crit[] = "class =".$id;
$total_crit[] = $article_search->makeCriteriaClass($id);
}
if ($id = $this->getData('section_id')) {
$section = new Section($this->dbcon, $id);
$section_crit = $section->getDisplayCriteria();
$crit = join(' AND ', $article_search->makeCriteria($section_crit));
$total_crit[] = $crit;
}
if (empty($total_crit)) {
return $article_search->makeCriteriaDisplayable();
}
return "( " . join(" " . $this->getCombineLogic() . " ", $total_crit) . " ) AND " . $article_search->makeCriteriaDisplayable();
}
示例5: printS
function printS($id)
{
$ci =& get_instance();
$s = new Section();
$s->get_by_id($id);
$s->e = anchor($ci->app->app_url('edit/') . $s->id, 'Edit');
$s->d = anchor($ci->app->app_url('delete/') . $s->id, 'Delete');
$output = "<li>";
$output .= $s->id . '|';
$output .= $s->name;
$output .= add($id, 0, "add first child for {$s->name}");
$output .= '|';
$output .= $s->e;
$output .= '|';
$output .= $s->d;
$c = new Section();
$c->where('parent_section', $id);
$c->order_by('sort', 'asc');
$c->get();
if (count($c->all) > 0) {
$output .= "<ul>";
foreach ($c->all as $item) {
$output .= printS($item->id);
$output .= "<li>" . add($id, $item->sort + 1) . "</li>";
}
$output .= "</ul>";
}
$output .= "</li>";
return $output;
}
示例6: remove
public static function remove($name)
{
$sectionManager = new Section();
$sectionManager->load(array('label' => $name));
$rightManager = new Right();
$rightManager->delete(array('section' => $sectionManager->getId()));
$sectionManager->delete(array('id' => $sectionManager->getId()));
}
示例7: registerSection
/**
* The official register section function. Section on instantiation calls this function
* so that you don't have to. All sections should be registered with this manager.
* If you care about overriding this, message me or fork + Singleton it / change it.
*
* @param Section $section
*
* @return bool
*/
public static function registerSection(Section $section)
{
$uid = $section->getUID();
if (isset(self::$__sections[$uid])) {
return false;
}
self::$__sections[$uid] = $section;
return true;
}
示例8: findEntries
public static function findEntries($entries, Section $section)
{
$entries = explode(',', $entries);
$ret = EntryManager::fetch($entries, $section->get('id'));
if ($ret === false) {
self::throwEx('An error occurred while processing entries');
}
return $ret;
}
示例9: testGetSetIndex
/**
* getIndex() and setIndex() should get and set the index, respectively
*/
public function testGetSetIndex()
{
$index = 999;
$section = new Section();
$section->setIndex($index);
$expected = $index;
$actual = $section->getIndex();
$this->assertEquals($expected, $actual);
return;
}
示例10: index
public function index()
{
$valida = $this->protect->access_page('FDT');
$this->plantilla->loadSec("fdt/fdt", $valida);
$section = new Section();
$tps_index_control['menu'] = $section->menu('FDT');
$tps_index_control['header'] = $section->header();
$tps_index_control['footer'] = $section->footer();
$this->plantilla->set($tps_index_control);
$this->plantilla->getCache();
}
示例11: index
public function index()
{
$valida = $this->protect->access_page('INVENTARIO');
$this->plantilla->loadSec("inventario/inventario", $valida, 360000);
$section = new Section();
$tps_index_control['menu'] = $section->menu('INVENTARIO');
$tps_index_control['header'] = $section->header();
$tps_index_control['footer'] = $section->footer();
$this->plantilla->set($tps_index_control);
$this->plantilla->finalize();
}
示例12: perfil
public function perfil()
{
$this->plantilla->load("login/login_perfil");
$section = new Section();
$tps_index_control['menu'] = $section->menu('Profile');
$tps_index_control['header'] = $section->header();
$tps_index_control['footer'] = $section->footer(false, true, false);
$tps_index_control['PROFILE'] = $this->language->PROFILE;
$this->plantilla->set($tps_index_control);
$this->plantilla->finalize();
}
示例13: addProperty
private function addProperty($key, $value)
{
$property = $this->currentSection->getProperty($key);
if (!$property) {
$property = new Property($key);
$this->currentSection->addProperty($property);
}
$property->value = $value;
$property->comment = $this->commentBlock;
$this->commentBlock = array();
}
示例14: build_list_item
function build_list_item($id, $title, $class = '', $current = '')
{
$section = new Section(AMP_Registry::getDbcon(), $id);
if (!$section->isLive()) {
return '';
}
$html = '';
$html .= '<li class="sidelist ' . $class . '">
<a class="' . $current . 'sidelist_link" href="article.php?list=type&type=' . $id . '">' . $title . '</a>
</li>';
return $html;
}
示例15: index
public function index()
{
$valida = $this->protect->access_page('ADMINISTRACION');
$this->plantilla->loadSec("administracion/administracion", $valida, 36000);
$section = new Section();
$tps_index_control['menu'] = $section->menu('ADMINISTRACION');
$tps_index_control['header'] = $section->header();
$tps_index_control['footer'] = $section->footer();
$tabs[] = array('title' => $this->language->USERS, 'urlBase' => true, 'href' => 'admin/user', 'protec' => 'ADMINISTRATION_USER');
$tabs[] = array('title' => $this->language->GROUP, 'urlBase' => true, 'href' => 'admin/groups', 'protec' => 'ADMINISTRATION_GROUPS');
$tabs[] = array('title' => $this->language->AUDIT, 'urlBase' => true, 'href' => 'admin/audit', 'protec' => 'ADMINISTRATION_AUDIT');
/* Bmonitor 2.5
$tabs[] = array(
'title' => $this->language->TEMPLATE_LANG,
'urlBase' => true,
'href' => 'admin/template',
'protec' => 'ADMINISTRATION_TEMPLATE'
);
$tabs[] = array(
'title' => $this->language->FIRMWARE,
'urlBase' => true,
'href' => 'admin/firmware',
'protec' => 'ADMINISTRATION_FIRMWARE'
);
$tabs[] = array(
'title' => $this->language->OPTIONS,
'urlBase' => true,
'href' => 'admin/option',
'protec' => 'ADMINISTRATION_OPTION'
);
*/
$tabs[] = array('title' => 'Parametros', 'urlBase' => true, 'href' => 'admin/parameter', 'protec' => 'ADMINISTRATION_PARAM');
/* Bmonitor 2.5
$tabs[] = array(
'title' => 'Feature',
'urlBase' => true,
'href' => 'admin/feature',
'protec' => 'ADMINISTRATION_FEATURE'
);
*/
$tps_index_control['tabs'] = $this->bmonitor->getTabs($tabs, 'tabsAdmin');
$tps_index_control['user_lang'] = $this->language->USER;
$tps_index_control['groups_lang'] = $this->language->GROUPS;
$tps_index_control['page_lang'] = $this->language->PAGINA;
$tps_index_control['audi_lang'] = $this->language->AUDITORIA;
$tps_index_control['templates_lang'] = $this->language->TEMPLATE_LANG;
$tps_index_control['parameters_lang'] = $this->language->PARAMETROS;
$tps_index_control['import_lang'] = $this->language->IMPORT;
$this->plantilla->set($tps_index_control);
$this->plantilla->finalize();
}