Ejemplo n.º 1
0
function goAction($act, $category_id, $course_id, $courses, $exercises)
{
    if (!$act || $act == null) {
        $act = "default";
    }
    switch ($act) {
        case 'default':
            showPage();
            break;
        case 'getCategory':
            showCategories();
            break;
        case 'getCategoryJson':
            showCategoryTree();
            break;
        case 'getCourses':
            showCourses($category_id);
            break;
        case 'getTracks':
            showTracks($category_id, $course_id);
            break;
        case 'getScores':
            showScores($category_id, $course_id);
            break;
        case 'getSummary':
            showSummary($category_id, $courses, $exercises);
            break;
        case 'getExcel':
            showExcel($category_id, $courses, $exercises);
            break;
        case 'getCfgs':
            showConfig($category_id, $course_id);
            break;
        case 'saveCfgs':
            $count = $_GET['count'];
            $configs = $_GET['config'];
            setConfig($category_id, $course_id, $count, $configs);
            break;
        case 'createCfgs':
            $quiz_count = @$_GET['count'];
            if (!isset($quiz_count) || $quiz_count == null || $quiz_count <= 0) {
                drawConfigPanel($category_id, $course_id);
            } else {
                drawConfigPanel($category_id, $course_id, $quiz_count);
            }
            break;
        case 'removeCfgs':
            removeConfig($category_id, $course_id);
            break;
        case 'getStudents':
            showStudentConfigs();
            break;
        case 'saveStudents':
            $students = $_GET['s'];
            saveStudentConfigs($students);
            break;
    }
}
Ejemplo n.º 2
0
        break;
    case 'addtocart':
    case 'deletefromcart':
    case 'emptycart':
    case 'showcart':
        echo "<hr /><h1>Your shopping cart</h1>";
        showCart($_SESSION['cart'], $mode);
        break;
    case 'image':
        showCategories($mode);
        echo "<h1>Large Product Image</h1>";
        showImage($ASIN, $mode);
        break;
    case 'search':
        showCategories($mode);
        echo "<h1>Search Results For " . $search . "</h1>";
        showSearch($search, $page, $mode);
        break;
    case 'browsenode':
    default:
        showCategories($mode);
        $category = getCategoryName($browseNode);
        if (!$category || $category == 'Best Selling Books') {
            echo "<h1>Current Best Sellers</h1>";
        } else {
            echo "<h1>Current Best Sellers in " . $category . "</h1>";
        }
        showBrowseNode($browseNode, $page, $mode);
        break;
}
require 'bottom.php';
Ejemplo n.º 3
0
        orderCategory($cid[0], 1);
        break;
    case 'accesspublic':
        accessMenu($cid[0], 0, $section);
        break;
    case 'accessregistered':
        accessMenu($cid[0], 1, $section);
        break;
    case 'accessspecial':
        accessMenu($cid[0], 2, $section);
        break;
    case 'saveorder':
        saveOrder($cid, $section);
        break;
    default:
        showCategories($section, $option);
        break;
}
/**
* Compiles a list of categories for a section
* @param string The name of the category section
*/
function showCategories($section, $option)
{
    global $mainframe;
    $db =& JFactory::getDBO();
    $filter_order = $mainframe->getUserStateFromRequest($option . '.filter_order', 'filter_order', 'c.ordering', 'cmd');
    $filter_order_Dir = $mainframe->getUserStateFromRequest($option . '.filter_order_Dir', 'filter_order_Dir', '', 'word');
    $filter_state = $mainframe->getUserStateFromRequest($option . '.' . $section . '.filter_state', 'filter_state', '', 'word');
    $sectionid = $mainframe->getUserStateFromRequest($option . '.' . $section . '.sectionid', 'sectionid', 0, 'int');
    $search = $mainframe->getUserStateFromRequest($option . '.search', 'search', '', 'string');
Ejemplo n.º 4
0
}
$action = RMHttpRequest::request('action', 'string', '');
switch ($action) {
    case 'new':
        showForm();
        break;
    case 'save':
        bxpress_save_category();
        break;
    case 'edit':
        showForm(1);
        break;
    case 'saveedit':
        bxpress_save_category(1);
        break;
    case 'savechanges':
        updateOrderCatego();
        break;
    case 'delete':
        deleteCatego();
        break;
    case 'enable':
        activeCatego(1);
        break;
    case 'disable':
        activeCatego();
        break;
    default:
        showCategories();
        break;
}
Ejemplo n.º 5
0
function editForum($uid, $option)
{
    $kunena_db =& JFactory::getDBO();
    $kunena_acl =& JFactory::getACL();
    $kunena_my =& JFactory::getUser();
    $row = new fbForum($kunena_db);
    // load the row from the db table
    $row->load($uid);
    //echo "<pre>"; print_r ($row); echo "</pre>";
    if ($uid) {
        $row->checkout($kunena_my->id);
        $categories = array();
    } else {
        // initialise new record
        $categories[] = JHTML::_('select.option', '0', _KUNENA_TOPLEVEL, 'value', 'text');
        $row->parent = 0;
        $row->published = 0;
        $row->ordering = 9999;
    }
    // get a list of just the categories
    $kunena_db->setQuery("SELECT a.id AS value, a.name AS text FROM #__fb_categories AS a WHERE parent='0' AND id<>'{$row->id}' ORDER BY ordering");
    $categories = array_merge($categories, $kunena_db->loadObjectList());
    check_dberror("Unable to load categories.");
    if ($row->parent == 0) {
        //make sure the Top Level Category is available in edit mode as well:
        $kunena_db->setQuery("SELECT distinct '0' AS value, '" . _KUNENA_TOPLEVEL . "' AS text FROM #__fb_categories AS a WHERE parent='0' AND id<>'{$row->id}' ORDER BY ordering");
        $categories = array_merge($categories, (array) $kunena_db->loadObjectList());
        check_dberror("Unable to load categories.");
        //build the select list:
        $categoryList = JHTML::_('select.genericlist', $categories, 'parent', 'class="inputbox" size="1"', 'value', 'text', $row->parent);
    } else {
        $categoryList = JHTML::_('select.genericlist', $categories, 'parent', 'class="inputbox" size="1"', 'value', 'text', $row->parent);
    }
    $categoryList = showCategories($row->parent, "parent", "", "4");
    // make a standard yes/no list
    $yesno = array();
    $yesno[] = JHTML::_('select.option', '0', _ANN_NO);
    $yesno[] = JHTML::_('select.option', '1', _ANN_YES);
    // make a standard no/yes list
    $noyes = array();
    $noyes[] = JHTML::_('select.option', '1', _ANN_YES);
    $noyes[] = JHTML::_('select.option', '0', _ANN_NO);
    //Create all kinds of Lists
    $lists = array();
    $accessLists = array();
    //create custom group levels to include into the public group selectList
    $pub_groups = array();
    $pub_groups[] = JHTML::_('select.option', 0, _KUNENA_EVERYBODY);
    $pub_groups[] = JHTML::_('select.option', -1, _KUNENA_ALLREGISTERED);
    $pub_groups = array_merge($pub_groups, $kunena_acl->get_group_children_tree(null, _KUNENA_REGISTERED, true));
    //create admin groups array for use in selectList:
    $adm_groups = array();
    $adm_groups = array_merge($adm_groups, $kunena_acl->get_group_children_tree(null, _KUNENA_PUBLICBACKEND, true));
    //create the access control list
    $accessLists['pub_access'] = JHTML::_('select.genericlist', $pub_groups, 'pub_access', 'class="inputbox" size="4"', 'value', 'text', $row->pub_access);
    $accessLists['admin_access'] = JHTML::_('select.genericlist', $adm_groups, 'admin_access', 'class="inputbox" size="4"', 'value', 'text', $row->admin_access);
    $lists['pub_recurse'] = JHTML::_('select.genericlist', $yesno, 'pub_recurse', 'class="inputbox" size="1"', 'value', 'text', $row->pub_recurse);
    $lists['admin_recurse'] = JHTML::_('select.genericlist', $yesno, 'admin_recurse', 'class="inputbox" size="1"', 'value', 'text', $row->admin_recurse);
    $lists['forumLocked'] = JHTML::_('select.genericlist', $yesno, 'locked', 'class="inputbox" size="1"', 'value', 'text', $row->locked);
    $lists['forumModerated'] = JHTML::_('select.genericlist', $noyes, 'moderated', 'class="inputbox" size="1"', 'value', 'text', $row->moderated);
    $lists['forumReview'] = JHTML::_('select.genericlist', $yesno, 'review', 'class="inputbox" size="1"', 'value', 'text', $row->review);
    //get a list of moderators, if forum/category is moderated
    $moderatorList = array();
    if ($row->moderated == 1) {
        $kunena_db->setQuery("SELECT * FROM #__fb_moderation AS a LEFT JOIN #__users as u ON a.userid=u.id where a.catid={$row->id}");
        $moderatorList = $kunena_db->loadObjectList();
        check_dberror("Unable to load moderator list.");
    }
    html_Kunena::editForum($row, $categoryList, $moderatorList, $lists, $accessLists, $option);
}
Ejemplo n.º 6
0
    }
    return $msg;
}
//Control logic
if ($privs >= 4) {
    //manager or admin
    $msg = '';
    if (isset($_POST['addExe'])) {
        $msg = addCat($cat);
    } elseif (isset($_POST['updExe'])) {
        $msg = updateCat($cat);
    } elseif (isset($_GET['delExe'])) {
        $msg = deleteCat($cat);
    }
    echo "<p class='error'>{$msg}</p>\n\t\t<div class='scrollBoxAd'>\n\t\t<div class='centerBox'>\n";
    if ($mode == 'sort') {
        sortCategories();
        //sort on name
    }
    if ($mode != 'add' and $mode != 'edit' or isset($_POST['back'])) {
        showCategories(false);
        //no add / no edit
    } else {
        editCategory($cat);
        //add or edit
        showCategories(true);
    }
    echo "</div>\n</div>\n";
} else {
    echo "<p class='error'>{$ax['no_way']}</p>\n";
}
Ejemplo n.º 7
0
<?php

