Пример #1
0
 function update()
 {
     global $db;
     //$db->delete('modstate');
     $aMods = $db->selectObjects('modstate', 1);
     foreach ($aMods as $key => $value) {
         if (!empty($this->params['mods']) && array_key_exists($value->module, $this->params['mods'])) {
             $aMods[$key]->active = $this->params['mods'][$value->module];
             $db->updateObject($aMods[$key], 'modstate', "module='" . $value->module . "'");
         } else {
             $aMods[$key]->active = 0;
             $db->updateObject($aMods[$key], 'modstate', "module='" . $value->module . "'");
         }
         unset($this->params['mods'][$value->module]);
     }
     if (!empty($this->params['mods'])) {
         foreach ($this->params['mods'] as $key => $value) {
             $aMod->module = $key;
             $aMod->active = $value;
             $db->insertObject($aMod, 'modstate');
         }
     }
     flash("message", gt("Active Modules have been updated."));
     expHistory::returnTo('editable');
 }
 public function toggle_default()
 {
     global $db;
     $order_status = new order_status($this->params['id']);
     $db->setUniqueFlag($order_status, 'order_status', 'is_default');
     expHistory::back();
 }
Пример #3
0
 public function update()
 {
     // update the record.
     $record = $this->snippet->update($this->params);
     // go back to where we came from.
     expHistory::back();
 }
Пример #4
0
 function showall()
 {
     expHistory::set('viewable', $this->params);
     $causes = $this->donation->find('all');
     //eDebug($causes);
     assign_to_template(array('causes' => $causes));
 }
Пример #5
0
 function showByTitle()
 {
     global $db, $user, $router;
     //eDebug($this->params,true);
     expHistory::set('viewable', $this->params);
     $count_sql_start = 'SELECT COUNT(DISTINCT p.id) FROM ' . DB_TABLE_PREFIX . '_product p ';
     $sql_start = 'SELECT DISTINCT p.* FROM ' . DB_TABLE_PREFIX . '_product p ';
     //$sql = 'JOIN '.DB_TABLE_PREFIX.'_product_storeCategories sc ON p.id = sc.product_id ';
     $sql = 'WHERE ';
     if (!($user->is_admin || $user->is_acting_admin)) {
         $sql .= '(p.active_type=0 OR p.active_type=1) AND ';
     }
     //$sql .= 'sc.storecategories_id IN (';
     //$sql .= 'SELECT id FROM '.DB_TABLE_PREFIX.'_storeCategories WHERE rgt BETWEEN '.$this->category->lft.' AND '.$this->category->rgt.')';
     $sql .= 'p.companies_id=' . $this->params['id'];
     $count_sql = $count_sql_start . $sql;
     $sql = $sql_start . $sql;
     //eDebug($sql);
     $order = 'p.id';
     //$this->config['orderby'];
     $dir = 'DESC';
     $this->config['orderby_dir'];
     //eDebug($this->config);
     $page = new expPaginator(array('model_field' => 'product_type', 'sql' => $sql, 'count_sql' => $count_sql, 'limit' => $this->config['pagination_default'], 'order' => $order, 'dir' => $dir, 'controller' => $this->params['controller'], 'action' => $this->params['action'], 'columns' => array('Model #' => 'model', 'Product Name' => 'title', 'Price' => 'base_price')));
     //$ancestors = $this->category->pathToNode();
     //$categories = ($this->parent == 0) ? $this->category->getTopLevel(null,false,true) : $this->category->getChildren(null,false,true);
     //eDebug($page);
     //$rerankSQL = "SELECT DISTINCT p.* FROM ".DB_TABLE_PREFIX."_product p JOIN ".DB_TABLE_PREFIX."_product_storeCategories sc ON  p.id = sc.product_id WHERE sc.storecategories_id=".$this->category->id." ORDER BY rank ASC";
     //eDebug($router);
     $defaultSort = $router->current_url;
     assign_to_template(array('record' => new company($this->params['id']), 'page' => $page, 'defaultSort' => $defaultSort));
 }
