コード例 #1
0
    <form action="edit_page.php?page=<?php 
echo urlencode($current_page["id"]);
?>
"  method="post">
      <p>Menu name:
        <input type="text" name="menu_name" value="<?php 
echo htmlentities($current_page["menu_name"]);
?>
"/>
      </p>
      <p>Position:
        <select name="position">
          <?php 
// not passing subject_id as get variable so use pages.subject_id
$page_set = find_pages($current_page["subject_id"], false);
$page_count = mysqli_num_rows($page_set);
// for counting the rows in the table
for ($count = 1; $count <= $page_count; $count++) {
    echo "<option value =\"{$count}\"";
    if ($current_page["position"] == $count) {
        echo "Selected";
    }
    echo ">{$count}</option>";
}
?>
          
        </select>
      </p>
      <p>Visible:
        <input type="radio" name="visible" value="0" <?php 
コード例 #2
0
   eval("\$title=\"{$page['Title']}\";");
   if ($tabbed) {
     echo "<div class='tab'><input type='radio' id='tab{$tab}' name='tabs' onclick='settab(this.id)'><label for='tab{$tab}'>";
     echo tab_title($title,$page['root'],isset($page['Png'])?$page['Png']:false);
     echo "</label><div class='content'>";
     $close = true;
   } else {
     if ($tab==1) echo "<div class='tab'><input type='radio' id='tab{$tab}' name='tabs'><div class='content shift'>";
     echo "<div id='title'><span class='left'>";
     echo tab_title($title,$page['root'],isset($page['Png'])?$page['Png']:false);
     echo "</span></div>";
   }
   $tab++;
 }
 if (isset($page['Type']) && $page['Type']=='menu') {
   $pgs = find_pages($page['name']);
   foreach ($pgs as $pg) {
     @eval("\$title=\"{$pg['Title']}\";");
     $link = "$path/{$pg['name']}";
     if ($icon = isset($pg['Icon'])) {
       $icon = "{$pg['root']}/images/{$pg['Icon']}";
       if (!file_exists($icon)) { $icon = "{$pg['root']}/{$pg['Icon']}"; if (!file_exists($icon)) $icon = false; }
     }
     if (!$icon) $icon = "/webGui/images/default.png";
     echo "<div class=\"Panel\"><a href=\"$link\" onclick=\"$.cookie('one','tab1',{path:'/'})\"><img class=\"PanelImg\" src=\"$icon\" title=\"$title\"><br><div class=\"PanelText\">$title</div></a></div>";
   }
 }
 $text = $page['text'];
 if (!isset($page['Markdown']) || $page['Markdown'] == 'true') {
   $text = Markdown($text);
 }
コード例 #3
0
    ?>
 <br />
    <a href ="edit_subject.php?subject=<?php 
    echo urlencode($current_subject["id"]);
    ?>
">Edit Subject </a>
    <br />
    <br />
    <br />
    <ul>
    <div style="margin-top: 2em; border-top: 1px solid #000000;"> 
    <h3>Pages In this Subject</h3>
   
  
    <?php 
    $pagesin = find_pages($current_subject["id"]);
    if (mysqli_num_rows($pagesin) == 0) {
        echo "No pages to display.";
    } else {
        while ($row = mysqli_fetch_assoc($pagesin)) {
            ?>
   <li>
      <a href="manage_content.php?page=<?php 
            echo urlencode($row["id"]);
            ?>
"> <?php 
            echo $row["menu_name"] . "<br />";
            ?>
   </li>
    <?php 
        }
コード例 #4
0
ファイル: sidebar.php プロジェクト: aabdelfa/ezzy-statistics
<?php

require_once "includes/functions.php";
//Functions files
require_once "includes/db_connection.php";
//Including the database connection file
$sp = find_page_by_id($_GET["id"]);
$pages = find_pages();
?>
      <aside class="main-sidebar">
        <!-- sidebar: style can be found in sidebar.less -->
        <section class="sidebar">
          <!-- sidebar menu: : style can be found in sidebar.less -->
          <ul class="sidebar-menu">
            <?php 
//  Navigation: left bar - Complex!
while ($subject = mysqli_fetch_assoc($pages)) {
    $output = " <li";
    // start: li
    if ($subject["id"] == $_GET["id"]) {
        $output .= " class=\"active\"";
    }
    $output .= ">";
    $output .= "<a href=\"";
    $output .= urlencode($subject["page"]);
    $output .= "?id=";
    $output .= urlencode($subject["id"]);
    $output .= "\">";
    $output .= "<i class=\"";
    $output .= $subject["icon"];
    $output .= "\"></i>";
コード例 #5
0
ファイル: new_page.php プロジェクト: VishnuArukat/phpcodepool
    <?php 
echo form_errors($errors);
?>
      <h2>Create Page</h2>

    <form action="new_page.php?subject=<?php 
echo urlencode($current_subject["id"]);
?>
" method="post">
      <p>Menu name:
        <input type="text" name="menu_name" value="" />
      </p>
      <p>Position:
        <select name="position">
          <?php 
$page_set = find_pages($current_subject["id"]);
$page_count = mysqli_num_rows($page_set);
// for counting the rows in the table
$count = $page_count + 1;
//for ($count=1; $count <=$page_count+1 ; $count++) {
echo "<option value =\"{$count}\">{$count}</option>";
// }
?>
        
        </select>
      </p>
      <p>Visible:
        <input type="radio" name="visible" value="0" /> No
        &nbsp;
        <input type="radio" name="visible" value="1" /> Yes
      </p>
コード例 #6
0
function public_navigation($subject_array, $page_array)
{
    // for public area
    // breaking the html to php
    // we can use the global in case of selected_subject_id= now subject_id and viz page_id
    $output = "<ul class =\"subjects\">";
    # for rendering the words
    $result_subject = find_subjects();
    // Use data
    // $subject & $subjects are differnt
    while ($subjects = mysqli_fetch_assoc($result_subject)) {
        # escaping the double quotes from mis understnd
        // echo "<li class =\"selected\" >"; breaking this to include if loop
        $output .= "<li";
        if ($subject_array && $subjects["id"] == $subject_array["id"]) {
            // checking the value is null and id is equal or not
            $output .= " class =\"selected\"";
            #space is needed in front
        }
        $output .= ">";
        // ?subject= is  the GET variable to use
        $output .= "<a href=\"index.php?subject=";
        $output .= urlencode($subjects["id"]);
        $output .= "\">";
        $output .= htmlentities($subjects["menu_name"]);
        $output .= "</a>";
        if ($subject_array["id"] == $subjects["id"] || $page_array["subject_id"] == $subjects["id"]) {
            $result_page = find_pages($subjects["id"]);
            $output .= "<ul class =\"pages\">";
            // Use page data
            while ($page = mysqli_fetch_assoc($result_page)) {
                $output .= "<li";
                if ($page_array && $page["id"] == $page_array["id"]) {
                    // checking the value is null and id is equal or not
                    $output .= " class =\"selected\"";
                }
                $output .= ">";
                $output .= "<a href=\"index.php?page=";
                $output .= urlencode($page["id"]);
                $output .= "\">";
                $output .= htmlentities($page["menu_name"]);
                $output .= "</a>";
                // placing the links
                $output .= "</li>";
            }
            // Release the page data
            mysqli_free_result($result_page);
            $output .= "</ul>";
        }
        $output .= "</li>";
        // end of subject li
        // closing the while loop here
    }
    // Release the subject data
    mysqli_free_result($result_subject);
    $output .= "</ul>";
    return $output;
}