session_start();
require_once 'constants.php';
require 'topbar.php';
require 'categoryfunctions.php';
showCategories('books');
?>
<h1>About Tahuayo.com</h1>

<p>The Tahuayo River is a tributary of the Amazon River.  <a href = 'index.com'>Tahuayo.com</a> is an interface to
<a href='http://www.amazon.com/'>Amazon.com</a>.

<p>You can purchase any books stocked by Amazon.com at Tahuayo.com, but it is not really intended to be a profit generating site.
It exists to demonstrate using Amazon's <a href = 'http://associates.amazon.com/exec/panama/associates/ntg/browse/-/1067662/ref=gw_hp_ls_1_3/104-9837819-3411136'>Web Services</a> interface.
The site is built using <a href='http://www.php.net/'>PHP</a> and connects to Amazon using XML/HTTP and SOAP.

<p>You can find out more about this site, and obtain the complete source code in Chapter 31 of <a href = 'index.php?action=detail&ASIN=067232525X'><i>PHP and MySQL Web Development 2nd Edition</i></a> by Luke Welling and Laura Thomson.

<hr>
<?php 
require 'bottom.php';
?>


Ejemplo n.º 8
0
 function getBlockCode_Founded($iBlockId)
 {
     $aParam = array('pagination' => getParam('categ_perpage_browse'));
     $sFilter = bx_get('filter');
     if ($sFilter !== false) {
         $aParam['filter'] = process_db_input($sFilter);
     } else {
         if ($this->oForm->isSubmittedAndValid()) {
             $aParam['filter'] = $this->oForm->getCleanValue('Keyword');
         }
     }
     if (isset($aParam['filter'])) {
         return showCategories($aParam, $iBlockId, BX_CATEG_ACTION_SEARCH, false, false, _t('_categ_caption_founded_categ'));
     } else {
         return MsgBox(_t('_Empty'));
     }
 }