Пример #6
0
/**
 * Smarty {backlink} function plugin
 *
 * Type:     function<br>
 * Name:     backlink<br>
 * Purpose:  create a back link
 *
 * @param         $params
 * @param \Smarty $smarty
 */
function smarty_function_backlink($params, &$smarty)
{
    //	global $history;
    //	$d=$params['distance']?$params['distance']+1:2;
    //	echo makelink($history->history[$history->history['lasts']['type']][count($history->history[$history->history['lasts']['type']])-$d]['params']);
    $d = $params['distance'] ? $params['distance'] : 1;
    echo makeLink(expHistory::getBack($d));
}
Пример #7
0
 public function slideshow()
 {
     expHistory::set('viewable', $this->params);
     $where = $this->aggregateWhereClause();
     $order = 'rank';
     $s = new photo();
     $slides = $s->find('all', $where, $order);
     assign_to_template(array('slides' => $slides));
 }
Пример #8
0
 function addToCart($params)
 {
     global $order;
     expSession::set('params', $params);
     //get the configuration
     $cfg->mod = "ecomconfig";
     $cfg->src = "@globalstoresettings";
     $cfg->int = "";
     $config = new expConfig($cfg);
     $this->config = empty($catConfig->config) || @$catConfig->config['use_global'] == 1 ? $config->config : $catConfig->config;
     $min_amount = $this->config['minimum_gift_card_purchase'];
     $custom_message_product = $this->config['custom_message_product'];
     if (empty($params['product_id'])) {
         flash('error', gt("Please specify the style of the gift card you want to purchase."));
         expHistory::back();
     }
     if (empty($params['card_amount']) && empty($params['card_amount_txt'])) {
         flash('error', gt("You need to specify the card amount for the gift card."));
         expHistory::back();
     } else {
         // eDebug($params, true);
         $item = new orderitem($params);
         $sm = $order->getCurrentShippingMethod();
         $item->shippingmethods_id = $sm->id;
         if (isset($params['card_amount_txt'])) {
             $params['card_amount_txt'] = preg_replace("/[^0-9.]/", "", $params['card_amount_txt']);
         }
         if (!empty($params['card_amount_txt']) && $params['card_amount_txt'] > 0) {
             $item->products_price = preg_replace("/[^0-9.]/", "", $params['card_amount_txt']);
         } else {
             $item->products_price = preg_replace("/[^0-9.]/", "", $params['card_amount']);
         }
         if ($item->products_price < $min_amount) {
             flash('error', gt("The minimum amount of gift card is") . " " . $min_amount);
             expHistory::back();
         }
         $item->products_name = expCore::getCurrencySymbol() . $params['card_amount'] . ' ' . $this->title . " Style Gift Card";
         if (!empty($params['toname'])) {
             $ed['To'] = isset($params['toname']) ? $params['toname'] : '';
         }
         if (!empty($params['fromname'])) {
             $ed['From'] = isset($params['fromname']) ? $params['fromname'] : '';
         }
         if (!empty($params['msg'])) {
             $ed['Message'] = isset($params['msg']) ? $params['msg'] : '';
             $item->products_price += $custom_message_product;
             $item->products_name = $item->products_name . " (with message)";
         }
         $item->extra_data = serialize($ed);
         // we need to unset the orderitem's ID to force a new entry..other wise we will overwrite any
         // other giftcards in the cart already
         $item->id = null;
         $item->quantity = $this->getDefaultQuantity();
         $item->save();
         return true;
     }
 }
Пример #9
0
 function showall()
 {
     expHistory::set('viewable', $this->params);
     $modelname = $this->basemodel_name;
     $where = $this->hasSources() ? $this->aggregateWhereClause() : null;
     $limit = isset($this->config['limit']) ? $this->config['limit'] : null;
     $order = isset($this->config['order']) ? $this->config['order'] : "rank";
     $links = $this->{$modelname}->find('all', $where, $order, $limit);
     assign_to_template(array('items' => $links, 'rank' => $order === 'rank' ? 1 : 0));
 }
