/**
  * Creates the help pages and help submenu pages.
  * Returns post id of the newly created parent help page, 0 on failure.
  */
 function createHelpPages()
 {
     // don't do anything if it already exists
     $help_page = get_page_by_path('help');
     if ($help_page != null) {
         return $help_page->ID;
     }
     $hp = new HelpPage();
     $help_id = $this->createReadOnlyPage('help', 'Help', $hp->toHtml('help'), 0, 100);
     // on previous success, create help sub-pages
     if ($help_id > 0) {
         $pages_id = $this->createReadOnlyPage('pages', 'Pages', $hp->toHtml('pages'), $help_id, 10);
         // create individual help pages
         if ($pages_id > 0) {
             $post_id = $this->createReadOnlyPage('add-edit-booking', 'Add/Edit Booking', $hp->toHtml('add-edit-booking'), $pages_id, 10);
             $post_id = $this->createReadOnlyPage('allocations', 'Allocations', $hp->toHtml('allocations'), $pages_id, 20);
             $post_id = $this->createReadOnlyPage('bookings', 'Bookings', $hp->toHtml('bookings'), $pages_id, 30);
             $post_id = $this->createReadOnlyPage('daily-summary', 'Daily Summary', $hp->toHtml('daily-summary'), $pages_id, 40);
             $post_id = $this->createReadOnlyPage('resources', 'Resources', $hp->toHtml('resources'), $pages_id, 50);
         }
         $faq_id = $this->createReadOnlyPage('faq', 'FAQ', $hp->toHtml('faq'), $help_id, 20);
         // create individual FAQ pages
         if ($faq_id > 0) {
             $post_id = $this->createReadOnlyPage('how-do-i-add-a-new-booking', 'How do I add a new booking?', $hp->toHtml('how-do-i-add-a-new-booking'), $faq_id, 10);
             $post_id = $this->createReadOnlyPage('how-do-i-check-in-a-guest', 'How do I check-in a guest?', $hp->toHtml('how-do-i-check-in-a-guest'), $faq_id, 20);
             $post_id = $this->createReadOnlyPage('how-do-i-checkout-a-single-guest', 'How do I checkout a single guest?', $hp->toHtml('how-do-i-checkout-a-single-guest'), $faq_id, 30);
             $post_id = $this->createReadOnlyPage('how-do-i-checkout-all-guests-for-a-booking', 'How do I checkout all guests for a booking?', $hp->toHtml('how-do-i-checkout-all-guests-for-a-booking'), $faq_id, 40);
             $post_id = $this->createReadOnlyPage('how-do-i-add-additional-nights-to-an-existing-booking', 'How do I add additional nights to an existing booking?', $hp->toHtml('how-do-i-add-additional-nights-to-an-existing-booking'), $faq_id, 50);
             $post_id = $this->createReadOnlyPage('how-do-i-cancel-nights-from-an-existing-booking', 'How do I cancel nights from an existing booking?', $hp->toHtml('how-do-i-cancel-nights-from-an-existing-booking'), $faq_id, 60);
             $post_id = $this->createReadOnlyPage('how-do-i-change-the-room-allocation-for-a-booking', 'How do I change the room allocation for a booking?', $hp->toHtml('how-do-i-change-the-room-allocation-for-a-booking'), $faq_id, 70);
             $post_id = $this->createReadOnlyPage('how-do-i-deactivate-a-room-for-a-particular-set-of-dates', 'How do I deactivate a room for a particular set of dates?', $hp->toHtml('how-do-i-deactivate-a-room-for-a-particular-set-of-dates'), $faq_id, 80);
         }
     }
     return $help_id;
 }
示例#2
0
文件: help.php 项目: Trideon/gigolo
<?php

/**
Copyright 2011-2015 Nick Korbel

This file is part of Booked Scheduler.

Booked Scheduler is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

Booked Scheduler is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with Booked Scheduler.  If not, see <http://www.gnu.org/licenses/>.
*/
define('ROOT_DIR', '../');
require_once ROOT_DIR . 'Pages/HelpPage.php';
$page = new HelpPage();
$page->PageLoad();
示例#3
0
<?php

require "md5base.php";
require "head.php";
$page = new HelpPage();
?>
	<div id="contentdiv">
		<div id="help-index">
			<h1>Help</h1>
			<ul>
			<?php 
$cats = $page->getHelpCategories();
for ($i = 0; $i < count($cats); $i++) {
    if ($_GET['id'] == $cats[$i]['id']) {
        echo '<li class="selected"><a href="help.php?id=' . $cats[$i]['id'] . '">' . $cats[$i]['name'] . '</a></li>' . "\n";
    } else {
        echo '<li><a href="help.php?id=' . $cats[$i]['id'] . '">' . $cats[$i]['name'] . '</a></li>' . "\n";
    }
}
?>
			</ul>
		</div>
		<div id="help-content">
			<?php 
$conts = $page->getHelpContents();
echo '<h1>' . $conts[0]['name'] . '</h1>' . "\n";
for ($i = 0; $i < count($conts); $i++) {
    echo '<h2>' . $conts[$i]['topic'] . '</h2>' . "\n";
    echo '<p>' . $conts[$i]['content'] . '</p>' . "\n";
}
?>