Example #1
0
/**
* $Id: rating.php 159 2007-12-17 16:44:05Z malanciault $
* Module: Class_Booking
* Author: The SmartFactory <www.smartfactory.ca>
* Licence: GNU
*/
function editclass($showmenu = false, $ratingid = 0)
{
    global $smartobject_rating_handler;
    $ratingObj = $smartobject_rating_handler->get($ratingid);
    if (!$ratingObj->isNew()) {
        if ($showmenu) {
            smart_adminMenu(4, _AM_SOBJECT_RATINGS . " > " . _AM_SOBJECT_EDITING);
        }
        smart_collapsableBar('ratingedit', _AM_SOBJECT_RATINGS_EDIT, _AM_SOBJECT_RATINGS_EDIT_INFO);
        $sform = $ratingObj->getForm(_AM_SOBJECT_RATINGS_EDIT, 'addrating');
        $sform->display();
        smart_close_collapsable('ratingedit');
    } else {
        $ratingObj->hideFieldFromForm(array('item', 'itemid', 'uid', 'date', 'rate'));
        if (isset($_POST['op'])) {
            $controller = new SmartObjectController($smartobject_rating_handler);
            $controller->postDataToObject($ratingObj);
            if ($_POST['op'] == 'changedField') {
                switch ($_POST['changedField']) {
                    case 'dirname':
                        $ratingObj->showFieldOnForm(array('item', 'itemid', 'uid', 'date', 'rate'));
                        break;
                }
            }
        }
        if ($showmenu) {
            smart_adminMenu(4, _AM_SOBJECT_RATINGS . " > " . _CO_SOBJECT_CREATINGNEW);
        }
        smart_collapsableBar('ratingcreate', _AM_SOBJECT_RATINGS_CREATE, _AM_SOBJECT_RATINGS_CREATE_INFO);
        $sform = $ratingObj->getForm(_AM_SOBJECT_RATINGS_CREATE, 'addrating');
        $sform->display();
        smart_close_collapsable('ratingcreate');
    }
}
Example #2
0
/**
 * $Id: offer.php,v 1.2 2007/09/19 20:09:35 marcan Exp $
 * Module: SmartCourse
 * Author: The SmartFactory <www.smartfactory.ca>
 * Licence: GNU
 */
