function onInitNextendLibrary() { nextendimport('nextend.data.data'); $this->_data = new NextendData(); $config = $this->params->toArray(); if (!isset($config['config'])) { $config['config'] = array(); } $this->_data->loadArray(version_compare(JVERSION, '1.6.0', 'l') ? $config : $config['config']); $cachetime = $this->_data->get('cachetime', 900); if ($cachetime != 0) { setNextend('cachetime', $cachetime); } $cachepath = '/' . trim($this->_data->get('cachepath', '/media/nextend/cache/'), '/') . '/'; if ($cachepath != '') { $cachepath = rtrim(JPATH_SITE, DIRECTORY_SEPARATOR) . str_replace('/', DIRECTORY_SEPARATOR, $cachepath); setNextend('cachepath', $cachepath); } setNextend('gzip', $this->_data->get('gzip', 0)); setNextend('debuglng', $this->_data->get('debuglng', 0)); if (isset($_GET['nextendclearcache'])) { $app = JFactory::getApplication(); if ($app->isAdmin()) { nextendimport('nextend.uri.uri'); nextendimport('nextend.filesystem.filesystem'); nextendimport('nextend.cache.cache'); $cache = new NextendCache(); $cache->deleteCacheFolder(); } } }
<?php $nextend_config = $data = get_option('nextend_config'); if (is_array($nextend_config)) { setNextend('cachepath', rtrim(getNextend('cachepath', 'cache/'), '/\\') . '/'); foreach ($nextend_config as $k => $v) { setNextend($k, $v); } } add_action('admin_menu', 'nextend_settings_add_page'); function nextend_settings_add_page() { add_submenu_page('options-general.php', 'Nextend Settings', 'Nextend Settings', 'manage_options', 'nextend_settings_page', 'nextend_settings_page'); } function nextend_settings_page() { ?> <div> <h2>Nextend Global Settings</h2> <?php if (isset($_POST['nextend'])) { update_option('nextend_config', $_POST['nextend']); } ?> <div id="nextend_configuration" class="postbox" style="margin: 0 20px 0 0;"> <form method="post" id="nextend-settings" action="<?php echo admin_url("options-general.php?page=nextend_settings_page"); ?> "> <?php $configurationXmlFile = NEXTENDLIBRARY . 'wordpress/configuration.xml';