Пример #10
0
 function showall()
 {
     expHistory::set('viewable', $this->params);
     $modelname = $this->basemodel_name;
     $where = $this->aggregateWhereClause();
     $limit = isset($this->params['limit']) ? $this->params['limit'] : null;
     $order = "rank";
     $page = new expPaginator(array('model' => $modelname, 'where' => $where, 'limit' => $limit, 'order' => $order, 'controller' => $this->baseclassname, 'action' => $this->params['action'], 'columns' => array('ID#' => 'id', 'Title' => 'title', 'Body' => 'body')));
     assign_to_template(array('page' => $page, 'items' => $page->records));
 }
Пример #11
0
 public function showUnpublished()
 {
     expHistory::set('viewable', $this->params);
     $modelname = $this->basemodel_name;
     // setup the where clause for looking up records.
     $where = "(unpublish != 0 AND unpublish < " . time() . ") OR (publish > " . time() . ")";
     $where .= "AND " . $this->aggregateWhereClause();
     $page = new expPaginator(array('model' => 'news', 'where' => $where, 'limit' => 25, 'order' => 'unpublish', 'controller' => $this->baseclassname, 'action' => $this->params['action'], 'columns' => array('Title' => 'title', 'Published On' => 'publish', 'Status' => 'unpublish')));
     assign_to_template(array('page' => $page));
 }
 function view_registrants()
 {
     expHistory::set('viewable', $this->params);
     $event = new eventregistration($this->params['id']);
     //eDebug($event);
     //eDebug("a:" . isset($event->registrants));
     //eDebug("b:" . is_array($event->registrants));
     if (isset($event->registrants)) {
         $registrants = expUnserialize($event->registrants);
     } else {
         $registrants = null;
     }
     //eDebug($registrants);
     assign_to_template(array('event' => $event, 'registrants' => $registrants));
 }
Пример #13
0
 public function downloadfile()
 {
     if (empty($this->params['fileid'])) {
         flash('error', gt('There was an error while trying to download your file.  No File Specified.'));
         expHistory::back();
     }
     $fd = new filedownload($this->params['fileid']);
     if (empty($fd->expFile['downloadable'][0]->id)) {
         flash('error', gt('There was an error while trying to download your file.  The file you were looking for could not be found.'));
         expHistory::back();
     }
     $fd->downloads += 1;
     $fd->save();
     // this will set the id to the id of the actual file..makes the download go right.
     $this->params['id'] = $fd->expFile['downloadable'][0]->id;
     parent::downloadfile();
 }
Пример #14
0
 /**
  * manage tags
  */
 function manage()
 {
     global $db;
     expHistory::set('manageable', $this->params);
     $modelname = $this->basemodel_name;
     $where = $this->hasSources() ? $this->aggregateWhereClause() : null;
     $order = "title";
     $page = new expPaginator(array('model' => $modelname, 'where' => $where, 'limit' => 50, 'order' => $order, 'controller' => $this->baseclassname, 'action' => $this->params['action'], 'src' => $this->hasSources() == true ? $this->loc->src : null, 'columns' => array('ID#' => 'id', 'Title' => 'title', 'Body' => 'body')));
     foreach ($db->selectColumn('content_expTags', 'content_type', null, null, true) as $contenttype) {
         foreach ($page->records as $key => $value) {
             $attatchedat = $page->records[$key]->findWhereAttachedTo($contenttype);
             if (!empty($attatchedat)) {
                 $page->records[$key]->attachedcount = @$page->records[$key]->attachedcount + count($attatchedat);
                 $page->records[$key]->attached[$contenttype] = $attatchedat;
             }
         }
     }
     assign_to_template(array('page' => $page));
 }
