Beispiel #1
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);
}
Beispiel #2
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');
    }
}
Beispiel #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');
    }
}
Beispiel #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);
}
Beispiel #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');
    }
}
Beispiel #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');
    }
}
Beispiel #7
0
     $obj =& $handler->get($_REQUEST['id']);
     if (isset($_REQUEST['ok']) && $_REQUEST['ok'] == 1) {
         if ($handler->delete($obj)) {
             redirect_header('newsletter.php?op=list', 3, sprintf(_NL_AM_DELETEDSUCCESS, $typetitle));
         } else {
             echo implode('<br />', $obj->getErrors());
         }
     } else {
         smart_xoops_cp_header();
         smart_adminMenu(0);
         xoops_confirm(array('ok' => 1, 'id' => $_REQUEST['id'], 'op' => 'delete'), 'newsletter.php', sprintf(_NL_AM_RUSUREDEL, getIdentifier($obj, $handler)));
     }
     break;
 case "details":
     smart_xoops_cp_header();
     smart_adminMenu(0);
     $newsletter = $handler->get($id);
     $newsletter_arr = $newsletter->toArray();
     $xoopsTpl->assign('newsletter', $newsletter_arr);
     $rule_handler = xoops_getmodulehandler('rule');
     $newsletter_criteria = new Criteria('newsletterid', $id);
     $criteria = new CriteriaCompo($newsletter_criteria);
     $rules = $rule_handler->getObjects($newsletter_criteria, true, false);
     if (count($rules) > 0) {
         foreach (array_keys($rules) as $i) {
             if (file_exists(XOOPS_ROOT_PATH . "/language/" . $GLOBALS['xoopsConfig']['language'] . "/calendar.php")) {
                 include_once XOOPS_ROOT_PATH . "/language/" . $GLOBALS['xoopsConfig']['language'] . "/calendar.php";
             } else {
                 include_once XOOPS_ROOT_PATH . "/language/english/calendar.php";
             }
             switch ($rules[$i]['rule_weekday']) {
 function render()
 {
     /**
      * @todo move the output to a template
      * @todo make the output XHTML compliant
      */
     $myts =& MyTextSanitizer::getInstance();
     global $xoopsModule;
     smart_xoops_cp_header();
     $module_handler =& xoops_gethandler('module');
     $versioninfo =& $module_handler->get($xoopsModule->getVar('mid'));
     smart_adminMenu(-1, $this->_aboutTitle . " " . $versioninfo->getInfo('name'));
     include_once XOOPS_ROOT_PATH . '/class/template.php';
     $this->_tpl = new XoopsTpl();
     $this->_tpl->assign('module_url', XOOPS_URL . "/modules/" . $xoopsModule->getVar('dirname') . "/");
     $this->_tpl->assign('module_image', $versioninfo->getInfo('image'));
     $this->_tpl->assign('module_name', $versioninfo->getInfo('name'));
     $this->_tpl->assign('module_version', $versioninfo->getInfo('version'));
     $this->_tpl->assign('module_status_version', $versioninfo->getInfo('status_version'));
     // Left headings...
     if ($versioninfo->getInfo('author_realname') != '') {
         $author_name = $versioninfo->getInfo('author') . " (" . $versioninfo->getInfo('author_realname') . ")";
     } else {
         $author_name = $versioninfo->getInfo('author');
     }
     $this->_tpl->assign('module_author_name', $author_name);
     $this->_tpl->assign('module_license', $versioninfo->getInfo('license'));
     $this->_tpl->assign('module_credits', $versioninfo->getInfo('credits'));
     // Developers Information
     $this->_tpl->assign('module_developer_lead', $versioninfo->getInfo('developer_lead'));
     $this->_tpl->assign('module_developer_contributor', $versioninfo->getInfo('developer_contributor'));
     $this->_tpl->assign('module_developer_website_url', $versioninfo->getInfo('developer_website_url'));
     $this->_tpl->assign('module_developer_website_name', $versioninfo->getInfo('developer_website_name'));
     $this->_tpl->assign('module_developer_email', $versioninfo->getInfo('developer_email'));
     $people = $versioninfo->getInfo('people');
     if ($people) {
         $this->_tpl->assign('module_people_developers', isset($people['developers']) ? array_map(array($this, 'sanitize'), $people['developers']) : false);
         $this->_tpl->assign('module_people_testers', isset($people['testers']) ? array_map(array($this, 'sanitize'), $people['testers']) : false);
         $this->_tpl->assign('module_people_translators', isset($people['translators']) ? array_map(array($this, 'sanitize'), $people['translators']) : false);
         $this->_tpl->assign('module_people_documenters', isset($people['documenters']) ? array_map(array($this, 'sanitize'), $people['documenters']) : false);
         $this->_tpl->assign('module_people_other', isset($people['other']) ? array_map(array($this, 'sanitize'), $people['other']) : false);
     }
     //$this->_tpl->assign('module_developers', $versioninfo->getInfo('developer_email'));
     // Module Development information
     $this->_tpl->assign('module_date', $versioninfo->getInfo('date'));
     $this->_tpl->assign('module_status', $versioninfo->getInfo('status'));
     $this->_tpl->assign('module_demo_site_url', $versioninfo->getInfo('demo_site_url'));
     $this->_tpl->assign('module_demo_site_name', $versioninfo->getInfo('demo_site_name'));
     $this->_tpl->assign('module_support_site_url', $versioninfo->getInfo('support_site_url'));
     $this->_tpl->assign('module_support_site_name', $versioninfo->getInfo('support_site_name'));
     $this->_tpl->assign('module_submit_bug', $versioninfo->getInfo('submit_bug'));
     $this->_tpl->assign('module_submit_feature', $versioninfo->getInfo('submit_feature'));
     // Warning
     $this->_tpl->assign('module_warning', $this->sanitize($versioninfo->getInfo('warning')));
     // Author's note
     $this->_tpl->assign('module_author_word', $versioninfo->getInfo('author_word'));
     // For changelog thanks to 3Dev
     global $xoopsModule;
     $filename = XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->getVar('dirname') . '/changelog.txt';
     if (is_file($filename)) {
         $filesize = filesize($filename);
         $handle = fopen($filename, 'r');
         $this->_tpl->assign('module_version_history', $myts->displayTarea(fread($handle, $filesize), true));
         fclose($handle);
     }
     $this->_tpl->display('db:smartobject_about.html');
     smart_modFooter();
     xoops_cp_footer();
 }
Beispiel #9
0
        $obj->processFormSubmit();
        if ($handler->insert($obj) && $obj->postSave()) {
            redirect_header('dispatchlist.php?id=' . $obj->getVar('newsletterid'), 3, sprintf(_NL_AM_SAVEDSUCCESS, $obj->getVar('dispatch_subject')));
        } else {
            smart_xoops_cp_header();
            smart_adminMenu(1);
            echo "<div class='errorMsg'>" . implode('<br />', $obj->getErrors()) . "</div>";
            $form =& $obj->getForm();
            $form->display();
        }
        break;
    case "delete":
        $obj =& $handler->get($_REQUEST['id']);
        if (isset($_REQUEST['ok']) && $_REQUEST['ok'] == 1) {
            if ($handler->delete($obj)) {
                redirect_header('dispatchlist.php?id=' . intval($obj->getVar('newsletterid')), 3, sprintf(_NL_AM_DELETEDSUCCESS, _NL_AM_DISPATCH));
            } else {
                echo implode('<br />', $obj->getErrors());
            }
        } else {
            smart_xoops_cp_header();
            smart_adminMenu(1);
            xoops_confirm(array('ok' => 1, 'id' => $_REQUEST['id'], 'op' => 'delete'), 'dispatch.php', sprintf(_NL_AM_RUSUREDEL, _NL_AM_DISPATCH));
        }
        break;
}
if (isset($smartOption['template_main'])) {
    $xoopsTpl->display("db:" . $smartOption['template_main']);
}
smart_modFooter();
xoops_cp_footer();
Beispiel #10
0
<?php

include "header.php";
include_once XOOPS_ROOT_PATH . '/class/xoopsform/grouppermform.php';
smart_xoops_cp_header();
smart_adminMenu(2);
$form = new XoopsGroupPermForm(_NL_AM_PERMTITLE, $xoopsModule->getVar('mid'), 'smartmail_newsletter_subscribe', _NL_AM_PERMDESC);
$smartmail_newsletter_handler = xoops_getmodulehandler('newsletter');
$newsletters = $smartmail_newsletter_handler->getList();
foreach ($newsletters as $itemid => $itemName) {
    $form->addItem($itemid, $itemName);
}
$form->display();
smart_modFooter();
xoops_cp_footer();
Beispiel #11
0
         redirect_header(SMARTOBJECT_URL . "admin/link.php", 3, _AM_SOBJECT_LINK_NOT_FOUND);
     }
     smart_xoops_cp_header();
     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;
Beispiel #12
0
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the            //
//  GNU General Public License for more details.                             //
//                                                                           //
//  You should have received a copy of the GNU General Public License        //
//  along with this program; if not, write to the Free Software              //
//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA //
//  ------------------------------------------------------------------------ //
include "header.php";
smart_xoops_cp_header();
$sortby = "";
$typename = 'rule';
$typetitle = _NL_AM_NEWSLETTERRULE;
$typetemplate = "smartmail_admin_rule_list.html";
$sortby = "rule_weekday ASC, rule_timeofday";
$order = "ASC";
smart_adminMenu(0, $typetitle);
$op = isset($_REQUEST['op']) ? $_REQUEST['op'] : 'list';
$handler =& xoops_getmodulehandler($typename);
switch ($op) {
    case "save":
        if (isset($_REQUEST['id'])) {
            $obj =& $handler->get($_REQUEST['id']);
        } else {
            $obj =& $handler->create();
        }
        $obj->processFormSubmit();
        if ($handler->insert($obj) && $obj->postSave()) {
            header('location: newsletter.php?id=' . $obj->getVar('newsletterid'));
        } else {
            echo "<div class='errorMsg'>" . implode('<br />', $obj->getErrors()) . "</div>";
            $form =& $obj->getForm();