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


PHP navigation函数代码示例

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


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

示例1: navigation

function navigation($path, $root_item = false, $max_depth = false, $level = 1)
{
    global $_PATH;
    $dir_items = new DirectoryIterator($path);
    $dir_exclude = ['.', '..', '.DS_Store', '404.md', 'index.md'];
    $dir_item_ext = PHP_SAPI == "cli" ? '.html' : '';
    $dir_files = [];
    $i = iterator_count($dir_items);
    foreach ($dir_items as $dir_item) {
        if (!in_array($dir_item, $dir_exclude)) {
            // iterator grows...
            $i++;
            // Create a link
            $_link = str_replace($_PATH['content'], '', $dir_item->getPathname());
            $_link = $_PATH['url'] . str_replace('.md', '', $_link);
            $_link .= $dir_item->isDir() ? '/' : $dir_item_ext;
            // Create a default title based on the filename
            $_name = substr($dir_item->getFilename(), -3) == '.md' ? str_replace('.md', '', $dir_item->getFilename()) : $dir_item->getFilename();
            $_name = ucfirst(str_replace('-', ' ', $_name));
            // Get the path
            $_path = $dir_item->getPathname();
            // get the file to extract the content
            $_file = $dir_item->isDir() ? $dir_item->getPathname() . '/index.md' : $dir_item->getPathname();
            // replace Title with metadata.title
            $_file_contents = extract_content($_file);
            $_name = !empty($_file_contents['metadata']['title']) ? $_file_contents['metadata']['title'] : $_name;
            // Get metadata order
            // TODO : Check for collisions
            $_order = isset($_file_contents['metadata']['order']) && is_numeric($_file_contents['metadata']['order']) ? $_file_contents['metadata']['order'] : $i;
            // Populate the array
            $dir_files[$_order] = ['name' => $_name, 'path' => $_path, 'file' => $_file, 'link' => $_link];
        }
    }
    // Array sort by key
    ksort($dir_files);
    // Create the HTML output
    $output_html = '<ul>';
    // Add first 'home' item
    $output_html .= $level == 1 && $root_item ? '<li><a href="' . $_PATH['url'] . '">' . $root_item . '</a></li>' : '';
    foreach ($dir_files as $dir_file) {
        $output_html .= '<li>';
        $output_html .= '<a href="' . $dir_file['link'] . '">' . $dir_file['name'] . '</a>';
        // Recursive Looping...
        if (is_dir($dir_file['path'])) {
            $level++;
            if (empty($max_depth) || $level <= $max_depth) {
                $output_html .= navigation($dir_file['path'], $max_depth, $level);
            }
            $level--;
        }
        $output_html .= '</li>';
    }
    $output_html .= '</ul>';
    // Return the created HTML
    return $output_html;
}
开发者ID:alterebro,项目名称:mosquito,代码行数:56,代码来源:mosquito-extras.php

示例2: navigation

    ?>
		<tr class="row0">
			<td colspan="6" align="center">No Items</td>
		</tr>
	<?php 
}
?>
			</table>
			
			<input type="hidden" name="task" value="" />
		</form>

		<div style="height: 30px; clear:both;"></div>