Пример #15
0
 function __construct($item_type, $item_dir, $view = "Default")
 {
     include_once SMARTY_PATH . 'Smarty.class.php';
     // Set up the Smarty template variable we wrap around.
     $this->tpl = new Smarty();
     $this->tpl->error_reporting = error_reporting() & ~E_NOTICE & ~E_WARNING;
     //FIXME this disables bad template code reporting 3.x
     $this->tpl->error_unassigned = true;
     // display notice when accessing unassigned variable, if warnings turned on
     //		$this->tpl->debugging = DEVELOPMENT;  // Opens up the debug console
     //Some (crappy) wysiwyg editors use php as their default initializer
     //FJD - this might break some editors...we'll see.
     $this->tpl->php_handling = SMARTY::PHP_REMOVE;
     $this->tpl->caching = false;
     $this->tpl->cache_dir = BASE . 'tmp/cache';
     $this->tpl->setPluginsDir(array(SMARTY_PATH . 'plugins', BASE . 'framework/plugins'));
     //autoload filters
     $this->tpl->autoload_filters = array('post' => array('includemiscfiles'));
     $this->viewfile = expTemplate::getViewFile($item_type, $item_dir, $view);
     $this->viewdir = realpath(dirname($this->viewfile));
     $this->module = $item_dir;
     $this->view = substr(basename($this->viewfile), 0, -4);
     //fix for the wamp/lamp issue
     //checks necessary in case a file from /views/ is used
     //should go away, the stuff should be put into a CoreModule
     //then this can be simplified
     //TODO: generate this through $this->viewfile using find BASE/THEME_ABSOLUTE and replace with ""
     //		if($item_type != "") {
     //			$this->langdir .= $item_type . "/";
     //		}
     //		if($item_dir != "") {
     //			$this->langdir .= $item_dir . "/";
     //		}
     //		$this->langdir .= "views/";
     $this->tpl->template_dir = $this->viewdir;
     $this->tpl->compile_dir = BASE . 'tmp/views_c';
     $this->tpl->compile_id = md5($this->viewfile);
     $this->tpl->assign("__view", $this->view);
     $this->tpl->assign("__redirect", expHistory::getLastNotEditable());
 }
Пример #16
0
 function controlToHTML($name)
 {
     if ($this->next . $this->back . $this->cancel == "") {
         return "";
     }
     $html = "";
     if ($this->back != "") {
         $html .= '<input type="submit" name="nextback" value="' . $this->back . '"';
         //if ($this->disabled) $html .= " disabled";
         $html .= ' onclick="if (checkRequired(this.form)) ';
         if ($this->validateJS != "") {
             $html .= '{ if (' . $this->validateJS . ') { return true; } else { return false; } }';
         } else {
             $html .= '{ return true; }';
         }
         $html .= ' else { return false; }"';
         $html .= ' />';
     }
     if ($this->next != "") {
         $html .= '<input type="submit" name="nextback" value="' . $this->next . '"';
         if ($this->disabled) {
             $html .= " disabled";
         }
         $html .= ' onclick="if (checkRequired(this.form)) ';
         if ($this->validateJS != "") {
             $html .= '{ if (' . $this->validateJS . ') { return true; } else { return false; } }';
         } else {
             $html .= '{ return true; }';
         }
         $html .= ' else { return false; }"';
         $html .= ' />';
     }
     if ($this->cancel != "") {
         $html .= '<input type="button" value="' . $this->cancel . '"';
         $html .= ' onclick="document.location.href=\'' . expHistory::getLastNotEditable() . '\'"';
         $html .= ' />';
     }
     return $html;
 }
