当前位置: 首页>>代码示例>>PHP>>正文


PHP Sections类代码示例

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


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

示例1: display_page_content

function display_page_content()
{
    $section_name = requestIdParam();
    $section = Sections::FindByName($section_name);
    $items = $section->findItems();
    ?>
		
		<div id="right">
			<h3>Item Thumbnail</h3>
		</div>
		<div id="center">
			<h3>All the <?php 
    echo $section->display_name;
    ?>
</h3>
			<?php 
    echo $section->content;
    ?>
		<?php 
    echo "<ul>\r\n";
    foreach ($items as $item) {
        echo "\t\t\t<li><a href=\"" . get_link("portfolio/item/{$section_name}/" . $item->name) . "\">{$item->display_name}</a></li>\r\n";
    }
    echo "\t\t</ul>\r\n";
    ?>
		</div>
		<?php 
}
开发者ID:highchair,项目名称:hcd-trunk,代码行数:28,代码来源:view.php

示例2: layout

 /**
  * list sections
  *
  * @param resource the SQL result
  * @return an array of $url => (NULL, $title, NULL, 'section_123', NULL, 'visit this section')
  *
  * @see layouts/layout.php
  **/
 function layout($result)
 {
     global $context;
     // empty list
     if (!SQL::count($result)) {
         $output = array();
         return $output;
     }
     // no hovering label
     $href_title = '';
     // we return an array of ($url => $attributes)
     $items = array();
     // process all items in the list
     while ($item = SQL::fetch($result)) {
         // the url to view this item
         $url = Sections::get_permalink($item);
         // initialize variables
         $prefix = $suffix = '';
         // list all components for this item
         $items[$url] = array($prefix, ucfirst(Skin::strip($item['index_title'], 30)), $suffix, 'section_' . $item['id'], NULL, $href_title);
     }
     // end of processing
     SQL::free($result);
     return $items;
 }
开发者ID:rair,项目名称:yacs,代码行数:33,代码来源:layout_sections_as_main_tabs.php

示例3: layout

 /**
  * list sections
  *
  * @param resource the SQL result
  * @return string the rendered text
  *
  * @see layouts/layout.php
  **/
 function layout($result)
 {
     global $context;
     // empty list
     if (!SQL::count($result)) {
         $output = array();
         return $output;
     }
     // we return some text
     $text = '';
     // process all items in the list
     while ($item = SQL::fetch($result)) {
         // we want to make it visual
         if (!$item['thumbnail_url']) {
             continue;
         }
         // a title for the image --do not force a title
         if (isset($item['title'])) {
             $title = $item['title'];
         } else {
             $title = '';
         }
         // the url to view this item
         $url = Sections::get_permalink($item);
         // use the skin to shape it
         $text .= Skin::build_image('thumbnail', $item['thumbnail_url'], $title, $url);
     }
     // end of processing
     SQL::free($result);
     return $text;
 }
开发者ID:rair,项目名称:yacs,代码行数:39,代码来源:layout_sections_as_thumbnails.php

示例4: display_page_content

function display_page_content()
{
    $section_name = requestIdParam();
    $section = Sections::FindByName($section_name);
    $item_name = getRequestVarAtIndex(3);
    $item = Items::FindByName($item_name);
    $gallery = $item->getGallery();
    ?>

		<h1><?php 
    echo $item->display_name;
    ?>
</h1>
<?php 
    $next_item = $item->findNext($section);
    $prev_item = $item->findPrev($section);
    if ($prev_item) {
        echo "\t\t\t\t<a href=\"" . get_link("portfolio/item/{$section_name}/" . $prev_item->name) . "\">previous</a>\n";
    }
    if ($next_item) {
        echo "\t\t\t\t<a href=\"" . get_link("portfolio/item/{$section_name}/" . $next_item->name) . "\">next</a>\n";
    }
    echo $item->content;
    foreach ($gallery->get_photos() as $photo) {
        echo "<img src=\"/" . $photo->getPublicUrl() . "\" /><br />";
    }
}
开发者ID:highchair,项目名称:hcd-trunk,代码行数:27,代码来源:item.php