<?php 
$url = "current-commissions.php?items=" . ITEMS_PER_PAGE;
navigation($accounts_num, $start, count($accounts), $url, ITEMS_PER_PAGE);
?>
<script type="text/javascript">
function setAction()
{
	var suser = $("#search_user").val();
	var link = 'current-commissions.php';
	link += suser? "?su="+suser :"";
	document.location.href = link;
}
$(document).ready(function(){
	jQuery.fn.enterEscape = function()
	{
		this.keypress(
		function(e)
		{
开发者ID:AdoSalkic,项目名称:personal,代码行数:31,代码来源:current-commissions.php

示例3: user_age

                            $tpl->set('{age}', user_age($user_birthday[0], $user_birthday[1], $user_birthday[2]));
                            if ($get_user_id == $user_info['user_id']) {
                                $tpl->set('[owner]', '');
                                $tpl->set('[/owner]', '');
                            } else {
                                $tpl->set_block("'\\[owner\\](.*?)\\[/owner\\]'si", "");
                            }
                            if ($row['friend_id'] == $user_info['user_id']) {
                                $tpl->set_block("'\\[viewer\\](.*?)\\[/viewer\\]'si", "");
                            } else {
                                $tpl->set('[viewer]', '');
                                $tpl->set('[/viewer]', '');
                            }
                            $tpl->compile('content');
                        }
                        navigation($gcount, $friends_sql['user_friends_num'], $config['home_url'] . 'friends/' . $get_user_id . '/page/');
                    } else {
                        msgbox('', $lang['no_requests'], 'info_2');
                    }
                } else {
                    msgbox('', $lang['no_requests'], 'info_2');
                }
            } else {
                $user_speedbar = $lang['error'];
                msgbox('', $lang['no_notes'], 'info');
            }
    }
    $db->free();
    $tpl->clear();
} else {
    $user_speedbar = 'Информация';
开发者ID:BGCX067,项目名称:facestor-svn-to-git,代码行数:31,代码来源:friends.php

示例4: count

        if (count($errors) == 1) {
            $message = "There was 1 error in the form.";
        } else {
            $message = "There were " . count($errors) . " errors in the form.";
        }
    }
    // END FORM PROCESSING
}
find_selected_page();
include "includes/header.php";
?>
<table id="structure">
	<tr>
		<td id="navigation">
			<?php 
echo navigation($sel_subject, $sel_page, $public = false);
?>
			<br />
			<a href="new_subject.php">+ Add a new subject</a>
		</td>
		<td id="page">
			<h2>Adding New Page</h2>
			<?php 
if (!empty($message)) {
    echo "<p class=\"message\">" . $message . "</p>";
}
?>
			<?php 
if (!empty($errors)) {
    display_errors($errors);
}
开发者ID:navneet1v,项目名称:WidgetCorp,代码行数:31,代码来源:new_page.php

示例5: LibReferencePage

 function LibReferencePage(&$ref, $lib, $translation, $lang = 'en')
 {
     global $LANGUAGES;
     $this->langdir = 'reference/' . ($lang == 'en' ? '' : "{$lang}");
     $this->libsdir = $this->langdir . '/libraries';
     $this->libdir = $this->libsdir . "/{$lib}";
     $this->filepath = $this->libdir . '/' . $ref->name();
     $title = $ref->title() . ($lang == 'en' ? '' : " \\ {$LANGUAGES[$lang][0]}") . ' \\ Language (API) \\ Processing 2+';
     $xhtml = new xhtml_page(TEMPLATEDIR . 'foundation-template.translation.html');
     $xhtml->set('header', HEADER_LINK);
     $xhtml->set('title', $title);
     $xhtml->set('bodyid', 'Library-ref');
     if ($lang == 'en') {
         $xhtml->set('navigation', navigation('Libraries'));
     } else {
         $xhtml->set('navigation', navigation_tr('Libraries'));
     }
     $piece = new xhtml_piece(TEMPLATEDIR . 'foundation-template.reference.item.html');
     $xhtml->set('content_for_layout', $piece->out());
     $xhtml->set('reference_nav', library_nav($lib));
     $xhtml->set('language_nav', language_nav($lang));
     $xhtml->set('content', $ref->display());
     foreach ($translation->attributes as $key => $value) {
         $xhtml->set($key, $value);
     }
     foreach ($translation->meta as $key => $value) {
         $xhtml->set($key, $value);
     }
     //$xhtml->set('updated', date('F d, Y h:i:sa T', filemtime(CONTENTDIR.'/'.$ref->filepath)));
     $this->xhtml = $xhtml;
     $this->language($lang);
 }
开发者ID:ilaro-org,项目名称:processing-docs,代码行数:32,代码来源:foundation-template.php

示例6: preg_replace

</script>
<form action="?mod=massaction&act=groups" method="post" name="edit">