Пример #17
0
 /**
  * prompts the user to download a file
  *
  * @static
  * @access public
  *
  * @uses function download()    Built-in PHP method
  *
  * @PHPUnit Not Defined|Implement|Completed
  *
  * @param string $file       Full path to file to download
  * @return void
  * @throws void
  *
  */
 public static function download($file)
 {
     // we are expecting an int val as a file ID or the whole file object.
     // If all we get is the ID then we'll instantiate a new file object.
     // If that object doesn't have it's id property set or the file doesn't
     // actually exist then we can assume its not a valid file object and
     // return false.
     if (!is_object($file)) {
         $file = new expFile($file);
     }
     //if (empty($file->id) || !file_exists($file->path)) return false;
     if (!file_exists($file->path)) {
         flash('error', gt('The file is unavailable for Download'));
         expHistory::back();
         return false;
     }
     // NO buffering from here on out or things break unexpectedly. - RAM
     ob_end_clean();
     // This code was lifted from phpMyAdmin, but this is Open Source, right?
     // 'application/octet-stream' is the registered IANA type but
     // MSIE and Opera seems to prefer 'application/octetstream'
     // It seems that other headers I've added make IE prefer octet-stream again. - RAM
     $mimetype = EXPONENT_USER_BROWSER == 'IE' || EXPONENT_USER_BROWSER == 'OPERA' ? 'application/octet-stream;' : $file->mimetype;
     header('Content-Type: ' . $mimetype);
     header('Expires: ' . gmdate('D, d M Y H:i:s') . ' GMT');
     //header("Content-length: ".filesize($file->path));  // for some reason the webserver cant run stat on the files and this breaks.
     header('Content-Transfer-Encoding: binary');
     header('Content-Encoding:');
     header('Content-Disposition: attachment; filename="' . $file->filename . '";');
     // IE need specific headers
     if (EXPONENT_USER_BROWSER == 'IE') {
         header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
         header('Pragma: public');
         header('Vary: User-Agent');
     } else {
         header('Pragma: no-cache');
     }
     //Read the file out directly
     readfile($file->path);
     exit;
 }
Пример #18
0
 public function showall_by_tags()
 {
     global $db;
     // set history
     expHistory::set('viewable', $this->params);
     // get the tag being passed
     $tag = new expTag($this->params['tag']);
     // find all the id's of the blog posts for this blog module
     $port_ids = $db->selectColumn('portfolio', 'id', $this->aggregateWhereClause());
     // find all the blogs that this tag is attached to
     $ports = $tag->findWhereAttachedTo('portfolio');
     // loop the blogs for this tag and find out which ones belong to this module
     $ports_by_tags = array();
     foreach ($ports as $port) {
         if (in_array($port->id, $port_ids)) {
             $ports_by_tags[] = $port;
         }
     }
     // create a pagination object for the blog posts and render the action
     $order = 'created_at';
     $limit = empty($this->config['limit']) ? 10 : $this->config['limit'];
     $page = new expPaginator(array('records' => $ports_by_tags, 'limit' => $limit, 'order' => $order, 'controller' => $this->baseclassname, 'action' => $this->params['action'], 'columns' => array('Title' => 'title')));
     $page->records = expSorter::sort(array('array' => $page->records, 'sortby' => 'rank', 'order' => 'ASC', 'ignore_case' => true));
     assign_to_template(array('page' => $page));
 }