示例5: breadCrumbs

function breadCrumbs($section)
{
    $data = Sections::bread($section);
    $str = "";
    for ($i = count($data) - 1; $i >= 0; $i--) {
        $str .= "<a href='/?section=" . $data[$i]['id'] . "'>" . $data[$i]['name'] . "</a>/";
    }
    return $str;
}
开发者ID:xarrper,项目名称:cms,代码行数:9,代码来源:index.php

示例6: display_page_content

function display_page_content()
{
    $listname = getRequestVarAtIndex(2);
    switch ($listname) {
        case "portfolio":
            foreach ($_POST as $ordered_objects => $order_value) {
                // splits up the key to see if we are ordering a section, item or ignoring a portfolio area
                $ordered_parts = explode("_", $ordered_objects);
                // NOTICE: I have learned that when there are portfoli orphans, this reordering script breaks. I removed the hidden fields in the Orphans section, but check in on that if you notice reordering breaking again.
                //$debug = "";
                if ($ordered_parts[0] != "PortFolioAreas") {
                    if ($ordered_parts[0] == "SectionOrder") {
                        $section = Sections::FindById($ordered_parts[1]);
                        $section->display_order = $order_value;
                        $section->save();
                        //$debug .= $section->display_name." updated";
                    } else {
                        $section = Sections::FindById($ordered_parts[0]);
                        $item = Items::FindById($ordered_parts[1]);
                        $item->updateOrderInSection($section, $order_value);
                        //$debug .= $item->display_name." updated";
                    }
                }
                //setFlash( "<h3>".$debug."</h3>" );
                //setFlash( "<h3>".var_export( $_POST, true )."</h3>" );
            }
            break;
        case "areaspages":
            foreach ($_POST as $ordered_objects => $order_value) {
                // splits up the key to see if we are ordering a section, item or ignoring a portfolio area
                $ordered_parts = explode("_", $ordered_objects);
                //$debug = "";
                if ($ordered_parts[0] == "AreaOrder") {
                    $area = Areas::FindById($ordered_parts[1]);
                    $area->display_order = $order_value;
                    $area->save();
                    //$debug .= "$area->display_name updated";
                } else {
                    if ($ordered_parts[0] == "SubPage") {
                        $page = Pages::FindById($ordered_parts[1]);
                        $page->display_order = $order_value;
                        $page->save();
                        //$debug .= "$page->display_name sub page updated";
                    } else {
                        $area = Areas::FindById($ordered_parts[0]);
                        $page = Pages::FindById($ordered_parts[1]);
                        $page->updateOrderInArea($area, $order_value);
                        //$debug .= "$page->display_name updated in $area->display_name";
                    }
                }
            }
            //setFlash( "<h3>".$debug."</h3>" );
            //setFlash( "<h3>".var_export( $_POST, true )."</h3>" );
            break;
    }
}
开发者ID:highchair,项目名称:hcd-trunk,代码行数:56,代码来源:order_parse.php

示例7: run

 public function run()
 {
     DB::table('sections')->delete();
     $section = array('title' => Lang::get('display.teachers'), 'description' => '', 'file' => false, 'status' => 'publish', 'type' => 'teachers', 'order' => 1);
     Sections::create($section);
     $section = array('title' => Lang::get('display.promotioners'), 'description' => '', 'file' => false, 'status' => 'publish', 'type' => 'promotioners', 'order' => 2);
     Sections::create($section);
     $section = array('title' => Lang::get('display.supporters'), 'description' => '', 'file' => false, 'status' => 'publish', 'type' => 'supporters', 'order' => 3);
     Sections::create($section);
     $section = array('title' => Lang::get('display.inscriptions'), 'description' => '', 'file' => false, 'status' => 'publish', 'type' => 'inscriptions', 'order' => 4);
     Sections::create($section);
     $section = array('title' => Lang::get('display.works'), 'description' => '', 'file' => false, 'status' => 'publish', 'type' => 'works', 'order' => 5);
     Sections::create($section);
 }
