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


PHP BreadCrumb类代码示例

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


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

示例1: test_clean

 function test_clean()
 {
     $bread_crumb = new BreadCrumb();
     $ret = $bread_crumb->clean();
     $tmp = $bread_crumb->get_links();
     self::assertEquals(count($tmp), 0);
 }
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:7,代码来源:BreadCrumbTest.php

示例2: transform

 public function transform(BreadCrumb $breadCrumb)
 {
     $result = $breadCrumb->getRoot();
     $isFirst = true;
     foreach ($breadCrumb->getNodes() as $node) {
         if ($isFirst) {
             $isFirst = false;
             if ($breadCrumb->getDepth() > 1) {
                 $result .= "/" . $node->getPropertyName();
             }
             continue;
         }
         $result .= "/" . $node->getTemplateName();
         if ($node->getTemplateIndex() != 0) {
             $result .= "/" . $node->getTemplateIndex();
         }
     }
     return $result;
 }
开发者ID:ljarray,项目名称:dbpedia,代码行数:19,代码来源:DefaultBreadCrumbTransformer.php

示例3: CompanyListFactory

     }
     if ($cf->isValid()) {
         $cf->Save();
         //$cf->FailTransaction();
         $cf->CommitTransaction();
         if ($permission->Check('company', 'edit')) {
             Redirect::Page(URLBuilder::getURL(NULL, 'CompanyList.php'));
         } else {
             Redirect::Page(URLBuilder::getURL(NULL, '../index.php'));
         }
         break;
     }
     $cf->FailTransaction();
 default:
     if (isset($id)) {
         BreadCrumb::setCrumb($title);
         $clf = new CompanyListFactory();
         if ($permission->Check('company', 'edit')) {
             $clf->GetByID($id);
         } else {
             $id = $current_company->getId();
             $clf->GetByID($id);
         }
         foreach ($clf as $company) {
             //Debug::Arr($company,'Company', __FILE__, __LINE__, __METHOD__,10);
             $company_data = array('id' => $company->getId(), 'parent' => $company->getParent(), 'status' => $company->getStatus(), 'product_edition' => $company->getProductEdition(), 'name' => $company->getName(), 'short_name' => $company->getShortName(), 'business_number' => $company->getBusinessNumber(), 'originator_id' => $company->getOriginatorID(), 'data_center_id' => $company->getDataCenterID(), 'address1' => $company->getAddress1(), 'address2' => $company->getAddress2(), 'city' => $company->getCity(), 'province' => $company->getProvince(), 'country' => $company->getCountry(), 'postal_code' => $company->getPostalCode(), 'work_phone' => $company->getWorkPhone(), 'fax_phone' => $company->getFaxPhone(), 'admin_contact' => $company->getAdminContact(), 'billing_contact' => $company->getBillingContact(), 'support_contact' => $company->getSupportContact(), 'logo_file_name' => $company->getLogoFileName(NULL, FALSE), 'enable_second_last_name' => $company->getEnableSecondLastName(), 'created_date' => $company->getCreatedDate(), 'created_by' => $company->getCreatedBy(), 'updated_date' => $company->getUpdatedDate(), 'updated_by' => $company->getUpdatedBy(), 'deleted_date' => $company->getDeletedDate(), 'deleted_by' => $company->getDeletedBy());
         }
     }
     //Select box options;
     $company_data['status_options'] = $cf->getOptions('status');
     $company_data['country_options'] = $cf->getOptions('country');
开发者ID:J-P-Hanafin,项目名称:TimeTrex-1,代码行数:31,代码来源:EditCompany.php

示例4: str_replace

 * $Revision: 7487 $
 * $Id: ViewScheduleWeek.php 7487 2012-08-15 22:35:09Z ipso $
 * $Date: 2012-08-15 15:35:09 -0700 (Wed, 15 Aug 2012) $
 */
