<?php /* For licensing terms, see /license.txt */ /** * Initialization install * @author Angel Fernando Quiroz Campos <*****@*****.**> * @package chamilo.plugin.tour */ require_once __DIR__ . '/config.php'; Tour::create()->install();
<?php /* For licensing terms, see /license.txt */ /** * Config the plugin * @author Angel Fernando Quiroz Campos <*****@*****.**> * @package chamilo.plugin.tour */ require_once __DIR__ . '/config.php'; $pluginPath = api_get_path(SYS_PLUGIN_PATH) . 'tour/'; $pluginWebPath = api_get_path(WEB_PLUGIN_PATH) . 'tour/'; $userId = api_get_user_id(); $tourPlugin = Tour::create(); $config = $tourPlugin->getTourConfig(); $showTour = $tourPlugin->get('show_tour') === 'true'; if ($showTour) { $pages = array(); foreach ($config as $pageContent) { $pages[] = array('pageClass' => $pageContent['pageClass'], 'show' => $tourPlugin->checkTourForUser($pageContent['pageClass'], $userId)); } $theme = $tourPlugin->get('theme'); $_template['show_tour'] = $showTour; $_template['pages'] = json_encode($pages); $_template['web_path'] = array('intro_css' => "{$pluginWebPath}intro.js/introjs.min.css", 'intro_theme_css' => null, 'intro_js' => "{$pluginWebPath}intro.js/intro.min.js", 'steps_ajax' => "{$pluginWebPath}ajax/steps.ajax.php", 'save_ajax' => "{$pluginWebPath}ajax/save.ajax.php"); if (file_exists("{$pluginPath}intro.js/introjs-{$theme}.css")) { $_template['web_path']['intro_theme_css'] = "{$pluginWebPath}intro.js/introjs-{$theme}.css"; } }
<?php /* For licensing terms, see /license.txt */ /** * Initialization uninstall * @author Angel Fernando Quiroz Campos <*****@*****.**> * @package chamilo.plugin.tour */ require_once __DIR__ . '/config.php'; Tour::create()->uninstall();
$status &= !$exitStatus; if ($exitStatus) { break; } } status($status, $exitStatus ? Match::$T_CREATE_ERROR_MSGS[$exitStatus] : null); } else { switch ($_POST['type']) { case 'FFA_TOUR': $TOUR_TYPE = TT_FFA; break; case 'RR_TOUR': $TOUR_TYPE = TT_RROBIN; break; } status(Tour::create(array('did' => $_POST['did'], 'name' => $_POST['name'], 'type' => $TOUR_TYPE, 'rs' => (int) $_POST['rs'], 'teams' => $team_ids, 'rounds' => $_POST['rounds'], 'allow_sched' => 0))); } } } title($lng->getTrn('menu/admin_menu/schedule')); ?> <script language="JavaScript" type="text/javascript"> function chTour(t) { /* Handles the disabling and enabling of form elements depending on what tournament type is chosen. Expects TT_* PHP constants to be globally available to javascript. */
case 'del_tournament': status($IS_GLOBAL_ADMIN ? $t->delete(true) : false, $IS_GLOBAL_ADMIN ? '' : 'Note that only site admins may use this feature.'); break; case 'new_tournament': $input = array(); $input['name'] = $_POST['name']; $input['did'] = $_POST['did']; $input['rs'] = $_POST['rs']; $input['type'] = $_POST['tourtype']; $input['allow_sched'] = isset($_POST['allow_sched']) ? $_POST['allow_sched'] : 0; $input['teams'] = array(); $lid = $divisions[$input['did']]['f_lid']; if (strlen($input['name']) == 0) { status(false, 'You must enter a name for the tournament.'); } else { status(Tour::create($input)); if (isset($_POST['locked'])) { // N/A, locked for new_toursnament type } } break; case 'mod_tournament': $syncPTS = $t->rs != (int) $_POST['rs']; $t->rs = $_POST['rs']; $t->type = $_POST['tourtype']; $t->name = $_POST['name']; $t->locked = isset($_POST['locked']) ? $_POST['locked'] : 0; $t->allow_sched = isset($_POST['allow_sched']) ? $_POST['allow_sched'] : 0; status($t->save()); if ($syncPTS) { $OK = $t->syncPTS();
<?php /* For licensing terms, see /license.txt */ /** * Show the JavaScript template in the web pages * @author Angel Fernando Quiroz Campos <*****@*****.**> * @package chamilo.plugin.tour */ require_once __DIR__ . '/config.php'; $plugin_info = Tour::create()->get_info(); $plugin_info['templates'] = array('views/script.tpl');
<?php require_once "util.php"; require_once "NTK/NTK.php"; require_once "DataBase/Tour.php"; require_once "DataBase/Bill.php"; require_once "DataBase/Assistant.php"; require_once "DataBase/Bill_Product.php"; $db_action = var_get_post("db_action", ""); $tour = new Tour(); $bill = new Bill(); $assistant = new Assistant(); switch ($db_action) { case "new": $tour->create(array(var_post("name", ""), var_post("assistant_id", ""))); break; case "edit": $tour->update(var_post("tour_id", ""), array(var_post("name", ""), var_post("assistant_id", ""))); break; case "delete": $tour->delete(var_get("tour_id", "")); break; case "tour_to_bill": $tour = new Tour(); $tmp = $tour->get(var_get("tour_id", "")); $tour_data = $tmp[0]; $bill = new Bill(); $new_bill_id = $bill->create('', array(var_post("customer_id", ""), var_post("tour_id", ""), var_post("date", ""), var_post("assistant_id", ""), -1, 0)); $bill_product = new Bill_Product(); $product = new Product(); $product_data = $product->get();