开发者ID:nagyist,项目名称:abge,代码行数:14,代码来源:SectionsTableSeeder.php

示例8: FindBySectionName

 function FindBySectionName($section_name = "")
 {
     if ($section_name == "") {
         return array();
     }
     $section = Sections::FindByName($section_name);
     $items = $section->findItems();
     $id_list = "";
     foreach ($items as $item) {
         $id_list .= "{$item->id},";
     }
     $id_list = trim($id_list, ',');
     return MyActiveRecord::FindBySql('Keywords', "SELECT DISTINCT k.* FROM keywords k inner join items_keywords ik ON ik.keywords_id = k.id and ik.items_id in ({$id_list})");
 }
开发者ID:highchair,项目名称:hcd-trunk,代码行数:14,代码来源:keywords.php

示例9: layout

 /**
  * list sections
  *
  * @param resource the SQL result
  * @return string the rendered text
  *
  * @see layouts/layout.php
  **/
 function layout($result)
 {
     global $context;
     // we return some text
     $text = '';
     // empty list
     if (!SQL::count($result)) {
         return $text;
     }
     // process all items in the list
     while ($item = SQL::fetch($result)) {
         // get the related overlay
         $overlay = Overlay::load($item, 'section:' . $item['id']);
         // more text
         $text .= Sections::to_xml($item, $overlay);
     }
     // end of processing
     SQL::free($result);
     return $text;
 }
开发者ID:rair,项目名称:yacs,代码行数:28,代码来源:layout_sections_as_xml.php

示例10: dirname

<?php

/*
 * Print edit folder
 *********************/
