示例#1
0
function invoice_body()
{
    global $invoice, $pdf;
    if (isset($invoice['invoice'])) {
        $template = ConfigHelper::getConfig('invoices.cnote_template_file');
    } else {
        $template = ConfigHelper::getConfig('invoices.template_file');
    }
    switch ($template) {
        case "standard":
            invoice_body_standard();
            break;
        case "FT-0100":
            invoice_body_ft0100();
            break;
        default:
            if (file_exists($template)) {
                require $template;
            } else {
                //go to LMS modules directory
                require MODULES_DIR . '/' . $template;
            }
    }
    if (!isset($invoice['last'])) {
        new_page();
    }
}
示例#2
0
function invoice_body()
{
    global $invoice, $pdf;
    if (isset($invoice['invoice'])) {
        $template = ConfigHelper::getConfig('invoices.cnote_template_file');
    } else {
        $template = ConfigHelper::getConfig('invoices.template_file');
    }
    switch ($template) {
        case "standard":
            invoice_body_standard();
            break;
        case "FT-0100":
            invoice_body_ft0100();
            break;
        default:
            require $template;
    }
    if (!isset($invoice['last'])) {
        new_page();
    }
}
示例#3
0
miniwiki_boot(true);
$old_main_page = new_page("MainPage", MW_REVISION_HEAD);
if ($old_main_page->exists()) {
    $main_page = new_page(MW_PAGE_NAME_MAIN, MW_REVISION_HEAD);
    if (!$main_page->exists()) {
        show_install_message('Renaming old main page ' . $old_main_page->name . ' to ' . $main_page->name);
        $old_main_page->rename($main_page->name);
    }
}
$storage =& get_storage();
$old_user_pages = $storage->get_resource_names(MW_DS_PAGES);
foreach ($old_user_pages as $name) {
    if (strpos($name, 'User:'******'Renaming user page ' . $old_page->name . ' to ' . $new_name);
            $old_page->rename($new_name);
        }
    }
}
$import_with_errors = false;
function import_with_check($file, $ds_name = null, $res_name = null)
{
    if ($ds_name !== null) {
        $storage =& get_storage();
        if ($storage->exists($ds_name, $res_name)) {
            show_install_message('NOT importing data from ' . $file . ', because ' . $res_name . ' exists');
            return;
        }
示例#4
0
<?php

/**
 * Created by  : PhpStorm.
 * User        : sam
 * Company     : Jeeble
 * Date        : 7/21/15
 * Time        : 10:38 AM
 */
require_once "assets/includes/includes.php";
confirm_pirate_auth_login();
if (!can_current_user("create")) {
    redirect_to('index.php');
}
if (isset($_POST['newpage'])) {
    if (new_page(pirate_auth_current_user('id'), $_POST['title'], $_POST['content'], $_POST['reqconf'], $_POST['state'], $_POST['visibility'], $_POST['original_id'])) {
        redirect_to('index.php');
    }
}
$page = [];
if (isset($_GET['original_id'])) {
    $page = get_page($_GET['original_id']);
}
get_partial('header');
?>

<div class="container">
    <form action="newpage.php" method="post">
        <div class="col-sm-6 col-sm-offset-3">
            <h1 class="page-header">New Page</h1>
            <div class="form-group">
            $txt = '- ' . $current_attribute['option'] . COLON_BLANK . $current_attribute['value'];
            $txt = fit_string($txt, $w);
            $pdf->Text($x, $y, $txt);
            $y += $pdf->lines_height;
        }
        $pdf->SetFont($pdf->font, NORMAL, $pdf->invoice_font_size);
        //$pdf->SetY($Y_Table_Position+$attributes*$pdf->lines_height);
        $Y_Table_Position += $pdf->lines_height * $attributes;
    }
    $item_count++;
    //Check for products overflow (i.e.: more then one page required
    $break_page = $item_count % $invoice_items_per_page == 0;
    if ($break_page) {
        if ($i != $n) {
            //Overflow if more products to come!
            new_page();
        }
    }
}
if ($not_print_packing_slip) {
    $total_items = sizeof($total_price);
    $total_price_classes = array_keys($total_price);
    $add_tax_id = $total_items > 1;
    if ($add_tax_id) {
        asort($total_price);
    }
    if ($add_tax_id) {
        asort($total_tax[$i]);
        $max_tax_id_len = 0;
        for ($i = 0; $i < $total_items; $i++) {
            $tax = olc_precision($total_price_classes[$i], $tax_decimal_places);
示例#6
0
 function MW_PageRequest($http_request)
 {
     $path_info = $http_request->get_path_info();
     $page_name = MW_DEFAULT_PAGE_NAME;
     if ($path_info !== null) {
         $page_name = $path_info;
     } elseif ($http_request->has_param(MW_REQVAR_PAGE_NAME)) {
         $page_name = $http_request->get_param(MW_REQVAR_PAGE_NAME);
     }
     $page_name = filter_page_name(decode_page_name($page_name));
     $revision = $http_request->get_param(MW_REQVAR_REVISION, MW_REVISION_HEAD);
     $this->page = new_page($page_name, $revision);
 }
示例#7
0
        } else {
            $descartados->question[$i] = $original->question[$key];
            $i++;
            unset($original->question[$key]);
            $control = 1;
        }
    }
    if ($control == 0) {
        illustrate_layout($pdf1, $dimsn[$page], $page, $uniqueid);
        break;
    }
    unset($original);
    $original = $descartados;
    unset($descartados);
    $i = 0;
    if (count($original) == 0 && count($descartados) == 0) {
        illustrate_layout($pdf1, $dimsn[$page], $page, $uniqueid);
        break;
    } else {
        if ($cols == $numcols - 1) {
            illustrate_layout($pdf1, $dimsn[$page], $page, $uniqueid);
            $page++;
            $dimsn[$page]->coords = array();
            new_page($pdf1);
            blended_print_page_header($pdf1, $dimsn[$page], null, $activity_code, $headeroptions);
            $cols = -1;
            $x = 0;
        }
    }
}
$pdf1->Output('paperquiz.pdf', 'I');
示例#8
0
 function wiki_fn_page_attr($args, $renderer_state)
 {
     $page_name = array_shift($args);
     $attr_name = array_shift($args);
     $page = new_page($page_name, MW_REVISION_HEAD);
     $page->load();
     return $page->get_attr($attr_name);
 }