require_once '../../includes/global.inc.php';
require_once Environment::getBasePath() . 'includes/Interface.inc.php';
require_once Environment::getBasePath() . 'classes/misc/arr_multisort.class.php';
//Debug::setVerbosity(11);
if (!$permission->Check('schedule', 'enabled') or !($permission->Check('schedule', 'view') or $permission->Check('schedule', 'view_own') or $permission->Check('schedule', 'view_child'))) {
    $permission->Redirect(FALSE);
    //Redirect
}
$smarty->assign('title', TTi18n::gettext($title = 'My Schedule'));
// See index.php
//BreadCrumb::setCrumb($title);
BreadCrumb::setCrumb($title, str_replace('ViewScheduleWeek.php', 'ViewSchedule.php', $_SERVER['REQUEST_URI']));
/*
 * Get FORM variables
 */
extract(FormVariables::GetVariables(array('do', 'page', 'sort_column', 'sort_order', 'filter_data')));
URLBuilder::setURL($_SERVER['SCRIPT_NAME'], array('sort_column' => $sort_column, 'sort_order' => $sort_order, 'page' => $page));
if (isset($filter_data['start_date']) and $filter_data['start_date'] != '') {
    $filter_data['start_date'] = TTDate::parseDateTime($filter_data['start_date']);
} else {
    $filter_data['start_date'] = time();
}
if (!isset($filter_data['show_days']) or isset($filter_data['show_days']) and $filter_data['show_days'] == '') {
    $filter_data['show_days'] = 1;
}
$filter_data['show_days'] = $filter_data['show_days'] * 7;
//Get Permission Hierarchy Children first, as this can be used for viewing, or editing.
开发者ID:alachaum,项目名称:timetrex,代码行数:31,代码来源:ViewScheduleWeek.php

示例5: smarty_function_DisplayBreadCrumbs

/**
 * Smarty plugin
 * @package Smarty
 * @subpackage plugins
 */
function smarty_function_DisplayBreadCrumbs($params, &$smarty)
{
    return BreadCrumb::Display();
}
开发者ID:J-P-Hanafin,项目名称:TimeTrex-1,代码行数:9,代码来源:function.displaybreadcrumbs.php