function editoffer($showmenu = false, $offerid = 0, $fct = '')
{
    global $smartpartner_offer_handler, $smartpartner_category_handler, $smartpartner_partner_handler;
    $offerObj = $smartpartner_offer_handler->get($offerid);
    if ($offerObj->isNew()) {
        $breadcrumb = _AM_SPARTNER_OFFERS . " > " . _AM_SPARTNER_CREATINGNEW;
        $title = _AM_SPARTNER_OFFER_CREATE;
        $info = _AM_SPARTNER_OFFER_CREATE_INFO;
        $collaps_name = 'offercreate';
        $form_name = _AM_SPARTNER_OFFER_CREATE;
        $submit_button_caption = null;
        $offerObj->setVar('date_sub', time());
    } else {
        $breadcrumb = _AM_SPARTNER_OFFERS . " > " . _AM_SPARTNER_EDITING;
        $title = _AM_SPARTNER_OFFER_EDIT;
        $info = _AM_SPARTNER_OFFER_EDIT_INFO;
        $collaps_name = 'offeredit';
        $form_name = _AM_SPARTNER_OFFER_EDIT;
        $submit_button_caption = null;
    }
    $partnerObj = $smartpartner_partner_handler->get($offerObj->getVar('partnerid', 'e'));
    $offerObj->hideFieldFromForm('date_sub');
    $menuTab = 3;
    if ($showmenu) {
        smart_adminMenu($menuTab, $breadcrumb);
    }
    echo "<br />\n";
    smart_collapsableBar($collaps_name, $title, $info);
    $sform = $offerObj->getForm($form_name, 'addoffer', false, $submit_button_caption);
    if ($fct == 'app') {
        $sform->addElement(new XoopsFormHidden('fct', 'app'));
    }
    $sform->display();
    smart_close_collapsable($collaps_name);
}
Example #3
0
/**
* $Id: currency.php 159 2007-12-17 16:44:05Z malanciault $
* Module: Class_Booking
* Author: The SmartFactory <www.smartfactory.ca>
* Licence: GNU
*/
function editclass($showmenu = false, $currencyid = 0)
{
    global $smartobject_currency_handler;
    $currencyObj = $smartobject_currency_handler->get($currencyid);
    if (!$currencyObj->isNew()) {
        if ($showmenu) {
            smart_adminMenu(5, _AM_SOBJECT_CURRENCIES . " > " . _AM_SOBJECT_EDITING);
        }
        smart_collapsableBar('currencyedit', _AM_SOBJECT_CURRENCIES_EDIT, _AM_SOBJECT_CURRENCIES_EDIT_INFO);
        $sform = $currencyObj->getForm(_AM_SOBJECT_CURRENCIES_EDIT, 'addcurrency');
        $sform->display();
        smart_close_collapsable('currencyedit');
    } else {
        if ($showmenu) {
            smart_adminMenu(5, _AM_SOBJECT_CURRENCIES . " > " . _CO_SOBJECT_CREATINGNEW);
        }
        smart_collapsableBar('currencycreate', _AM_SOBJECT_CURRENCIES_CREATE, _AM_SOBJECT_CURRENCIES_CREATE_INFO);
        $sform = $currencyObj->getForm(_AM_SOBJECT_CURRENCIES_CREATE, 'addcurrency');
        $sform->display();
        smart_close_collapsable('currencycreate');
    }
}
Example #4
0
/**
* $Id: tag.php 159 2007-12-17 16:44:05Z malanciault $
* Module: SmartShop
* Author: The SmartFactory <www.smartfactory.ca>
* Licence: GNU
*/
function edittag($tagid = 0, $language = false, $fct = false)
{
    global $smartobject_tag_handler;
    $tagObj = $smartobject_tag_handler->get($tagid);
    if ($tagObj->isNew()) {
        $breadcrumb = _AM_SOBJECT_TAGS . " > " . _AM_SOBJECT_TAG_CREATE;
        $title = _AM_SOBJECT_TAG_CREATE;
        $info = _AM_SOBJECT_TAG_CREATE_INFO;
        $collaps_name = 'tagcreate';
        $form_name = _AM_SOBJECT_TAG_CREATE;
        $submit_button_caption = null;
        //$tagObj->stripMultilanguageFields();
    } else {
        if ($language) {
            $breadcrumb = _AM_SOBJECT_TAGS . " > " . _AM_SOBJECT_TAG_EDITING_LANGUAGE;
            $title = _AM_SOBJECT_TAG_EDIT_LANGUAGE;
            $info = _AM_SOBJECT_TAG_EDIT_LANGUAGE_INFO;
            $collaps_name = 'tageditlanguage';
            $form_name = _AM_SOBJECT_TAG_EDIT_LANGUAGE;
            $submit_button_caption = null;
            $tagObj->makeNonMLFieldReadOnly();
        } else {
            $breadcrumb = _AM_SOBJECT_TAGS . " > " . _AM_SOBJECT_EDITING;
            $title = _AM_SOBJECT_TAG_EDIT;
            $info = _AM_SOBJECT_TAG_EDIT_INFO;
            $collaps_name = 'tagedit';
            $form_name = _AM_SOBJECT_TAG_EDIT;
            $submit_button_caption = null;
            $tagObj->stripMultilanguageFields();
        }
    }
    smart_adminMenu(2, $breadcrumb);
    smart_collapsableBar($collaps_name, $title, $info);
    $sform = $tagObj->getForm($form_name, 'addtag', false, $submit_button_caption);
    $sform->display();
    smart_close_collapsable($collaps_name);
}
Example #5
0
/**
* $Id: adsense.php 159 2007-12-17 16:44:05Z malanciault $
* Module: Class_Booking
* Author: The SmartFactory <www.smartfactory.ca>
* Licence: GNU
*/
function editclass($showmenu = false, $adsenseid = 0, $clone = false)
{
    global $smartobject_adsense_handler;
    $adsenseObj = $smartobject_adsense_handler->get($adsenseid);
    if (!$clone && !$adsenseObj->isNew()) {
        if ($showmenu) {
            smart_adminMenu(3, _AM_SOBJECT_ADSENSES . " > " . _AM_SOBJECT_EDITING);
        }
        smart_collapsableBar('adsenseedit', _AM_SOBJECT_ADSENSES_EDIT, _AM_SOBJECT_ADSENSES_EDIT_INFO);
        $sform = $adsenseObj->getForm(_AM_SOBJECT_ADSENSES_EDIT, 'addadsense');
        $sform->display();
        smart_close_collapsable('adsenseedit');
    } else {
        $adsenseObj->setVar('adsenseid', 0);
        $adsenseObj->setVar('tag', '');
        if ($showmenu) {
            smart_adminMenu(3, _AM_SOBJECT_ADSENSES . " > " . _CO_SOBJECT_CREATINGNEW);
        }
        smart_collapsableBar('adsensecreate', _AM_SOBJECT_ADSENSES_CREATE, _AM_SOBJECT_ADSENSES_CREATE_INFO);
        $sform = $adsenseObj->getForm(_AM_SOBJECT_ADSENSES_CREATE, 'addadsense', false, false, false, true);
        $sform->display();
        smart_close_collapsable('adsensecreate');
    }
}
Example #6
0
/**
 * $Id: customtag.php 159 2007-12-17 16:44:05Z malanciault $
 * Module: Class_Booking
 * Author: The SmartFactory <www.smartfactory.ca>
 * Licence: GNU
 */