/* functions */
require dirname(__FILE__) . '/../../../functions/functions.php';
# initialize user object
$Database = new Database_PDO();
$User = new User($Database);
$Admin = new Admin($Database, false);
$Sections = new Sections($Database);
$Subnets = new Subnets($Database);
$Tools = new Tools($Database);
$Result = new Result();
# verify that user is logged in
$User->check_user_session();
# create csrf token
$csrf = $User->csrf_cookie("create", "folder");
# strip tags - XSS
$_POST = $User->strip_input_tags($_POST);
# validate action
$Admin->validate_action($_POST['action'], true);
# ID must be numeric
if ($_POST['action'] != "add") {
    if (!is_numeric($_POST['subnetId'])) {
        $Result->show("danger", _("Invalid ID"), true, true);
    }
}
# verify that user has permissions to add subnet
if ($_POST['action'] == "add") {
开发者ID:routenull0,项目名称:phpipam,代码行数:31,代码来源:edit-folder.php

示例11: transform_reference

 /**
  * reference another page at this site
  *
  * The function transforms a local reference (e.g;, [code][user=2][/code])
  * to an actual link relative to the YACS directory (e.g., [code]users/view.php/2[/code]),
  * adds a title and, sometimes, set a description as well.
  *
  * @param string any string, maybe with a local reference in it
  * @return an array($url, $title, $description) or NULL
  *
  * @see images/view.php
  * @see links/edit.php
  * @see shared/codes.php
  */
 public static function transform_reference($text)
 {
     global $context;
     // translate this reference to an internal link
     if (preg_match("/^\\[(article|section|file|image|category|user)=(.+?)\\]/i", $text, $matches)) {
         switch ($matches[1]) {
             // article link
             case 'article':
                 if ($item = Articles::get($matches[2])) {
                     return array(Articles::get_permalink($item), $item['title'], $item['introduction']);
                 }
                 return array('', $text, '');
                 // section link
             // section link
             case 'section':
                 if ($item = Sections::get($matches[2])) {
                     return array(Sections::get_permalink($item), $item['title'], $item['introduction']);
                 }
                 return array('', $text, '');
                 // file link
             // file link
             case 'file':
                 if ($item = Files::get($matches[2])) {
                     return array(Files::get_url($matches[2]), $item['title'] ? $item['title'] : str_replace('_', ' ', ucfirst($item['file_name'])));
                 }
                 return array('', $text, '');
                 // image link
             // image link
             case 'image':
                 include_once $context['path_to_root'] . 'images/images.php';
                 if ($item = Images::get($matches[2])) {
                     return array(Images::get_url($matches[2]), $item['title'] ? $item['title'] : str_replace('_', ' ', ucfirst($item['image_name'])));
                 }
                 return array('', $text, '');
                 // category link
             // category link
             case 'category':
                 if ($item = Categories::get($matches[2])) {
                     return array(Categories::get_permalink($item), $item['title'], $item['introduction']);
                 }
                 return array('', $text, '');
                 // user link
             // user link
             case 'user':
                 if ($item = Users::get($matches[2])) {
                     return array(Users::get_permalink($item), $item['full_name'] ? $item['full_name'] : $item['nick_name']);
                 }
                 return array('', $text, '');
         }
     }
     return array('', $text, '');
 }
开发者ID:rair,项目名称:yacs,代码行数:66,代码来源:links.php

示例12: addDocumentToBinder

    /**
     * Add document to binder
     * @param $docId
     */
    public static function addDocumentToBinder($docId)
    {
        $document = Documents::model()->findByPk($docId);
        if ($document) {
            $year = substr($document->Created, 0, 4);
            Storages::createProjectStorages($document->Project_ID, $year);
            $subsectionId = 0;
            if ($document->Document_Type == Documents::PM) {
                $payment = Payments::model()->findByAttributes(array(
                    'Document_ID' => $docId,
                ));
                $year = substr($payment->Payment_Check_Date, 0, 4);
                $subsectionId = Sections::createLogBinder($document->Project_ID, $document->Document_Type, $year);
            } elseif ($document->Document_Type == Documents::PO) {
                $po = Pos::model()->findByAttributes(array(
                    'Document_ID' => $docId,
                ));
                $year = substr($po->PO_Date, 0, 4);
                $subsectionId = Sections::createLogBinder($document->Project_ID, $document->Document_Type, $year);
                if ($po->PO_Backup_Document_ID != 0) {
                    $bu = LibraryDocs::model()->findByAttributes(array(
                        'Document_ID' => $po->PO_Backup_Document_ID,
                        'Subsection_ID' => $subsectionId,
                    ));
                    if (!$bu) {
                        $libDoc = new LibraryDocs();
                        $libDoc->Document_ID = $po->PO_Backup_Document_ID;
                        $libDoc->Subsection_ID = $subsectionId;
                        $libDoc->Access_Type = Storages::HAS_ACCESS;
                        $libDoc->Sort_Numb = 0;
                        if ($libDoc->validate()) {
                            $libDoc->save();
                        }
                    }
                }
            }

            $libDoc = LibraryDocs::model()->findByAttributes(array(
                'Document_ID' => $docId,
                'Subsection_ID' => $subsectionId,
            ));

            if (!$libDoc) {
                $libDoc = new LibraryDocs();
                $libDoc->Document_ID = $docId;
                $libDoc->Subsection_ID = $subsectionId;
                $libDoc->Access_Type = Storages::HAS_ACCESS;
                $libDoc->Sort_Numb = 0;
                if ($libDoc->validate()) {
                    $libDoc->save();
                }
            }

            LibraryDocs::sortDocumentsInSubsection($subsectionId);
        }
    }
开发者ID:ranvijayj,项目名称:htmlasa,代码行数:60,代码来源:LibraryDocs.php

示例13: elseif

 // flag sections that are dead, or created or updated very recently
 if ($section['expiry_date'] > NULL_DATE && $section['expiry_date'] <= $context['now']) {
     $prefix .= EXPIRED_FLAG;
 } elseif ($section['create_date'] >= $context['fresh']) {
     $suffix .= NEW_FLAG;
 } elseif ($section['edit_date'] >= $context['fresh']) {
     $suffix .= UPDATED_FLAG;
 }
 // info on related comments
 if ($count = Comments::count_for_anchor('section:' . $section['id'], TRUE)) {
     $suffix .= ' (' . $count . ')';
 }
 // details
 $details = array();
 // info on related sections
 if ($count = Sections::count_for_anchor('section:' . $section['id'])) {
     $details[] = sprintf(i18n::ns('%d section', '%d sections', $count), $count);
 }
 // info on related articles
 if ($count = Articles::count_for_anchor('section:' . $section['id'])) {
     $details[] = sprintf(i18n::ns('%d page', '%d pages', $count), $count);
 }
 // info on related files
 if ($count = Files::count_for_anchor('section:' . $section['id'], TRUE)) {
     $details[] = sprintf(i18n::ns('%d file', '%d files', $count), $count);
 }
 // info on related links
 if ($count = Links::count_for_anchor('section:' . $section['id'], TRUE)) {
     $details[] = sprintf(i18n::ns('%d link', '%d links', $count), $count);
 }
 // the parent link
开发者ID:rair,项目名称:yacs,代码行数:31,代码来源:select.php

示例14: dirname

require_once dirname(__FILE__) . '/../../../functions/functions.php';
# initialize user object, if not already set
if (!isset($Database)) {
    $Database = new Database_PDO();
}
if (!isset($User)) {
    $User = new User($Database);
}
if (!isset($Admin)) {
    $Admin = new Admin($Database);
}
if (!isset($Tools)) {
    $Tools = new Tools($Database);
}
if (!isset($Sections)) {
    $Sections = new Sections($Database);
}
if (!isset($Subnets)) {
    $Subnets = new Subnets($Database);
}
# verify that user is logged in, to guard against direct access of page and possible exploits
$User->check_user_session();
# Get mask check
#automated $cidrformat = isset($_GET['cidrformat']) ? $_GET['cidrformat'] : "off";
#separate option $rebuildmnr = isset($_GET['rebuildmnr']) ? $_GET['rebuildmnr'] : "off";
# read again the custom fields, if any
if (!isset($custom_fields)) {
    $custom_fields = $Tools->fetch_custom_fields("subnets");
}
# fetch all l2 domains
$vlan_domains = $Admin->fetch_all_objects("vlanDomains", "id");
开发者ID:martinsv,项目名称:phpipam,代码行数:31,代码来源:import-subnets-check.php

示例15: array_merge

            $menu = array_merge($menu, Skin::navigate($home, $prefix, $count, $items_per_page, $page));
            // add a menu at the bottom
            $text .= Skin::build_list($menu, 'menu_bar');
        }
        // make a box
        if ($items) {
            $text .= Skin::build_box('', $items, 'header1', 'sections');
        }
        // associates may list specific sections as well
        if ($page == 1 && Surfer::is_associate()) {
            // load the layout to use
            $layout = Layouts::new_('yahoo', 'section');
            $layout->set_variant(20);
            // show more elements at the site map
            // query the database and layout that stuff
            if ($items = Sections::list_inactive_by_title_for_anchor(NULL, 0, 50, $layout)) {
                // we have an array to format
                if (is_array($items)) {
                    $items = Skin::build_list($items, '2-columns');
                }
                // displayed as another page section
                $text .= Skin::build_box(i18n::s('Other sections'), $items, 'header1', 'other_sections');
            }
        }
        // cache this to speed subsequent queries
        Cache::put($cache_id, $text, 'sections');
    }
    $context['text'] .= $text;
}
// the suffix hook for the site map page
if (is_callable(array('Hooks', 'include_scripts'))) {
开发者ID:rair,项目名称:yacs,代码行数:31,代码来源:index.php


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