当前位置: 首页>>代码示例>>PHP>>正文


PHP module_config::save_config方法代码示例

本文整理汇总了PHP中module_config::save_config方法的典型用法代码示例。如果您正苦于以下问题:PHP module_config::save_config方法的具体用法?PHP module_config::save_config怎么用?PHP module_config::save_config使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在module_config的用法示例。


在下文中一共展示了module_config::save_config方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: init

 public function init()
 {
     $this->links = array();
     $this->module_name = "webnpro_menu_module_redbooth";
     $this->module_position = '13';
     $this->version = '1.0';
     module_config::save_config('_menu_order_webnpro_menu_module_redbooth', '13');
 }
开发者ID:sgh1986915,项目名称:php-crm,代码行数:8,代码来源:webnpro_menu_module_redbooth.php

示例2: init

 public function init()
 {
     $this->module_name = "cache";
     $this->module_position = 1;
     $this->version = 2.229;
     // 2.229 - 2014-07-28 - menu generation speed improvement
     // 2.228 - 2014-05-12 - cache bug fixing
     // 2.227 - 2013-10-02 - cache bug fixing
     // 2.226 - 2013-09-12 - hopefully a BIG new speed improvement - change advanced cache_enabled to 1
     // 2.225 - 2013-09-12 - debug_cache advanced option added
     // 2.224 - 2013-09-10 - dashboard speed fix
     // 2.223 - 2013-09-08 - cache size fix
     // 2.222 - 2013-09-06 - cache_objects configuration variable (not cache_object)
     // 2.221 - 2013-09-03 - cache improvements and bug fixing
     // 2.22 - 2013-08-31 - cache and speed improvements
     // 2.21 - 2013-08-30 - better memcache support
     // 2.2 - 2013-08-30 - starting work on memcache support
     // version bug fix? maybe?
     // use memcache if it exists
     if (class_exists('Memcache', false) && module_config::c('cache_enabled', 1) && module_config::c('memcache_active', 0)) {
         self::$_memcache_instance = new Memcache();
         if (self::$_memcache_instance->connect(module_config::c('memcache_address', '127.0.0.1'), module_config::c('memcache_port', '11211'))) {
             //module_config::c('memcache_address','localhost'), )){
             self::$_memcache_prefix = md5(session_id() . _UCM_SECRET . _DB_PREFIX . _DB_NAME . _DB_USER . _DB_PASS);
             // what version of information are we requesting (inremented each time something is deleted, inserted or updated)
             // bad, but cannot think of any other easy quick way to invalidate caches upon updates
             self::$_memcache_version = self::$_memcache_instance->get(self::$_memcache_prefix . 'version');
             if (!self::$_memcache_version) {
                 self::$_memcache_version = 1;
             }
             self::$_use_memcache = true;
         }
     } else {
         if (module_config::c('cache_enabled', 1) && $this->db_table_exists('cache_store')) {
             $sql = "SELECT * FROM `" . _DB_PREFIX . "cache_store` WHERE expire_time > " . time();
             foreach (qa($sql) as $res) {
                 if (!isset(self::$_db_cache[$res['cache_group']])) {
                     self::$_db_cache[$res['cache_group']] = array();
                 }
                 self::$_db_cache[$res['cache_group']][$res['cache_key']] = $res['cache_data'];
             }
             register_shutdown_function('module_cache::shutdown_write_cached_data');
         }
     }
     // change to low number by default
     if (module_config::c('cache_objects', 120) == 3600) {
         module_config::save_config('cache_objects', 120);
     }
     if (module_config::c('cache_enabled', 1) && $this->db_table_exists('cache')) {
         $sql = "SELECT * FROM `" . _DB_PREFIX . "cache`";
         foreach (qa($sql) as $r) {
             self::$_cache_expiry[$r['cache_group']] = $r['expire_time'];
         }
     }
 }
开发者ID:sgh1986915,项目名称:php-crm,代码行数:55,代码来源:cache.php

