Example #1
0
InitMarket();
/* Some optimization stuff */
$serv_ipc_procs = '#basket_add#';
if ($ipc != '') {
    $n = count($serv_ipc_procs);
    if (strpos($serv_ipc_procs, $ipc) > 0) {
        /* Execute IPC command */
        ipc_exec($ipc);
        die;
    }
}
if ($action == 'drop') {
    global $id;
    if (isNumber($id)) {
        $MARKET->BASKET->DropById($id);
    }
} else {
    if ($action == 'send') {
        $MARKET->BASKET->Send();
    }
}
if ($action != 'send') {
    $tpl = manage_template_by_name('Магазин / Корзина');
    $script = $tpl->GetText();
    $params = array();
    tpl_srcp($script, $params);
} else {
    $tpl = manage_template_by_name('Магазин / Корзина / Заказ отправлен');
    $script = $tpl->GetText();
    tpl_srcp($script, array());
}
Example #2
0
<?php

/**
 * Gate - Wiki engine and web-interface for WebTester Server
 *
 * Page generation script
 *
 * Copyright (c) 2008-2009 Sergey I. Sharybin <*****@*****.**>
 *
 * This program can be distributed under the terms of the GNU GPL.
 * See the file COPYING.
 */
if ($PHP_SELF != '') {
    print 'HACKERS?';
    die;
}
/* Redirect to needed page if needed */
$start_root = opt_get('start_root');
if ($start_root != '' && $start_root != '/') {
    redirect(config_get('document-root') . $start_root);
}
/* Draw page content */
$tpl = manage_template_by_name('Статьи / Заглавная страница');
print $tpl->GetText();
Example #3
0
 function Problem_GenerateEditorForm($data = array(), $act = 'create', $backlink = '')
 {
     global $INFORMATICS_ProblemSettingsFields, $pageid, $id, $promtadd;
     $fields = $INFORMATICS_ProblemSettingsFields;
     $action = prepare_arg('.?page=prbmanager&action=' . $act . ($id != '' ? '&id=' . $id : '') . '&' . ($pageid != '' ? 'pageid=' . $pageid : '') . ($promtadd != '' ? '&promtadd=' . $promtadd : '') . ($backlink != '' ? '&redirect=' . urlencode($backlink) : ''));
     $desc = $data['desc'];
     if ($desc == '') {
         $tpl = manage_template_by_name('Олимпиады / Informatics / Заготовка условия задачи');
         $desc = $tpl->GetText();
     }
     $iframe = iframe_editor('desc', $desc, $backlink != '', 'ProblemSettings', $this->gateway->content_settings['iframe']);
     $tmp = handler_get_list('ProblemSettings');
     $arr = $tmp['onsubmit'];
     $onsubmit = '';
     for ($i = 0; $i < count($arr); $i++) {
         $onsubmit .= ' ' . handler_build_callback($arr[$i]);
     }
     $form = new CVCForm();
     $form->Init('ProblemSettings', 'method=POST;enctype=multipart/form-data;action=' . $action . ';titlewidth=160;caption=' . ($act == 'create' ? 'Создать' : 'Сохранить') . ';onsubmit=' . prepare_arg($onsubmit) . ';backlink=' . prepare_arg($backlink) . ';');
     for ($i = 0, $n = count($fields); $i < $n; $i++) {
         $f = $fields[$i];
         if ($f['action'] != '' && $f['action'] != $act) {
             continue;
         }
         $v = $data[$f['name']];
         if (strtolower($f['type']) == 'custom') {
             $v = array('src' => $f['src'], 'value' => $v, 'check_value' => $f['check_value']);
         }
         $form->AppendField($f['title'], $f['postname'], $f['type'], $v, array('important' => $f['important']));
     }
     if ($act != 'create') {
         $form->AppendField('Состояние', '', 'CUSTOM', array('src' => $this->Template('problems.state', array('data' => $data))));
     }
     if (isset($promtadd)) {
         $form->AppendCheckBoxField('Добавить на контест', 'addToContest', false);
     }
     $form->AppendCustomField(array('src' => '<center><b>Условие задачи</b>' . $iframe . '</center>'));
     return $form;
 }
Example #4
0
 function draw_template($name, $args = array())
 {
     $tpl = manage_template_by_name($name);
     tpl_srcp($tpl->GetText(), $args);
 }