Ejemplo n.º 9
0
     showCategories($category);
     break;
     // case Index
 // case Index
 case WEDDING:
     $filePath .= "images/weddings";
     break;
     // case WEDDING
 // case WEDDING
 case PORTRAIT:
     $filePath .= "images/portraits";
     break;
     // PORTRAIT
 // PORTRAIT
 case KIDS:
     showCategories($category);
     break;
     // case KIDS
 // case KIDS
 case KIDS_BABY:
     $filePath .= "images/babies";
     break;
     // case KIDS_BABY
 // case KIDS_BABY
 case KIDS_1_3:
     $filePath .= "images/kids_one_three";
     break;
     // case KIDS_BABY
 // case KIDS_BABY
 case KIDS_3_13:
     $filePath .= "images/kids_three_up";
<?php

session_start();
require_once 'constants.php';
require 'topbar.php';
require 'categoryfunctions.php';
showCategories('Books');
?>
<h1>About Tahuayo.com</h1>

<p>The Tahuayo River is a tributary of the Amazon River.
<a href="index.com">Tahuayo.com</a> is an interface to
<a href="http://www.amazon.com/">Amazon.com</a>.

<p>You can purchase any books stocked by Amazon.com at
Tahuayo.com, but it is not really intended to be a profit
generating site. It exists to demonstrate using Amazon's
<a href="http://aws.amazon.com/">Web Services</a>
interface. The site is built using <a href="http://www.php.net/">PHP</a>
and connects to Amazon using XML/HTTP (REST) or SOAP.

<p>You can find out more about this site, and obtain the complete
source code in Chapter 33 of
<a href="index.php?action=detail&ASIN=0672329166">
<em>PHP and MySQL Web Development 4th Edition</em></a>
by Luke Welling and Laura Thomson.

<hr>
<?php 
require 'bottom.php';
?>
Ejemplo n.º 11
0
HTML_FPSlideShow::showNavBar($option, $task);
switch ($task) {
    // CONFIG
    case "save_config":
        saveConfig($option, $mosConfig_absolute_path);
        break;
    case "config":
        editConfig($fpss_config, $option);
        break;
        // CATEGORIES
    // CATEGORIES
    case "cancel_category":
        cancelCategory($option);
        break;
    case "categories":
        showCategories($option);
        break;
    case "new_category":
        editCategory(0, $option);
        break;
    case "edit_category":
        editCategory($cid, $option);
        break;
    case "save_category":
        saveCategory($option);
        break;
    case "delete_category":
        deleteCategories($option);
        break;
    case "publish_category":
        publishCategories(1, $option);