<div style="background:#f0f0f0;float:left;padding:5px;width:100px;text-align:center;font-weight:bold;margin-top:-5px">Создатель</div>
<div style="background:#f0f0f0;float:left;padding:5px;width:243px;text-align:center;font-weight:bold;margin-top:-5px;margin-left:1px">Сообщество</div>
<div style="background:#f0f0f0;float:left;padding:5px;width:75px;text-align:center;font-weight:bold;margin-top:-5px;margin-left:1px">Участников</div>
<div style="background:#f0f0f0;float:left;padding:5px;width:110px;text-align:center;font-weight:bold;margin-top:-5px;margin-left:1px">Дата создания</div>
<div style="background:#f0f0f0;float:left;padding:4px;width:20px;text-align:center;font-weight:bold;margin-top:-5px;margin-left:1px"><input type="checkbox" name="master_box" title="Выбрать все" onclick="javascript:ckeck_uncheck_all()" style="float:right;"></div>
<div class="clr"></div>
{$users}
<div style="float:left;font-size:10px">
<font color="red">Удаленные сообщества помечены красным цветом</font><br />
<font color="blue">Забаненые сообщества помечены синим цветом</font>
</div>
<div style="float:right">
<select name="mass_type" class="inpu" style="width:260px">
 <option value="0">- Действие -</option>
 <option value="1">Удалить сообщества</option>
 <option value="2">Заблокировать сообщества</option>
 <option value="3">Воостановить сообщества</option>
 <option value="4">Разблокировать сообщества</option>
</select>
<input type="submit" value="Выолнить" class="inp" />
</div>
</form>
<div class="clr"></div>
HTML;
$query_string = preg_replace("/&page=[0-9]+/i", '', $_SERVER['QUERY_STRING']);
echo navigation($gcount, $numRows['cnt'], '?' . $query_string . '&page=');
htmlclear();
echohtmlend();
开发者ID:BGCX067,项目名称:facestor-svn-to-git,代码行数:31,代码来源:groups.php

示例7: selected_page

require_once "../../includes/initialize.php";
selected_page();
?>


<?php 
include_layout_template('admin_header');
?>

	<nav>
		<br>
			<a href="admin.php">&laquo; Main Menu</a>
		<br>
		<?php 
echo navigation($current_subject, $current_page);
?>
	</nav> <!-- end nav -->
		
	<div class = "page">

		<?php 
if (!empty($message)) {
    echo "<div class = \"message\">{$message}</div>";
}
?>

		<?php 