Пример #19
0
# it and/or modify it under the terms of the GNU
# General Public License as published by the Free
# Software Foundation; either version 2 of the
# License, or (at your option) any later version.
#
# GPL: http://www.gnu.org/licenses/gpl.txt
#
##################################################
// Part of the Extensions category
if (!defined('EXPONENT')) {
    exit('');
}
global $router;
if (expPermissions::check('extensions', expCore::makeLocation('administrationmodule'))) {
    //	expHistory::flowSet(SYS_FLOW_PROTECTED,SYS_FLOW_ACTION);
    expHistory::set('manageable', $router->params);
    // get new bots into the database
    if (is_readable(BASE . 'framework/modules-1/bots/bots')) {
        $dh = opendir(BASE . 'framework/modules-1/bots/bots');
        while (($file = readdir($dh)) !== false) {
            $botfile = BASE . 'framework/modules-1/bots/bots/' . $file;
            if (is_file($botfile) && is_readable($botfile) && substr($file, -4) == '.php') {
                include_once $botfile;
                $botname = substr($file, 0, -4);
                $bot = $db->selectObject('bots', "name='" . $botname . "'");
                if (empty($bot)) {
                    $botobj = new $botname();
                    $bot = null;
                    $bot->name = $botname;
                    $bot->state = 0;
                    $bot->displayname = $botobj->displayname();
Пример #20
0
# General Public License as published by the Free
# Software Foundation; either version 2 of the
# License, or (at your option) any later version.
#
# GPL: http://www.gnu.org/licenses/gpl.txt
#
##################################################
if (!defined('EXPONENT')) {
    exit('');
}
$_GET['a'] = intval($_GET['a']);
$_GET['b'] = intval($_GET['b']);
$_GET['p'] = intval($_GET['p']);
$a = $db->selectObject('formbuilder_control', 'form_id=' . $_GET['p'] . ' AND rank=' . $_GET['a']);
$b = $db->selectObject('formbuilder_control', 'form_id=' . $_GET['p'] . ' AND rank=' . $_GET['b']);
if ($a && $b) {
    $f = $db->selectObject('formbuilder_form', 'id=' . $a->form_id);
    if (expPermissions::check('editform', unserialize($f->location_data))) {
        $tmp = $a->rank;
        $a->rank = $b->rank;
        $b->rank = $tmp;
        $db->updateObject($a, 'formbuilder_control');
        $db->updateObject($b, 'formbuilder_control');
        //		expHistory::back();
        expHistory::returnTo('editable');
    } else {
        echo SITE_403_HTML;
    }
} else {
    echo SITE_404_HTML;
}
Пример #21
0
 /**
  * download a file attached to item
  */
 function downloadfile()
 {
     global $db;
     if (!isset($this->config['allowdownloads']) || $this->config['allowdownloads'] == true) {
         //if ($db->selectObject('content_expFiles', 'content_type="'.$this->baseclassname.'" AND expfiles_id='.$this->params['id']) != null) {
         expFile::download($this->params['id']);
         //}
     } else {
         flash('error', gt('Downloads have not been enabled for this file'));
         expHistory::back();
     }
 }
 function manage_ranks()
 {
     global $db;
     $rank = 1;
     $category = new storeCategory($this->params['id']);
     foreach ($this->params['rerank'] as $key => $id) {
         $sql = "SELECT DISTINCT sc.* FROM exponent_product_storeCategories sc JOIN exponent_product p ON p.id = sc.product_id WHERE p.id=" . $id . " AND sc.storecategories_id IN (SELECT id FROM exponent_storeCategories WHERE rgt BETWEEN " . $category->lft . " AND " . $category->rgt . ") ORDER BY rank ASC";
         $prod = $db->selectObjectBySQL($sql);
         $prod->rank = $rank;
         $db->updateObject($prod, "product_storeCategories", "storecategories_id=" . $prod->storecategories_id . " AND product_id=" . $id);
         $rank += 1;
     }
     expHistory::back();
 }
Пример #23
0
 function update_upcharge()
 {
     $this->loc->src = "@globalstoresettings";
     $config = new expConfig($this->loc);
     $this->config = $config->config;
     //This will make sure that only the country or region that given a rate value will be saved in the db
     $upcharge = array();
     foreach ($this->params['upcharge'] as $key => $item) {
         if (!empty($item)) {
             $upcharge[$key] = $item;
         }
     }
     $this->config['upcharge'] = $upcharge;
     $config->update(array('config' => $this->config));
     flash('message', gt('Configuration updated'));
     expHistory::back();
 }
Пример #24
0
        //		$buttons = "<input name=\"submitSubmit\" class=\"button\" type=\"submit\" value=\"Save\" onclick=\"if (checkRequired(this.form)) { if (validate(this.form)) { return true; } else { return false; } } else { return false; }\" /> ";
        $buttons = '<button name="submitSubmit" type="submit" id="' . $_GET['id'] . 'Submit" class="submit button awesome ' . BTN_SIZE . ' ' . BTN_COLOR;
        $buttons .= '" type="submit" value="' . "Save" . '"';
        $buttons .= ' onclick="if (checkRequired(this.form)) { if (validate(this.form)) { return true; } else { return false; } } else { return false; }"';
        $buttons .= ' />';
        $buttons .= "Save";
        $buttons .= ' </button>';
        //		$buttons .= "<input name=\"submitNew\" class=\"button\" type=\"submit\" value=\"Save as New Event\" onclick=\"if (checkRequired(this.form)) { if (validate(this.form)) { return true; } else { return false; } } else { return false; }\" /> ";
        $buttons .= '<button name="submitNew" type="submit" id="' . $_GET['id'] . 'Submit" class="submit button awesome ' . BTN_SIZE . ' ' . BTN_COLOR;
        $buttons .= '" type="submit" value="' . "Save as New Event" . '"';
        $buttons .= ' onclick="if (checkRequired(this.form)) { if (validate(this.form)) { return true; } else { return false; } } else { return false; }"';
        $buttons .= ' />';
        $buttons .= "Save as New Event";
        $buttons .= ' </button>';
        //		$buttons .= "<input class=\"button\" type=\"button\" value=\"Cancel\" onclick=\"document.location.href='".expHistory::getLastNotEditable()."'\" /> ";
        $buttons .= '<button type="cancel" class="cancel button awesome ' . BTN_SIZE . ' ' . BTN_COLOR . '" onclick="document.location.href=\'' . expHistory::getLastNotEditable() . '\'; return false;"';
        $buttons .= '>';
        $buttons .= "Cancel";
        $buttons .= '</button>';
        //		$buttons .= "</div>";
        $form->register(null, '', new htmlcontrol($buttons));
    }
    $form->validationScript = PATH_RELATIVE . 'framework/modules-1/calendarmodule/assets/js/postedit.validate.js';
    //FIXME This is not working
    $template = new template('calendarmodule', '_form_edit', $loc);
    $template->assign('form_html', $form->toHTML());
    $template->assign('is_edit', $item == null ? 0 : 1);
    $template->output();
} else {
    echo SITE_403_HTML;
}
Пример #25
0
 public function empty_cart()
 {
     global $order;
     foreach ($order->orderitem as $orderItem) {
         $orderItem->delete();
     }
     flash('message', gt('Your shopping cart is now empty.'));
     expHistory::back();
 }
Пример #26
0
 function controlToHTML($name)
 {
     if ($this->submit . $this->reset . $this->cancel == "") {
         return "";
     }
     if (empty($this->id)) {
         $this->id = $name;
     }
     $html = "";
     if ($this->submit != "") {
         $html .= '<button type="submit" id="' . $this->id . 'Submit" class="submit button awesome ' . BTN_SIZE . ' ' . BTN_COLOR;
         if ($this->disabled) {
             $html .= " disabled";
         }
         $html .= '" type="submit" value="' . $this->submit . '"';
         if ($this->disabled) {
             $html .= " disabled";
         }
         $html .= ' onclick="if (checkRequired(this.form)';
         if (isset($this->onclick)) {
             $html .= ' ' . $this->onclick;
         }
         $html .= ') ';
         if ($this->validateJS != "") {
             $html .= '{ if (' . $this->validateJS . ') { return true; } else { return false; } }';
         } else {
             $html .= '{ return true; }';
         }
         $html .= ' else { return false; }"';
         $html .= ' />';
         $html .= $this->submit;
         $html .= ' </button>';
     }
     //if ($this->reset != "") $html .= '<input class="button" type="reset" value="' . $this->reset . '"' . ($this->disabled?" disabled":"") . ' />';
     if ($this->cancel != "") {
         if ($this->returntype == "") {
             $html .= '<button type="cancel" class="cancel button awesome ' . BTN_SIZE . ' ' . BTN_COLOR . '" onclick="document.location.href=\'' . expHistory::getLastNotEditable() . '\'; return false;"';
         } else {
             $html .= '<button type="cancel" class="cancel button awesome ' . BTN_SIZE . ' ' . BTN_COLOR . '" onclick="document.location.href=\'' . expHistory::getLast($this->returntype) . '\'; return false;"';
         }
         $html .= '>';
         $html .= $this->cancel;
         $html .= '</button>';
     }
     expCSS::pushToHead(array("unique" => "button", "corecss" => "button"));
     return $html;
 }
Пример #27
0
<?php

##################################################
#
# Copyright (c) 2004-2011 OIC Group, Inc.
#
# This file is part of Exponent
#
# Exponent is free software; you can redistribute
# it and/or modify it under the terms of the GNU
# General Public License as published by the Free
# Software Foundation; either version 2 of the
# License, or (at your option) any later version.
#
# GPL: http://www.gnu.org/licenses/gpl.txt
#
##################################################
if (!defined('EXPONENT')) {
    exit('');
}
expHistory::back();
Пример #28
0
 /** exdoc
  * Useful only if theme does not use self::main
  *
  * @return
  * @internal param bool $public Whether or not the page is public.
  * @node     Subsystems:Theme
  */
 public static function mainContainer()
 {
     global $router;
     if (!AUTHORIZED_SECTION) {
         // Set this so that a login on an Auth Denied page takes them back to the previously Auth-Denied page
         //			expHistory::flowSet(SYS_FLOW_PROTECTED,SYS_FLOW_SECTIONAL);
         expHistory::set('manageable', $router->params);
         echo SITE_403_HTML;
         return;
     }
     if (PUBLIC_SECTION) {
         //			expHistory::flowSet(SYS_FLOW_PUBLIC,SYS_FLOW_SECTIONAL);
         expHistory::set('viewable', $router->params);
     } else {
         //			expHistory::flowSet(SYS_FLOW_PROTECTED,SYS_FLOW_SECTIONAL);
         expHistory::set('manageable', $router->params);
     }
     #   if (expSession::is_set("themeopt_override")) {
     #       $config = expSession::get("themeopt_override");
     self::showSectionalModule("containermodule", "Default", "", "@section", false, true);
     //FIXME change to showModule call
     #   } else {
     #       self::showSectionalModule("containermodule","Default","","@section");
     #   }
 }
 public function delete()
 {
     global $db, $history;
     /* The global constants can be overriden by passing appropriate params */
     //sure wish I could do this once in the constructor. sadly $this->params[] isn't set yet
     $require_login = empty($this->params['require_login']) ? SIMPLENOTE_REQUIRE_LOGIN : $this->params['require_login'];
     $require_approval = empty($this->params['require_approval']) ? SIMPLENOTE_REQUIRE_APPROVAL : $this->params['require_approval'];
     $require_notification = empty($this->params['require_notification']) ? SIMPLENOTE_REQUIRE_NOTIFICATION : $this->params['require_notification'];
     $notification_email = empty($this->params['notification_email']) ? SIMPLENOTE_NOTIFICATION_EMAIL : $this->params['notification_email'];
     if (empty($this->params['id'])) {
         flash('error', gt('Missing id for the comment you would like to delete'));
         $lastUrl = expHistory::getLast('editable');
     }
     // delete the note
     $simplenote = new expSimpleNote($this->params['id']);
     $rows = $simplenote->delete();
     // delete the assocication too
     $db->delete($simplenote->attachable_table, 'expsimplenote_id=' . $this->params['id']);
     // send the user back where they came from.
     $lastUrl = expHistory::getLast('editable');
     if (!empty($this->params['tab'])) {
         $lastUrl .= "#" . $this->params['tab'];
     }
     redirect_to($lastUrl);
 }
Пример #30
0
 function delete_model_alias()
 {
     global $db;
     if (empty($this->params['id'])) {
         return false;
     }
     $db->delete('model_aliases', 'id =' . $this->params['id']);
     expHistory::back();
 }