示例#9
0
 /** @private
  * process header link
  * header link may be either raw URL or [[page]]
  * @param link header link value
  */
 function process_header_link($link)
 {
     if (strpos($link, '[[') === 0) {
         # [[page]]
         $link = substr($link, 2, strlen($link) - 4);
         $linked_page = new_page($link, MW_REVISION_HEAD);
         $link = url_for_page_action($linked_page, MW_ACTION_VIEW);
     }
     return htmlspecialchars($link, ENT_QUOTES);
 }
示例#10
0
 function get_all_revisions()
 {
     $storage =& get_storage();
     $resources = $storage->get_resource_history(MW_DS_PAGES, $this->name, false);
     $ret = array();
     $is_head = true;
     foreach ($resources as $res) {
         $page = new_page($res->get(MW_RESOURCE_KEY_NAME), $res->get(MW_RESOURCE_KEY_REVISION));
         $page->last_modified = $res->get(MW_RESOURCE_KEY_LAST_MODIFIED);
         $page->message = $res->get(MW_RESOURCE_KEY_MESSAGE);
         $page->user = $res->get(MW_RESOURCE_KEY_AUTHOR);
         if ($is_head) {
             $page->revision = MW_REVISION_HEAD;
         }
         $page->raw_content_length = $res->get(MW_RESOURCE_KEY_CONTENT_LENGTH);
         array_push($ret, $page);
         $is_head = false;
     }
     return $ret;
 }
示例#11
0
 /** @protected constructor (do not use directly, use new_page()) */
 function MW_SpecialUploadsPage($name)
 {
     parent::MW_SpecialPage($name);
     # can not use load_special_page() because of infinite loop
     $this->wrapped = new_page(MW_PAGE_NAME_PREFIX_MINIWIKI . $this->name, MW_REVISION_HEAD);
 }