if ($current_subject) {
    ?>
		<h2>Manage Subjects <?php 
开发者ID:Radomeer,项目名称:kec_cms,代码行数:30,代码来源:manage_content.php

示例8: elseif

<?php 
if (isset($_GET["subject"])) {
    $selected_subject_id = $_GET["subject"];
    $selected_page_id = null;
} elseif (isset($_GET["page"])) {
    $selected_subject_id = null;
    $selected_page_id = $_GET["page"];
} else {
    $selected_subject_id = null;
    $selected_page_id = null;
}
?>
<div id="main">
  <div id="navigation">
		<?php 
echo navigation($selected_subject_id, $selected_page_id);
?>
  </div>
  <div id="page">
    <h2>Manage Content</h2>
		<?php 
echo $selected_subject_id;
?>
<br />
		<?php 
echo $selected_page_id;
?>
  </div>
</div>

<?php 
开发者ID:selossej,项目名称:PHP,代码行数:31,代码来源:manage_content.php

示例9: redirect_authed

<?php

require __DIR__ . '/../../../init.php';
redirect_authed($user);
$error = array();
if (isset($_POST['email'])) {
    $email = $_POST['email'];
    $email_err = validate_email($email);
    if (strlen($email_err) > 0) {
        $error['email'] = $email_err;
    }
    if (count($error) == 0) {
        $uuid = $user->set_token(gen_uuid(), $email);
        if (!is_production()) {
            die("<a href='http://localhost:8080/auth/confirm.php?token={$uuid}'>login</a>");
        }
        send_login_mail($email, $uuid);
        redirect('/auth/confirm.php');
    }
}
echo html(title('Homespot - Sign In/Up'), navigation($user->is_authed()) . content(h1("Sign In/Up") . p('This website uses cookies to check if you are authenticated or not.') . p('By signing in or up you permit us to do so.') . form('post', input_err($error, 'email') . input('email') . submit())));
开发者ID:doodzik,项目名称:homespot_legacy,代码行数:21,代码来源:index.php

示例10: del_confirm

		<input type="submit" name="deletephrases" value=" <?php 
    echo $gXpLang['delete'];
    ?>
 " onclick="return del_confirm('selected phrases?') " />
	</div>
	<br />
	</form>
	<div style="height: 5px;"></div>
	<?php 
    $url = "manage-language.php?view=" . $_GET['view'];
    $url .= $_GET['search'] ? "&search=" . $_GET['search'] : "";
    $url .= $_GET['lang'] ? "&lang=" . $_GET['lang'] : "";
    $url .= $_GET['search_type'] ? "&search_type=" . $_GET['search_type'] : "";
    $url .= $_GET['phrase_group'] ? "&phrase_group=" . $_GET['phrase_group'] : "";
    $url .= "&items=" . ITEMS_PER_PAGE;
    navigation($phrase_num, $start, count($lang_strings), $url, ITEMS_PER_PAGE);
} elseif ('download' == $_GET['view']) {
    /** language file import actions **/
    echo "<form action=\"manage-language.php?view=download\" method=\"post\" enctype=\"multipart/form-data\">";
    echo '<table cellspacing="0" cellpadding="0" width="100%" class="adminlist">';
    echo '<tr>';
    echo "<th colspan=\"2\" class=\"last\">{$gXpLang['import']}</th>";
    echo '</tr>';
    echo '<tr>';
    echo "<td width=\"200\">{$gXpLang['import_from_pc']}</td>";
    echo "<td><input type=\"file\" name=\"language_file\" size=\"40\" /></td>";
    echo '</tr>';
    echo '<tr>';
    echo "<td>{$gXpLang['import_from_server']}</td>";
    echo "<td><input type=\"text\" size=\"40\" name=\"language_file2\" value=\"../backup/\" /></td>";
    echo '</tr>';
开发者ID:wesley1001,项目名称:elitius,代码行数:31,代码来源:manage-language.php

示例11: scandir

$dir = "gallery";
$files = scandir($dir);
$pages = 0;
$j = 0;
$items[0];
while ($i < count($files)) {
    if ($j == 8) {
        $j = 0;
        $pages = $pages + 1;
    }
    $files[$i] = "gallery/" . $files[$i];
    $items[$pages] = $items[$pages] . "<div><a href=" . $files[$i] . " rel='lightgallery[flowers]'><img src='" . $files[$i] . "'/></a></div>";
    $i++;
    $j++;
}
navigation($form_action, $items, $pages);
?>
		</div>
	</div>
</div>

<div class="footer site">
	<?php 
include "parts/footer.html";
?>
</div>

<div class="top">vverh</div>
<div class="bottom">vniz</div>

<script type="text/javascript">
开发者ID:ArvenAnna,项目名称:MyProgs,代码行数:31,代码来源:gallery.php

示例12: anchor

			<ul class="tabs">
				<li><?php 
echo anchor($this->uri->segment(1) . '/' . $this->uri->segment(2) . '/' . $this->uri->segment(3) . '/', 'Perfil', navigation($this->uri->segment(4), FALSE));
?>
</li>
				<li><?php 
echo anchor($this->uri->segment(1) . '/' . $this->uri->segment(2) . '/' . $this->uri->segment(3) . '/descripcion', 'Descripción', navigation($this->uri->segment(4), 'descripcion'));
?>
</li>
				<li><?php 
echo anchor($this->uri->segment(1) . '/' . $this->uri->segment(2) . '/' . $this->uri->segment(3) . '/sexualidad', 'Sexualidad', navigation($this->uri->segment(4), 'sexualidad'));
?>
</li>
        <li><?php 
echo anchor($this->uri->segment(1) . '/' . $this->uri->segment(2) . '/' . $this->uri->segment(3) . '/galeria', 'Galeria', navigation($this->uri->segment(4), 'galeria'));
?>
</li>
			</ul>

			<div class="box-wrapper">
        <? if( ! $this->uri->segment(4)): ?>
				<div id="one" class="content-box current">
					<div class="col-one col">
            <?
                if($fotoperfil)
                {
                   echo '<img src="'.base_url().'upload/'.img_perfil($fotoperfil).'" alt="" width="200"/>';                                               
                 }else
                 {
                    echo '<img src="http://gayria.com/imagenodisp.jpg" alt="" width="200"/>';
开发者ID:rubenbonache,项目名称:Gayria.com,代码行数:30,代码来源:perfil.php

示例13: find_selected_page

<?php 
include "includes/connection.php";
include "includes/functions.php";
include "includes/headers.php";
find_selected_page();
?>
<table id="structure">
<tr>
	<td id="navigation">
		<?php 
echo navigation($select_sub, $select_page, false);
?>
	</td>
	<td id="page">
		<?php 
if (!is_null($select_sub)) {
    ?>
		<h2><?php 
    echo $select_sub["menu_name"];
    ?>
</h2>
			<?php 
    echo "<p>Welcome to {$select_sub[menu_name]} page.</p>";
    ?>
		<?php 
} elseif (!is_null($select_page["menu_name"])) {
    ?>
		<h2><?php 
    echo $select_page["menu_name"];
    ?>
开发者ID:hidajet,项目名称:cms,代码行数:30,代码来源:content.php

示例14: if

<div id="mainMenu">
	  <div class="float-right" style="padding:0.5em;text-align:right">
		<?php if($this->user_lib->logged_in()): ?>
			<?php echo sprintf(lang('logged_in_welcome'), $user->first_name.' '.$user->last_name );?> <a href="<?php echo site_url('users/logout');?>"><?php echo lang('logout_label');?></a>
		
			<?php if($this->settings->item('enable_profiles')): ?>
				| <?php echo anchor('edit-profile', lang('edit_profile_label')); ?>
			<?php endif; ?>
			
			| <?php echo anchor('edit-settings', lang('settings_label')); ?>
			
			<?php if( $this->user_lib->check_role('admin') ): ?>
				 | <?php echo anchor('admin', lang('cp_title'), 'target="_blank"'); ?>
			<?php endif; ?>
			
		<?php else: ?>
			<?php echo anchor('users/login', lang('user_login_btn')); ?> | <?php echo anchor('register', lang('user_register_btn')); ?>
		<?endif; ?>
	</div>

	  <ul class="float-left">
		<?php foreach(navigation('header') as $nav_link): ?>
		<li><?php echo anchor($nav_link->url, $nav_link->title, $nav_link->current_link ? 'class="here"' : ''); ?></li>
		<?php endforeach; ?>
	  </ul>

  </div>
开发者ID:netfreak,项目名称:pyrocms,代码行数:27,代码来源:topnav.php

示例15: navigation

/**
 * string navigation(array $links)
 *
 * @param array $links
 *  array(
 *    string,
 *    array(
 *      string,
 *      string,
 *    ),
 *    string
 *  )
 * @return string list of links
 * @access public
 */
function navigation($links)
{
    $_html = HTML::start('ul');
    foreach ($links as $value) {
        if (is_array($value)) {
            $_html .= navigation($value);
        } else {
            $_html .= HTML::start('li') . $value;
        }
        if (!is_array(next($links))) {
            $_html .= HTML::end('li');
        }
    }
    $_html .= HTML::end('ul');
    return $_html;
}
开发者ID:edubort,项目名称:openclinic,代码行数:31,代码来源:component.php


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