示例3: save_job

 public static function save_job($job_id, $data)
 {
     if (isset($data['default_renew_auto']) && !isset($data['renew_auto'])) {
         $data['renew_auto'] = 0;
     }
     if (isset($data['default_renew_invoice']) && !isset($data['renew_invoice'])) {
         $data['renew_invoice'] = 0;
     }
     if (isset($data['total_percent_complete_override']) && $data['total_percent_complete_override'] != '' && $data['total_percent_complete_override'] <= 100) {
         $data['total_percent_complete_manual'] = 1;
         $data['total_percent_complete'] = $data['total_percent_complete_override'] / 100;
     } else {
         $data['total_percent_complete_manual'] = 0;
     }
     if (isset($data['customer_id']) && $data['customer_id'] > 0) {
         // check we have access to this customer from this job.
         $customer_check = module_customer::get_customer($data['customer_id']);
         if (!$customer_check || $customer_check['customer_id'] != $data['customer_id']) {
             unset($data['customer_id']);
         }
     }
     if (isset($data['website_id']) && $data['website_id']) {
         $website = module_website::get_website($data['website_id']);
         if ($website && (int) $website['website_id'] > 0 && $website['website_id'] == $data['website_id']) {
             // website exists.
             // make this one match the website customer_id, or set teh website customer_id if it doesn't have any.
             if ((int) $website['customer_id'] > 0) {
                 if ($data['customer_id'] > 0 && $data['customer_id'] != $website['customer_id']) {
                     set_message('Changed this Job to match the Website customer');
                 }
                 $data['customer_id'] = $website['customer_id'];
             } else {
                 if (isset($data['customer_id']) && $data['customer_id'] > 0) {
                     // set the website customer id to this as well.
                     update_insert('website_id', $website['website_id'], 'website', array('customer_id' => $data['customer_id']));
                 }
             }
         }
     }
     if ((int) $job_id > 0) {
         $original_job_data = self::get_job($job_id, false);
         if (!$original_job_data || $original_job_data['job_id'] != $job_id) {
             $original_job_data = array();
             $job_id = false;
         }
     } else {
         $original_job_data = array();
         $job_id = false;
     }
     if (!(int) $job_id && module_config::c('job_name_incrementing', 0)) {
         // incrememnt next job number on save.
         $job_number = module_config::c('job_name_incrementing_next', 1);
         module_config::save_config('job_name_incrementing_next', $job_number + 1);
     }
     $job_id = update_insert("job_id", $job_id, "job", $data);
     if ($job_id) {
         // save the job tax rates (copied from invoice.php)
         if (isset($data['tax_ids']) && isset($data['tax_names']) && $data['tax_percents']) {
             $existing_taxes = get_multiple('job_tax', array('job_id' => $job_id), 'job_tax_id', 'exact', 'order');
             $order = 1;
             foreach ($data['tax_ids'] as $key => $val) {
                 if (isset($data['tax_percents'][$key]) && $data['tax_percents'][$key] == 0) {
                     // we are not saving this particular tax item because it has a 0% tax rate
                 } else {
                     if ((int) $val > 0 && isset($existing_taxes[$val])) {
                         // this means we are trying to update an existing record on the job_tax table, we confirm this id matches this job.
                         $job_tax_id = $val;
                         unset($existing_taxes[$job_tax_id]);
                         // so we know which ones to remove from the end.
                     } else {
                         $job_tax_id = false;
                         // create new record
                     }
                     $job_tax_data = array('job_id' => $job_id, 'percent' => isset($data['tax_percents'][$key]) ? $data['tax_percents'][$key] : 0, 'amount' => 0, 'name' => isset($data['tax_names'][$key]) ? $data['tax_names'][$key] : 'TAX', 'order' => $order++, 'increment' => isset($data['tax_increment_checkbox']) && $data['tax_increment_checkbox'] ? 1 : 0);
                     $job_tax_id = update_insert('job_tax_id', $job_tax_id, 'job_tax', $job_tax_data);
                 }
             }
             foreach ($existing_taxes as $existing_tax) {
                 delete_from_db('job_tax', array('job_id', 'job_tax_id'), array($job_id, $existing_tax['job_tax_id']));
             }
         }
         module_cache::clear('job');
         $result = self::save_job_tasks($job_id, $data);
         $check_completed = true;
         switch ($result['status']) {
             case 'created':
                 // we added a new task.
                 break;
             case 'deleted':
                 // we deleted a task.
                 break;
             case 'edited':
                 // we changed a task (ie: completed?);
                 break;
             default:
                 // nothing changed.
                 // $check_completed = false;
                 break;
         }
         if ($check_completed) {
//.........这里部分代码省略.........
开发者ID:sgh1986915,项目名称:php-crm,代码行数:101,代码来源:job.php

示例4: save_quote

 public static function save_quote($quote_id, $data)
 {
     if (isset($data['customer_id']) && $data['customer_id'] > 0) {
         // check we have access to this customer from this quote.
         $customer_check = module_customer::get_customer($data['customer_id']);
         if (!$customer_check || $customer_check['customer_id'] != $data['customer_id']) {
             unset($data['customer_id']);
         }
     }
     if (isset($data['website_id']) && $data['website_id']) {
         $website = module_website::get_website($data['website_id']);
         if ($website && (int) $website['website_id'] > 0 && $website['website_id'] == $data['website_id']) {
             // website exists.
             // make this one match the website customer_id, or set teh website customer_id if it doesn't have any.
             if ((int) $website['customer_id'] > 0) {
                 if ($data['customer_id'] > 0 && $data['customer_id'] != $website['customer_id']) {
                     set_message('Changed this Quote to match the Website customer');
                 }
                 $data['customer_id'] = $website['customer_id'];
             } else {
                 if (isset($data['customer_id']) && $data['customer_id'] > 0) {
                     // set the website customer id to this as well.
                     update_insert('website_id', $website['website_id'], 'website', array('customer_id' => $data['customer_id']));
                 }
             }
         }
     }
     if ((int) $quote_id > 0) {
         $original_quote_data = self::get_quote($quote_id, false);
         if (!$original_quote_data || $original_quote_data['quote_id'] != $quote_id) {
             $original_quote_data = array();
             $quote_id = false;
         }
     } else {
         $original_quote_data = array();
         $quote_id = false;
     }
     // check create permissions.
     if (!$quote_id && !self::can_i('create', 'Quotes')) {
         // user not allowed to create quotes.
         set_error('Unable to create new Quotes');
         redirect_browser(self::link_open(false));
     }
     if (!(int) $quote_id && module_config::c('quote_name_incrementing', 0)) {
         // incrememnt next quote number on save.
         $quote_number = module_config::c('quote_name_incrementing_next', 1);
         module_config::save_config('quote_name_incrementing_next', $quote_number + 1);
     }
     $quote_id = update_insert("quote_id", $quote_id, "quote", $data);
     $return = false;
     if ($quote_id) {
         hook_handle_callback('quote_save', $quote_id);
         // save the quote tax rates (copied from invoice.php)
         if (isset($data['tax_ids']) && isset($data['tax_names']) && $data['tax_percents']) {
             $existing_taxes = get_multiple('quote_tax', array('quote_id' => $quote_id), 'quote_tax_id', 'exact', 'order');
             $order = 1;
             foreach ($data['tax_ids'] as $key => $val) {
                 if (isset($data['tax_percents'][$key]) && $data['tax_percents'][$key] == 0) {
                     // we are not saving this particular tax item because it has a 0% tax rate
                 } else {
                     if ((int) $val > 0 && isset($existing_taxes[$val])) {
                         // this means we are trying to update an existing record on the quote_tax table, we confirm this id matches this quote.
                         $quote_tax_id = $val;
                         unset($existing_taxes[$quote_tax_id]);
                         // so we know which ones to remove from the end.
                     } else {
                         $quote_tax_id = false;
                         // create new record
                     }
                     $quote_tax_data = array('quote_id' => $quote_id, 'percent' => isset($data['tax_percents'][$key]) ? $data['tax_percents'][$key] : 0, 'amount' => 0, 'name' => isset($data['tax_names'][$key]) ? $data['tax_names'][$key] : 'TAX', 'order' => $order++, 'increment' => isset($data['tax_increment_checkbox']) && $data['tax_increment_checkbox'] ? 1 : 0);
                     $quote_tax_id = update_insert('quote_tax_id', $quote_tax_id, 'quote_tax', $quote_tax_data);
                 }
             }
             foreach ($existing_taxes as $existing_tax) {
                 delete_from_db('quote_tax', array('quote_id', 'quote_tax_id'), array($quote_id, $existing_tax['quote_tax_id']));
             }
         }
         module_cache::clear('quote');
         $return = array('quote_id' => $quote_id, 'task_result' => self::save_quote_tasks($quote_id, $data));
         $check_completed = true;
         switch ($return['task_result']['status']) {
             case 'created':
                 // we added a new task.
                 break;
             case 'deleted':
                 // we deleted a task.
                 break;
             case 'edited':
                 // we changed a task (ie: completed?);
                 break;
             default:
                 // nothing changed.
                 // $check_completed = false;
                 break;
         }
         if ($check_completed) {
             self::update_quote_completion_status($quote_id);
         }
         if ($original_quote_data) {
             // we check if the hourly rate has changed
//.........这里部分代码省略.........
开发者ID:sgh1986915,项目名称:php-crm,代码行数:101,代码来源:quote.php

示例5: save_menu

 /**
  * Save menu
  * @param array $items
  */
 public function save_menu($items)
 {
     if (!isset($menu_items)) {
         $menu_items = array();
     }
     if (!isset($external_menu_items)) {
         $external_menu_items = array();
     }
     if (!isset($items)) {
         $items = array();
     }
     $before_dashboard = true;
     $i = 0;
     foreach ($items['menu_name'] as $item) {
         if ($items['menu_name'][$i] != '') {
             $menu_items[$i]['name'] = $items['menu_name'][$i];
             $menu_items[$i]['icon_name'] = $items['menu_icon'][$i];
             $menu_items[$i]['url'] = $items['menu_url'][$i];
             $menu_items[$i]['m'] = $items['menu_module'][$i] != '' ? $items['menu_module'][$i] : "webnpro_menu_module_" . module_webnpro_menu_editor::slug($menu_item['name']);
             $menu_items[$i]['p'] = $items['menu_page'][$i];
             if ($menu_items[$i]['m'] == 'dashboard') {
                 $before_dashboard = false;
             }
             if ($before_dashboard) {
                 $menu_items[$i]['order'] = $i - 9999;
             } else {
                 $menu_items[$i]['order'] = $i;
             }
             if ($menu_items[$i]['url'] != '' && $menu_items[$i]['m'] != 'dashboard') {
                 $external_menu_items[] = $menu_items[$i];
             }
             // Save menu order
             module_config::save_config('_menu_order_' . $menu_items[$i]['m'], $i);
             $i++;
         }
     }
     // Create new custom menu modules
     if (count($external_menu_items)) {
         module_webnpro_menu_editor::create_menu_plugins($external_menu_items);
         header('Location: ' . $_SERVER['REQUEST_URI']);
     }
     /* END public function save_menu($items) */
 }
开发者ID:sgh1986915,项目名称:php-crm,代码行数:47,代码来源:webnpro_menu_editor.php

示例6: complete_plugin_installation

 public function complete_plugin_installation($plugin_name)
 {
     global $plugins;
     $result = array('message' => '');
     $new_system_version = module_config::current_version();
     $fail = false;
     if (isset($plugins[$plugin_name])) {
         $result['message'] .= "Processing update: <span style='text-decoration:underline;'>" . $plugin_name . "</span> - Current Version: " . $plugins[$plugin_name]->get_plugin_version() . ".... ";
         ob_start();
         if ($version = $plugins[$plugin_name]->install_upgrade()) {
             $result['message'] .= '<span class="success_text">all good</span>';
             $new_system_version = max($version, $new_system_version);
             $plugins[$plugin_name]->init();
             // lol typo - oh well.
             $plugins[$plugin_name]->set_insatlled_plugin_version($version);
         } else {
             $fail = true;
             $result['message'] .= '<span class="error_text">failed</span> ';
         }
         $result['message'] .= ob_get_clean() . '<br/>';
         $result['message'] .= '<br/>';
         if ($fail) {
             $result['message'] .= _('Some things failed. Please go back and try again.');
         } else {
             $result['message'] .= '<strong>' . _l('Success! Everything worked.') . '</strong>';
             module_config::set_system_version($new_system_version);
             module_config::save_config('last_update', time());
         }
         if (isset($_SESSION['_message']) && count($_SESSION['_message'])) {
             $result['message'] .= '<br/>';
             $result['message'] .= implode('<br/>', $_SESSION['_message']);
             unset($_SESSION['_errors']);
         }
         if (isset($_SESSION['_errors']) && count($_SESSION['_errors'])) {
             $result['message'] .= '<br/>';
             $result['message'] .= implode('<br/>', $_SESSION['_errors']);
             unset($_SESSION['_errors']);
         }
     } else {
         if ($plugin_name == 'corefiles' || $plugin_name == 'database') {
         } else {
             $fail = true;
         }
     }
     // hack to clear db field cache:
     module_cache::clear('db');
     if (!$fail) {
         $result['success'] = 1;
     }
     return $result;
 }
开发者ID:sgh1986915,项目名称:php-crm,代码行数:51,代码来源:class.upgrade.php

示例7: redirect_browser

/** 
 * Copyright: dtbaker 2012
 * Licence: Please check CodeCanyon.net for licence details. 
 * More licence clarification available here:  http://codecanyon.net/wiki/support/legal-terms/licensing-terms/ 
 * Deploy: 9809 f200f46c2a19bb98d112f2d32a8de0c4
 * Envato: 4ffca17e-861e-4921-86c3-8931978c40ca
 * Package Date: 2015-11-25 02:55:20 
 * IP Address: 67.79.165.254
 */
if (!module_config::can_i('view', 'Settings')) {
    redirect_browser(_BASE_HREF);
}
print_heading('Menu Order (beta!)');
if (isset($_REQUEST['save_config']) && is_array($_REQUEST['save_config'])) {
    foreach ($_REQUEST['save_config'] as $key => $val) {
        module_config::save_config($key, $val);
    }
    set_message('Menu order saved');
}
?>

<form action="" method="post">
    <table class="tableclass tableclass_rows">
        <thead>
        <tr>
            <th class="width2">
                <?php 
_e('Menu Item');
?>
            </th>
            <th>
开发者ID:sgh1986915,项目名称:php-crm,代码行数:31,代码来源:config_menu.php

示例8: redirect_browser

 * Package Date: 2015-11-25 02:55:20 
 * IP Address: 67.79.165.254
 */
if (!module_finance::can_i('view', 'Finance Upcoming')) {
    redirect_browser(_BASE_HREF);
}
$module->page_title = 'Recurring';
$search = isset($_REQUEST['search']) ? $_REQUEST['search'] : array();
if (module_config::c('finance_recurring_show_finished', 0)) {
    $search['show_finished'] = true;
}
if (!isset($search['date_to'])) {
    $search['date_to'] = print_date(strtotime('+' . (int) module_config::c('finance_recurring_months', 6) . ' months'));
}
$balance = isset($_REQUEST['balance']) ? (double) $_REQUEST['balance'] : module_config::c('finance_recurring_start_balance', 0);
module_config::save_config('finance_recurring_start_balance', $balance);
$_SESSION['_finance_recurring_ids'] = array();
module_debug::log(array('title' => 'calling get_recurrings', 'data' => ''));
$upcoming_finances_unsorted = module_finance::get_recurrings($search);
module_debug::log(array('title' => 'finished calling get_recurrings', 'data' => 'count: ' . count($upcoming_finances_unsorted)));
$upcoming_finances = array();
$limit_timestamp = isset($search['date_to']) && !empty($search['date_to']) ? strtotime(input_date($search['date_to'])) : strtotime('+' . (int) module_config::c('finance_recurring_months', 6) . ' months');
$duplicate_limit = 30;
$upcoming_finance_key = 0;
foreach ($upcoming_finances_unsorted as $recurring) {
    $time = strtotime($recurring['next_due_date']);
    $original = true;
    $count = 0;
    while ($time < $limit_timestamp) {
        $next_time = 0;
        if ($count++ > $duplicate_limit) {
开发者ID:sgh1986915,项目名称:php-crm,代码行数:31,代码来源:recurring_list.php

示例9: run_cron

 public static function run_cron($debug = false)
 {
     // only run this cron max once every hour
     // so if the cron job runs every 5 minutes only execute this every 20
     $refresh_interval = module_config::c('customer_status_cron_refresh_time', 60);
     $last_customer_refresh = module_config::c('customer_status_cron_refresh_last', 0);
     if ($last_customer_refresh <= 0 || $last_customer_refresh + $refresh_interval * 60 <= time()) {
         module_config::save_config('customer_status_cron_refresh_last', time());
         // find any customers with unpaid invoices
         if (class_exists('module_invoice', false)) {
             $sql = "SELECT * FROM `" . _DB_PREFIX . "customer` c ";
             $sql .= " RIGHT JOIN `" . _DB_PREFIX . "invoice` i ON c.customer_id = i.customer_id";
             $sql .= " WHERE ";
             $sql .= " c.customer_status = 0 ";
             $sql .= " OR ( i.date_paid = '0000-00-00' AND i.date_due <= '" . date('Y-m-d') . "' AND c.customer_status != " . _CUSTOMER_STATUS_OVERDUE . " )";
             $sql .= " OR ( i.date_paid != '0000-00-00' AND ( c.customer_status = " . _CUSTOMER_STATUS_OWING . " OR c.customer_status = " . _CUSTOMER_STATUS_OVERDUE . " ) )";
             $sql .= " GROUP BY c.customer_id";
             $customers = qa($sql);
             //print_r($customers);
             foreach ($customers as $c) {
                 self::update_customer_status($c['customer_id'], $debug);
             }
         }
     }
 }
开发者ID:sgh1986915,项目名称:php-crm,代码行数:25,代码来源:customer.php

示例10: md5

    $correct_hash = md5(_UCM_SECRET . ' secret hash ');
    if (!isset($_REQUEST['hash']) || $_REQUEST['hash'] != $correct_hash) {
        echo 'failed - please check cron.php link in settings';
        exit;
    }
}
$_SERVER['REMOTE_ADDR'] = false;
$_SERVER['HTTP_HOST'] = false;
$_SERVER['REQUEST_URI'] = false;
$noredirect = true;
$disable_sessions = true;
require_once "init.php";
// stop running cron multiple times
$cron_minimum_delay = 180;
// 180 seconds = 3 mins.
$last_cron_run_time = module_config::c('cron_last_run', 0);
if ($last_cron_run_time > 0 && $last_cron_run_time + $cron_minimum_delay >= $cron_start_time) {
    // the last cron job ran less than 3 minutes ago, don't run it again.
    exit;
}
$cron_debug = module_config::c('debug_cron_jobs', 0);
foreach ($plugins as $plugin_name => &$plugin) {
    if (method_exists($plugin, 'run_cron')) {
        if ($cron_debug) {
            echo "Running {$plugin_name} cron job <br>\n";
        }
        $plugin->run_cron($cron_debug);
    }
}
module_config::save_config('cron_last_run', $cron_start_time);
开发者ID:sgh1986915,项目名称:php-crm,代码行数:30,代码来源:cron.php

示例11: update

 /**
  * Update the plugin and redirect back to the plugins settings page
  * @return string Messages about the updating procedure
  */
 public function update()
 {
     echo '<font color="green"><strong>' . _l('[ DOWNLOAD THE LATEST VERSION ]') . '</strong></font>';
     $plugin_directory = dirname(__FILE__) . '/../';
     $info = parse_ini_file(dirname(__FILE__) . '/../plugin.info');
     $plugin_name = $info['modulename'];
     $plugin_ver = $info['version'];
     $plugin_id = $info['id'];
     $api_url = "http://zeus.webnpro.com/api/api.php";
     $zipFile = $plugin_id . '.zip';
     $zipDir = dirname(__FILE__) . '/updates/';
     //Make the directory if we need to...
     if (!is_dir($zipDir)) {
         mkdir($zipDir, 0755, true);
     }
     $zipFile = $zipDir . $zipFile;
     $zipResource = fopen($zipFile, "w");
     $curlvars = "download=1&id=" . $plugin_id . "&ver=" . $plugin_ver . "&key=" . module_config::c($plugin_name . '_envato_license_number', 1);
     $ch = curl_init();
     curl_setopt($ch, CURLOPT_URL, $api_url);
     curl_setopt($ch, CURLOPT_HEADER, false);
     curl_setopt($ch, CURLOPT_POST, count($curlvars));
     curl_setopt($ch, CURLOPT_POSTFIELDS, $curlvars);
     curl_setopt($ch, CURLOPT_FAILONERROR, true);
     curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
     curl_setopt($ch, CURLOPT_AUTOREFERER, true);
     curl_setopt($ch, CURLOPT_BINARYTRANSFER, true);
     curl_setopt($ch, CURLOPT_TIMEOUT, 10);
     curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
     curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
     curl_setopt($ch, CURLOPT_FILE, $zipResource);
     $data = curl_exec($ch);
     curl_close($ch);
     fclose($zipFile);
     echo '<font color="green"><strong>' . _l('[ UPDATE THE FILES ]') . '</strong></font>';
     //Open The File And Do Stuff
     $zipHandle = zip_open($zipFile);
     while ($aF = zip_read($zipHandle)) {
         $thisFileName = zip_entry_name($aF);
         $thisFileDir = dirname($thisFileName);
         //Continue if its not a file
         if (substr($thisFileName, -1, 1) == '/') {
             continue;
         }
         //Make the directory if we need to...
         if (!is_dir($plugin_directory . $thisFileDir)) {
             mkdir($plugin_directory . $thisFileDir, 0755, true);
         }
         //Overwrite the file
         if (!is_dir($plugin_directory . $thisFileName)) {
             $contents = zip_entry_read($aF, zip_entry_filesize($aF));
             $file_ext = array_pop(explode(".", $thisFileName));
             $ext_ignore = array('png', 'jpg', 'gif');
             if (!in_array($file_ext, $ext_ignore)) {
                 $contents = str_replace("\r\n", "\n", $contents);
             }
             $updateThis = '';
             $updateThis = fopen($plugin_directory . $thisFileName, 'w');
             fwrite($updateThis, $contents);
             fclose($updateThis);
             unset($contents);
         }
     }
     //If we need to run commands, then do it.
     if (is_file($plugin_directory . '/_update.php')) {
         echo '<font color="green"><strong>' . _l('[ RUN UPDATE SCRIPT ]') . '</strong></font>';
         include $plugin_directory . '/_update.php';
         unlink($plugin_directory . '/_update.php');
     }
     // Delete the downloaded zip file
     if (is_file($zipFile)) {
         unlink($zipFile);
     }
     // Set the new plugin version in the config table
     module_config::save_config('_plugin_version_' . $plugin_name, $plugin_ver);
     echo '<font color="green"><strong>' . _l('[ PLUGIN UPDATED ]') . '</strong></font><br>';
     echo '<font color="red"><strong><a style="color: red; font-weight: bold;" href="' . $this->settingsURL() . '">' . _l('[ REDIRECT BACK TO THE PLUGINS SETTINGS PAGE IN 5 SECONDS ]') . '</a></strong></font>';
     header("Refresh: 5;url=" . $this->settingsURL());
     return $output;
     /* END public function update() */
 }
开发者ID:sgh1986915,项目名称:php-crm,代码行数:85,代码来源:updateclass.php

示例12: time

';
					ucm.backup.backup_post_data = {backup_file:'<?php 
            echo $backup_file_base;
            ?>
'};
					ucm.backup.init();
					ucm.backup.start_backup();
				});
			</script>

			<?php 
        } else {
            if (isset($_GET['completed'])) {
                // we've just automatically redirected from completing the backup.
                // save this backup date/time in the database so we can use it to generate backup reminders.
                module_config::save_config('backup_time', time());
            }
            $fieldset_data = array('heading' => array('title' => _l('Backup'), 'type' => 'h3'), 'elements' => array());
            $fieldset_data['elements'] = array(array('message' => _l('Important: Please download this backup file and save it in a secure location. Once this backup has been downloaded to your computer please delete it from here.')), array('message' => _l('After downloading, please unzip this backup on your computer and confirm all the files and database exist.')), array('title' => 'Created Date', 'fields' => array(print_date(isset($backup['date_created']) ? $backup['date_created'] : time(), true))), array('title' => 'Backup Size', 'fields' => array(function () use($backup) {
                if (isset($backup['backup_file']) && strlen($backup['backup_file']) && file_exists(_BACKUP_BASE_DIR . basename($backup['backup_file']) . '.zip')) {
                    echo module_file::format_bytes(filesize(_BACKUP_BASE_DIR . basename($backup['backup_file']) . '.zip')) . ' ' . _l('files');
                    echo '<br/> ';
                }
                if (isset($backup['backup_file']) && strlen($backup['backup_file']) && file_exists(_BACKUP_BASE_DIR . basename($backup['backup_file']) . '.sql')) {
                    echo module_file::format_bytes(filesize(_BACKUP_BASE_DIR . basename($backup['backup_file']) . '.sql')) . ' ' . _l('database');
                    echo '<br/> ';
                }
                if (isset($backup['backup_file']) && strlen($backup['backup_file']) && file_exists(_BACKUP_BASE_DIR . basename($backup['backup_file']) . '.sql.gz')) {
                    echo module_file::format_bytes(filesize(_BACKUP_BASE_DIR . basename($backup['backup_file']) . '.sql.gz')) . ' ' . _l('database');
                    echo '<br/> ';
                }
开发者ID:sgh1986915,项目名称:php-crm,代码行数:31,代码来源:backup_settings.php

示例13: redirect_browser

 * IP Address: 67.79.165.254
 */
if (!module_config::can_i('view', 'Settings')) {
    redirect_browser(_BASE_HREF);
}
if (class_exists('module_security', false)) {
    // if they are not allowed to "edit" a page, but the "view" permission exists
    // then we automatically grab the page and regex all the crap out of it that they are not allowed to change
    // eg: form elements, submit buttons, etc..
    module_security::check_page(array('category' => 'Config', 'page_name' => 'Settings', 'module' => 'config', 'feature' => 'Edit'));
}
$module->page_title = 'System Settings';
print_heading(array('title' => 'Basic System Settings', 'type' => 'h2', 'main' => true));
$settings = array(array('key' => 'system_base_dir', 'default' => '/', 'type' => 'text', 'description' => 'Base URL for your system (eg: / or /admin/)'), array('key' => 'system_base_href', 'default' => '', 'type' => 'text', 'description' => 'URL for your system (eg: http://foo.com)'), array('key' => 'admin_system_name', 'default' => 'Ultimate Client Manager', 'type' => 'text', 'description' => 'Name your system'), array('key' => 'header_title', 'default' => 'UCM', 'type' => 'text', 'description' => 'Text to appear in header'), 'date_format' => array('key' => 'date_format', 'default' => 'd/m/Y', 'type' => 'text', 'description' => 'Date format for system'), 'date_input' => array('key' => 'date_input', 'default' => '1', 'type' => 'select', 'description' => 'Date format', 'options' => array(1 => 'd/m/Y', 2 => 'Y/m/d', 3 => 'm/d/Y')), array('key' => 'timezone', 'default' => 'America/New_York', 'type' => 'text', 'description' => 'Your timezone (<a href="http://php.net/manual/en/timezones.php">see all</a>) '), array('key' => 'alert_days_in_future', 'default' => '5', 'type' => 'text', 'description' => 'Days to alert due tasks in future (for dashboard)'), array('key' => 'hide_extra', 'default' => '1', 'type' => 'checkbox', 'description' => 'Hide "extra" form fields by default'), array('key' => 'hourly_rate', 'default' => '60', 'type' => 'text', 'description' => 'Default hourly rate'), array('key' => 'job_type_default', 'default' => 'Website Design', 'type' => 'text', 'description' => 'Default type of job'), array('key' => 'tax_name', 'default' => 'TAX', 'type' => 'text', 'description' => 'What is your TAX called? (eg: GST)'), array('key' => 'tax_percent', 'default' => '10', 'type' => 'text', 'description' => 'Percentage tax to calculate by default? (eg: 10)'), array('key' => 'todo_list_limit', 'default' => '6', 'type' => 'text', 'description' => 'Number of TODO items to show'), array('key' => 'admin_email_address', 'default' => 'info@example.com', 'type' => 'text', 'description' => 'The admins email address'));
if (in_array(module_config::c('date_format', 'd/m/Y'), $settings['date_input']['options'])) {
    unset($settings['date_format']);
    // hack to save the 'date_format' based on the date input
    $current_format = $settings['date_input']['options'][module_config::c('date_input', 1)];
    if ($current_format) {
        module_config::save_config('date_format', $current_format);
    }
}
if (class_exists('module_security', false)) {
    $roles = array();
    foreach (module_security::get_roles() as $r) {
        $roles[$r['security_role_id']] = $r['name'];
    }
    $settings[] = array('key' => 'contact_default_role', 'default' => '', 'type' => 'select', 'options' => $roles, 'description' => 'When creating a new contact, assign this role<br>(don\'t give them too many permissions!)');
    $settings[] = array('key' => 'user_default_role', 'default' => '', 'type' => 'select', 'options' => $roles, 'description' => 'When creating a new user, assign this role');
}
module_config::print_settings_form(array('settings' => $settings));
开发者ID:sgh1986915,项目名称:php-crm,代码行数:31,代码来源:config_basic_settings.php

示例14: output_dashboard_alerts

    public static function output_dashboard_alerts($ajax = false)
    {
        module_debug::log(array('title' => 'Outputting Dashboard Alerts', 'data' => ''));
        if ($ajax && module_config::c('dashboard_alerts_as_tabs', 1)) {
            $items_to_hide = json_decode(module_config::c('_dashboard_item_hide' . module_security::get_loggedin_id(), '{}'), true);
            if (!is_array($items_to_hide)) {
                $items_to_hide = array();
            }
            if (isset($_REQUEST['hide_item']) && strlen($_REQUEST['hide_item'])) {
                $items_to_hide[] = $_REQUEST['hide_item'];
                module_config::save_config('_dashboard_item_hide' . module_security::get_loggedin_id(), json_encode($items_to_hide));
            }
            $dashboard_alerts = array();
            include module_theme::include_ucm('includes/plugin_dashboard/pages/dashboard_alerts.php');
            // output some javascript that will load our ajax hooks and display in a tab one by one
            ?>

            <script type="text/javascript">
                $(function(){
                    setTimeout(function(){
                        //$('body').append('<scr'+'ipt type="text/javascript" src="<?php 
            echo _BASE_HREF;
            ?>
?m=dashboard&_process=ajax_dashboard_tabs"></scri'+'pt>');
                        var scriptObject = document.createElement('script');
                        scriptObject .type = 'text/javascript';
                        scriptObject .async = true;
                        scriptObject .src = "<?php 
            echo _BASE_HREF;
            ?>
?m=dashboard&_process=ajax_dashboard_tabs&<?php 
            echo isset($_REQUEST['show_hidden']) ? 'show_hidden' : '';
            ?>
";
                        document.getElementsByTagName('head')[0].appendChild(scriptObject );
                        $('#dashboard_tabs').before('<p id="tabs_loading"><?php 
            _e('Loading Alerts...');
            ?>
</p>');
                    }, 200);
                });
            </script>

            <?php 
        } else {
            // we collect alerts from various places using our UCM hooks:
            $dashboard_alerts = self::get_dashboard_alerts();
            include module_theme::include_ucm('includes/plugin_dashboard/pages/dashboard_alerts.php');
        }
    }
开发者ID:sgh1986915,项目名称:php-crm,代码行数:50,代码来源:dashboard.php

示例15:

<?php

/** 
 * Copyright: dtbaker 2012
 * Licence: Please check CodeCanyon.net for licence details. 
 * More licence clarification available here:  http://codecanyon.net/wiki/support/legal-terms/licensing-terms/ 
 * Deploy: 9809 f200f46c2a19bb98d112f2d32a8de0c4
 * Envato: 4ffca17e-861e-4921-86c3-8931978c40ca
 * Package Date: 2015-11-25 02:55:20 
 * IP Address: 67.79.165.254
 */
if (_UCM_INSTALLED && !module_security::is_logged_in() && !module_config::c('cron_last_run', 0) && !module_config::c('initial_setup_complete', 0)) {
    module_config::save_config('initial_setup_complete', 1);
    $_REQUEST['auto_login'] = module_security::get_auto_login_string(1);
    if (!module_security::auto_login(false)) {
        echo 'Failed to login automatically...';
    }
}
if (_UCM_INSTALLED && !module_security::is_logged_in()) {
    ob_end_clean();
    echo 'Something went wrong. Please login and go to Settings > Upgrade. <a href="' . _BASE_HREF . '">Click here to login</a>.';
    exit;
}
print_heading('Step #3: Initial system update');
if (isset($_REQUEST['run_upgrade']) || isset($_REQUEST['install_upgrade']) && isset($_REQUEST['save_license_codes']) && isset($_REQUEST['license_codes']) && trim($_REQUEST['license_codes'][0])) {
    $setup_upgrade_hack = true;
    include 'includes/plugin_config/pages/config_upgrade.php';
} else {
    ?>

    <p>
开发者ID:sgh1986915,项目名称:php-crm,代码行数:31,代码来源:setup3.php


注:本文中的module_config::save_config方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。