function saveDesktop() { $data = array('wizardcomplete' => empty($_REQUEST['wizardcomplete']) ? null : $_REQUEST['wizardcomplete']); $toC_Desktop_Settings = new toC_Desktop_Settings(); $toC_Desktop_Settings->save($data); echo '{success: true}'; }
function saveGadgets() { $data = $_REQUEST['gadgets']; $toC_Desktop_Settings = new toC_Desktop_Settings(); $toC_Desktop_Settings->saveGadgets($data); echo '{success: true}'; }
function loadPortlets() { global $toC_Json, $osC_Language; $desktop_settings = new toC_Desktop_Settings(); $portlets = $desktop_settings->getDashBoards(); if (!empty($portlets)) { $response = array('success' => true, 'portlets' => $portlets, 'feedback' => $osC_Language->get('ms_success_action_performed')); } else { $response = array('success' => false, 'feedback' => $osC_Language->get('ms_error_action_not_performed')); } echo $toC_Json->encode($response); }
function getTomatCartFeeds() { global $toC_Json; $url = 'http://www.tomatoshop.ir/live_feeds.php'; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_REFERER, HTTP_SERVER); curl_setopt($ch, CURLOPT_HTTPGET, true); curl_setopt($ch, CURLOPT_HEADER, true); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); $response = curl_exec($ch); if (!curl_errno($ch)) { $data = trim(substr($response, strpos($response, "\r\n\r\n", strpos(strtolower($response), 'content-length:')))); $osC_XML = new osC_XML($data); $definitions = $osC_XML->toArray(); $items = $definitions['rss']['channel']['item']; $feeds = ''; if (is_array($items) && sizeof($items) > 0) { $feeds = '<a href="' . $items['link'] . '" target="_blank"><h1 dir="rtl" align="right">' . $items['title'] . '</h1></a>' . '<p dir="rtl" align="right">' . $items['description'] . '</p><p dir="rtl" align="left"><a href="' . $items['link'] . '" target="_blank">بیشتر...</a></p>'; require_once 'includes/classes/desktop_settings.php'; $toC_Desktop_Settings = new toC_Desktop_Settings(); $last_feed = (int) $toC_Desktop_Settings->getLastLiveFeed(); $current_feed = (int) $items['pubDate']; if ($current_feed > $last_feed) { $response = array('success' => true, 'feeds' => $feeds); $toC_Desktop_Settings->setLastLiveFeed($current_feed); } else { $response = array('success' => false); } } } else { $response = array('success' => false); } curl_close($ch); echo $toC_Json->encode($response); }
http://www.tomatocart.com Copyright (c) 2009 Wuxi Elootec Technology Co., Ltd This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License v2 (1991) as published by the Free Software Foundation. */ require_once 'includes/application_top.php'; if (!isset($_SESSION['admin'])) { osc_redirect_admin(osc_href_link_admin(FILENAME_DEFAULT)); } require_once 'includes/classes/json.php'; $toC_Json = new toC_Json(); require_once 'includes/classes/desktop_settings.php'; $toC_Desktop_Settings = new toC_Desktop_Settings(); require_once 'includes/classes/currencies.php'; $osC_Currencies = new osC_Currencies(); header('Cache-Control: no-cache, must-revalidate'); header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); header('Content-Type: application/x-javascript'); $token = toc_generate_token(); ?> var token = '<?php echo $token; ?> '; Ext.Ajax.extraParams = {token: token}; Ext.data.Connection.prototype.extraParams = {token: token};