function editcustomtag($showmenu = false, $customtagid = 0, $clone = false)
{
    global $smartobject_customtag_handler;
    $customtagObj = $smartobject_customtag_handler->get($customtagid);
    if (!$clone && !$customtagObj->isNew()) {
        if ($showmenu) {
            smart_adminMenu(2, _AM_SOBJECT_CUSTOMTAGS . " > " . _AM_SOBJECT_EDITING);
        }
        smart_collapsableBar('customtagedit', _AM_SOBJECT_CUSTOMTAGS_EDIT, _AM_SOBJECT_CUSTOMTAGS_EDIT_INFO);
        $sform = $customtagObj->getForm(_AM_SOBJECT_CUSTOMTAGS_EDIT, 'addcustomtag');
        $sform->display();
        smart_close_collapsable('customtagedit');
    } else {
        $customtagObj->setVar('customtagid', 0);
        $customtagObj->setVar('tag', '');
        if ($showmenu) {
            smart_adminMenu(2, _AM_SOBJECT_CUSTOMTAGS . " > " . _CO_SOBJECT_CREATINGNEW);
        }
        smart_collapsableBar('customtagcreate', _AM_SOBJECT_CUSTOMTAGS_CREATE, _AM_SOBJECT_CUSTOMTAGS_CREATE_INFO);
        $sform = $customtagObj->getForm(_AM_SOBJECT_CUSTOMTAGS_CREATE, 'addcustomtag');
        $sform->display();
        smart_close_collapsable('customtagcreate');
    }
}
Example #7
0
        smart_adminMenu(1, _AM_SOBJECT_SENT_LINK_DISPLAY);
        smart_collapsableBar('sentlinks', _AM_SOBJECT_SENT_LINK_DISPLAY, _AM_SOBJECT_SENT_LINK_DISPLAY_INFO);
        include_once XOOPS_ROOT_PATH . '/class/template.php';
        $xoopsTpl =& new XoopsTpl();
        $xoopsTpl->assign('link', $linkObj->toArray());
        $xoopsTpl->display('db:smartobject_sentlink_display.html');
        echo "<br />";
        smart_close_collapsable('sentlinks');
        echo "<br>";
        break;
    default:
        smart_xoops_cp_header();
        smart_adminMenu(1, _AM_SOBJECT_SENT_LINKS);
        smart_collapsableBar('sentlinks', _AM_SOBJECT_SENT_LINKS, _AM_SOBJECT_SENT_LINKS_INFO);
        include_once SMARTOBJECT_ROOT_PATH . "class/smartobjecttable.php";
        $objectTable = new SmartObjectTable($smartobject_link_handler, null, array('delete'));
        $objectTable->addColumn(new SmartObjectColumn('date'));
        $objectTable->addColumn(new SmartObjectColumn(_AM_SOBJECT_SENT_LINKS_FROM, $align = 'left', $width = false, 'getFromInfo'));
        $objectTable->addColumn(new SmartObjectColumn(_AM_SOBJECT_SENT_LINKS_TO, $align = 'left', $width = false, 'getToInfo'));
        $objectTable->addColumn(new SmartObjectColumn('link'));
        $objectTable->addCustomAction("getViewItemLink");
        $objectTable->setDefaultSort('date');
        $objectTable->setDefaultOrder('DESC');
        $objectTable->render();
        echo "<br />";
        smart_close_collapsable('sentlinks');
        echo "<br>";
        break;
}
smart_modFooter();
xoops_cp_footer();