本文整理汇总了PHP中Section类的典型用法代码示例。如果您正苦于以下问题:PHP Section类的具体用法?PHP Section怎么用?PHP Section使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Section类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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');
}
}
开发者ID:srinivasans,项目名称:educloud,代码行数:26,代码来源:sectionController.php
示例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;
}
开发者ID:sourcefabric,项目名称:newscoop,代码行数:35,代码来源:ShortURL.php
示例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;
}
开发者ID:nidzix,项目名称:Newscoop,代码行数:34,代码来源:ShortURL.php
示例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();
}
开发者ID:radicaldesigns,项目名称:amp,代码行数:25,代码来源:Feed.inc.php
示例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;
}
开发者ID:blumine,项目名称:vunsy,代码行数:30,代码来源:view.php
示例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()));
}
开发者ID:kofeve,项目名称:yana-server,代码行数:8,代码来源:Section.class.php
示例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;
}
开发者ID:ayanray,项目名称:php-utils,代码行数:18,代码来源:SectionManager.php
示例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;
}
开发者ID:alpacaaa,项目名称:image_info,代码行数:9,代码来源:class.images_info.php
示例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;
}
开发者ID:jstewmc,项目名称:rtf,代码行数:13,代码来源:SectionTest.php
示例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();
}
开发者ID:rafaelurrutia,项目名称:bmonitor-y-bi,代码行数:11,代码来源:fdt.php
示例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();
}
开发者ID:rafaelurrutia,项目名称:bmonitor-y-bi,代码行数:11,代码来源:inventario.php
示例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();
}
开发者ID:rafaelurrutia,项目名称:bmonitor-y-bi,代码行数:11,代码来源:login.php
示例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();
}
开发者ID:programie,项目名称:pini,代码行数:11,代码来源:Parser.php
示例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;
}
开发者ID:radicaldesigns,项目名称:winonline,代码行数:12,代码来源:nav.tiered_sections.php
示例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();
}
开发者ID:rafaelurrutia,项目名称:bmonitor-y-bi,代码行数:53,代码来源:admin.php
示例16: removeSection
public function removeSection(Section $section)
{
$count = count($this->sections);
$id = $section->getId();
for ($i = 0; $i < $count; $i++) {
if ($this->sections[$i]->getId() === $id) {
array_splice($this->sections, $i, 1);
$i--;
$count--;
}
}
return $this;
}
开发者ID:jatolmed,项目名称:links,代码行数:13,代码来源:Section.php
示例17: shouldReturnAliasNameInGetValuesWhenSet
/**
* @test
*/
public function shouldReturnAliasNameInGetValuesWhenSet()
{
// given
$section = new Section();
$section->setWrittenBy(100);
$section->commit();
$this->assertEquals(100, $section->getWrittenBy());
// when
$values = json_decode($section, true);
// then
$this->assertNotNull($values['writtenBy']);
$this->assertArrayNotHasKey('written_by', $values);
$this->assertEquals(100, $values['writtenBy']);
}
开发者ID:manishkhanchandani,项目名称:mkgxy,代码行数:17,代码来源:ColumnAliasTest.php
示例18: nav_sub_section
function nav_sub_section($type,$sort) {
$finder= new Section(AMP_Registry::getDbcon());
if(isset($sort) && $sort){
$finder_source = &$finder->getSearchSource();
$finder_source->addSort($sort);
}
$sections = $finder->find(array('parent'=>$type,'displayable'=>'1'));
if (!$sections) return;
$html = '<ul>';
foreach($sections as $section) {
$html .= '<li><a href="section.php?id='.$section->id.'">'.$section->getName().'</a><img src="img/spacer.gif" height="4" width="3" align="left"> </li>';
}
$html .= '</ul>';
return $html;
}
开发者ID:radicalsuz,项目名称:amp,代码行数:15,代码来源:MainMenu.php
示例19: get_sections
function get_sections($con, $args)
{
$sections = array();
if (isset($args["section_id"])) {
$section_id = $args["section_id"];
$sql = $con->prepare("SELECT section_name,tid,`order` FROM section WHERE section_id=?");
$sql->bind_param("i", $section_id);
$sql->bind_result($section_name, $tid, $order);
$sql->execute();
$sql->fetch();
$sql->close();
if (isset($section_name) && isset($tid) && isset($order)) {
$tmp = new Section();
$tmp->populate($section_id, $tid, $section_name, [], $order);
$sections[] = $tmp->expose();
}
} else {
if (isset($args["section_name"])) {
$section_name = $args["section_name"];
$sql = $con->prepare("SELECT section_id,tid,`order` FROM section WHERE section_name=?");
$sql->bind_param("s", $section_name);
$sql->bind_result($section_id, $tid, $order);
$sql->execute();
while ($sql->fetch()) {
if (isset($section_id) && isset($tid) && isset($order)) {
$tmp = new Section();
$tmp->populate($section_id, $tid, $section_name, [], $order);
$sections[] = $tmp->expose();
}
}
$sql->close();
} else {
$sql = $con->prepare("SELECT section_id,tid,section_name,`order` FROM section");
$sql->bind_result($section_id, $tid, $section_name, $order);
$sql->execute();
while ($sql->fetch()) {
if (isset($section_id) && isset($tid) && isset($section_name) && isset($order)) {
$tmp = new Section();
$tmp->populate($section_id, $tid, $section_name, [], $order);
$section = $tmp->expose();
$sections[] = $section;
}
}
$sql->close();
}
}
return $sections;
}
开发者ID:nathanmarianovsky,项目名称:manualmath.com,代码行数:48,代码来源:section_functions.php
示例20: smarty_function_set_section
/**
* Campsite set_section function plugin
*
* Type: function
* Name: set_section
* Purpose:
*
* @param array
* $p_params[name] The Name of the section to be set
* $p_params[number] The Number of the section to be set
* @param object
* $p_smarty The Smarty object
*/
function smarty_function_set_section($p_params, &$p_smarty)
{
// gets the context variable
$campsite = $p_smarty->getTemplateVars('gimme');
if (isset($p_params['number'])) {
$attrName = 'number';
$attrValue = $p_params['number'];
$sectionNumber = intval($p_params['number']);
} elseif (isset($p_params['name'])) {
$sections = Section::GetSections($campsite->publication->identifier, $campsite->issue->number, $campsite->language->number, null, $p_params['name']);
if (isset($sections[0])) {
$attrName = 'name';
$attrValue = $p_params['name'];
$sectionNumber = intval($sections[0]->getSectionNumber());
} else {
$campsite->section->trigger_invalid_value_error($attrName, $attrValue, $p_smarty);
return false;
}
} else {
$property = array_shift(array_keys($p_params));
CampTemplate::singleton()->trigger_error("invalid parameter '{$property}' in set_section");
return false;
}
if ($campsite->section->defined && $campsite->section->number == $sectionNumber) {
return;
}
$sectionObj = new MetaSection($campsite->publication->identifier, $campsite->issue->number, $campsite->language->number, $sectionNumber);
if ($sectionObj->defined) {
$campsite->section = $sectionObj;
}
}
开发者ID:sourcefabric,项目名称:newscoop,代码行数:44,代码来源:function.set_section.php
注:本文中的Section类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论