示例6: myGenerate

 /**
  * This function returns two results:
  * [triples: the generated triples, metaTriples: meta triples 2: the used templates]
  *
  * Unfortunately I haven't renamed the variables yet - result
  * is the array containing the result TRIPLES!! - its not this
  * 2 element.
  *
  */
 private function myGenerate(BreadCrumb $breadCrumb, $value)
 {
     // result is the array containing: triples, meta triples, used templates
     $result = array(array(), array(), array());
     $rootSubjectUri = RDFTriple::page($breadCrumb->getRoot());
     // this array is only relevant on depth 0
     $relatedClasses = array();
     //$metaTriples = array();
     //$usedTemplateNames = array();
     // 'parent' means the parent of the value - thus subject and predicate
     $parentName = $this->breadCrumbTransformer->transform($breadCrumb);
     $parentResource = RDFTriple::page($parentName);
     $parentPropertyName = null;
     $tmp = $breadCrumb->peekTop(0);
     if (isset($tmp)) {
         $parentPropertyName = $tmp->getPropertyName();
     }
     // Get all templates on this site, indexed by name
     // (there may be multiple templates with the same name)
     $nameToTemplates = SimpleWikiTemplateMatcher::match($value);
     //print_r($value);
     //print_r($nameToTemplates);
     //echo "NOW COMES THE STORM\n";
     foreach ($nameToTemplates as $templateName => $templates) {
         if (strlen($templateName) < 1) {
             continue;
         }
         //echo "GOT TEMPLATE NAME $templateName\n";
         $templateName = $this->mediaWikiUtil->toCanonicalWikiCase($templateName);
         if (!$this->templateNameFilter->doesAccept($templateName)) {
             continue;
         }
         $templateUri = RDFTriple::URI(DB_TEMPLATE_NS . $templateName, false);
         $result[2][$templateName] = 1;
         // Get annotations for the template - if there are any
         $lookupName = "Template:{$templateName}/doc";
         if ($breadCrumb->getDepth() == 0) {
             $ta = $this->templateDb->getTemplateAnnotation($lookupName);
             // Create the triples for "relatesToClass"
             // But only for the page itself (not for sub templates)
             // if no related class exists, default to rdf:type owl:Thing
             if (isset($ta)) {
                 foreach ($ta->getRelatedClasses() as $item) {
                     $relatedClasses[$item] = 1;
                 }
             }
         }
         foreach ($templates as $templateIndex => $template) {
             //echo "GOT TEMPLATE INDEX $templateIndex\n";
             // Iterate over all arguments
             $arguments = $template->getArguments();
             foreach ($arguments as $argumentName => $values) {
                 //echo "GOT ARGUMENT NAME $argumentName\n";
                 // propertyNs defaults to DB_PROPERTY_NS unless there
                 // exists a mapping in the templatedb. In that case it will
                 // be set to DB_ONTOLOGY_NS
                 $propertyNs = DB_PROPERTY_NS;
                 $pa = null;
                 if (isset($ta)) {
                     $pas = $ta->getPropertyAnnotations();
                     if (array_key_exists($argumentName, $pas)) {
                         $pa = $pas[$argumentName];
                         $propertyNs = DB_ONTOLOGY_NS;
                     }
                 }
                 //print_r($ta);
                 //echo "PROPERTY NS : $lookupName - $argumentName = $propertyNs\n";
                 // Fake a property mapping if there was none in the db
                 // This maps argumentName back to iteself
                 if (!isset($pa)) {
                     // If there was no mapping we might ignore it
                     // depending on an option (We can prevent this extractor
                     // to generate triples with properties in the
                     // dbp:property namespace
                     // We allow such triples on subResources though.
                     if ($this->allowUnmappedProperties != true && $breadCrumb->getDepth() == 0) {
                         continue;
                     }
                     // If there was no mapping, also rename numeric
                     // argument names (e.g. 1 becomes property1)
                     // this is just cosmetic for the result
                     if (is_numeric($argumentName)) {
                         $argumentName = "property{$argumentName}";
                     }
                     $pa = new PropertyAnnotation($argumentName);
                     $pa->addMapping(new PropertyMapping($argumentName));
                 }
                 foreach ($pa->getMappings() as $pm) {
                     $parseHint = $pm->getParseHint();
                     //echo "Mapping $argumentName : {$pm->getRenamedValue()}\n\n";
                     // if the renamed value is not set, use the original
//.........这里部分代码省略.........
开发者ID:ljarray,项目名称:dbpedia,代码行数:101,代码来源:RootTripleGenerator.php

示例7: Logout

 function Logout($session_id = NULL)
 {
     $this->destroyCookie();
     $this->Delete();
     TTLog::addEntry($this->getObject()->getID(), 'Logout', TTi18n::getText('SourceIP') . ': ' . $this->getIPAddress() . ' ' . TTi18n::getText('SessionID') . ': ' . $this->getSessionID() . ' ' . TTi18n::getText('UserID') . ': ' . $this->getObject()->getId(), $this->getObject()->getID(), 'authentication');
     BreadCrumb::Delete();
     return TRUE;
 }
开发者ID:J-P-Hanafin,项目名称:TimeTrex-1,代码行数:8,代码来源:Authentication.class.php

示例8: define

<?php

define('ROOT_PATH', dirname(__DIR__));
require ROOT_PATH . '/vendor/autoload.php';
require ROOT_PATH . '/test/application.php';
$bc = new BreadCrumb('Application', 'edit', array('controller_postfix' => 'Controller', 'action_postfix' => 'Action'));
$tpl = $bc->render();
echo $tpl . PHP_EOL;
开发者ID:wenzhao823,项目名称:breadcrumb,代码行数:8,代码来源:test.php


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