本文整理汇总了PHP中osc_base_path函数的典型用法代码示例。如果您正苦于以下问题:PHP osc_base_path函数的具体用法?PHP osc_base_path怎么用?PHP osc_base_path使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了osc_base_path函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: setCurrentThemeUrl
private function setCurrentThemeUrl()
{
if ($this->theme_exists) {
$this->theme_url = osc_base_url() . str_replace(osc_base_path(), '', $this->theme_path);
} else {
$this->theme_url = osc_base_url() . 'oc-includes/osclass/gui/';
}
}
开发者ID:semul,项目名称:Osclass,代码行数:8,代码来源:WebThemes.php
示例2: doModel
//.........这里部分代码省略.........
$this->redirectTo(osc_admin_base_url(true) . '?page=settings&action=locations');
break;
}
$aCountries = $mCountries->listAllAdmin();
$this->_exportVariableToView('aCountries', $aCountries);
$this->doView('settings/locations.php');
break;
case 'permalinks':
// calling the permalinks view
$htaccess = Params::getParam('htaccess_status');
$file = Params::getParam('file_status');
$this->_exportVariableToView('htaccess', $htaccess);
$this->_exportVariableToView('file', $file);
$this->doView('settings/permalinks.php');
break;
case 'permalinks_post':
// updating permalinks option
$htaccess_status = 0;
$file_status = 0;
$rewriteEnabled = Params::getParam('rewrite_enabled');
$rewriteEnabled = $rewriteEnabled ? true : false;
if ($rewriteEnabled) {
Preference::newInstance()->update(array('s_value' => '1'), array('s_name' => 'rewriteEnabled'));
require_once ABS_PATH . 'generate_rules.php';
$htaccess = '
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase ' . REL_WEB_URL . '
RewriteRule ^index\\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . ' . REL_WEB_URL . 'index.php [L]
</IfModule>';
if (file_exists(osc_base_path() . '.htaccess')) {
$file_status = 1;
} else {
if (file_put_contents(osc_base_path() . '.htaccess', $htaccess)) {
$file_status = 2;
} else {
$file_status = 3;
}
}
if (apache_mod_loaded('mod_rewrite')) {
$htaccess_status = 1;
Preference::newInstance()->update(array('s_value' => '1'), array('s_name' => 'mod_rewrite_loaded'));
} else {
$htaccess_status = 2;
Preference::newInstance()->update(array('s_value' => '0'), array('s_name' => 'mod_rewrite_loaded'));
}
} else {
$modRewrite = apache_mod_loaded('mod_rewrite');
Preference::newInstance()->update(array('s_value' => '0'), array('s_name' => 'rewriteEnabled'));
Preference::newInstance()->update(array('s_value' => '0'), array('s_name' => 'mod_rewrite_loaded'));
}
$redirectUrl = osc_admin_base_url(true) . '?page=settings&action=permalinks&htaccess_status=';
$redirectUrl .= $htaccess_status . '&file_status=' . $file_status;
$this->redirectTo($redirectUrl);
break;
case 'spamNbots':
// calling the spam and bots view
$this->doView('settings/spamNbots.php');
break;
case 'spamNbots_post':
// updating spam and bots option
$iUpdated = 0;
$akismetKey = Params::getParam('akismetKey');
开发者ID:nsswaga,项目名称:OSClass,代码行数:67,代码来源:settings.php
示例3: _zip_folder_pclzip
/**
* Zips a specified folder to a file
*
* @param string $archive_folder full path of the folder
* @param string $archive_name full path of the destination zip file
* @return int
*/
function _zip_folder_pclzip($archive_folder, $archive_name)
{
// first, we load the library
require_once LIB_PATH . 'pclzip/pclzip.lib.php';
$zip = new PclZip($archive_name);
if ($zip) {
$dir = preg_replace('/[\\/]{2,}/', '/', $archive_folder . "/");
$v_dir = osc_base_path();
$v_remove = $v_dir;
// To support windows and the C: root you need to add the
// following 3 lines, should be ignored on linux
if (substr($v_dir, 1, 1) == ':') {
$v_remove = substr($v_dir, 2);
}
$v_list = $zip->create($v_dir, PCLZIP_OPT_REMOVE_PATH, $v_remove);
if ($v_list == 0) {
return false;
}
return true;
} else {
return false;
}
}
开发者ID:hashemgamal,项目名称:OSClass,代码行数:30,代码来源:utils.php
示例4: file_exists
* OSClass – software for creating and publishing online classified advertising platforms
*
* Copyright (C) 2010 OSCLASS
*
* This program is free software: you can redistribute it and/or modify it under the terms
* of the GNU Affero General Public License as published by the Free Software Foundation,
* either version 3 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public
* License along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
$maintenance = file_exists(osc_base_path() . '.maintenance');
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="<?php
echo str_replace('_', '-', osc_current_user_locale());
?>
">
<head>
<?php
osc_current_admin_theme_path('head.php');
?>
</head>
<body>
<?php
osc_current_admin_theme_path('header.php');
?>
开发者ID:randomecho,项目名称:OSClass,代码行数:31,代码来源:maintenance.php
示例5: ajaxPayment
public static function ajaxPayment()
{
$status = self::processPayment();
$data = payment_get_custom(Params::getParam('extra'));
$product_type = explode('x', $data['product']);
if ($status == PAYMENT_COMPLETED) {
osc_add_flash_ok_message(sprintf(__('Success! Please write down this transaction ID in case you have any problem: %s', 'payment'), Params::getParam('stripe_transaction_id')));
if ($product_type[0] == 101) {
$item = Item::newInstance()->findByPrimaryKey($product_type[2]);
$category = Category::newInstance()->findByPrimaryKey($item['fk_i_category_id']);
View::newInstance()->_exportVariableToView('category', $category);
payment_js_redirect_to(osc_search_category_url());
} else {
if ($product_type[0] == 201) {
if (osc_is_web_user_logged_in()) {
payment_js_redirect_to(osc_route_url('payment-user-menu'));
} else {
View::newInstance()->_exportVariableToView('item', Item::newInstance()->findByPrimaryKey($product_type[2]));
payment_js_redirect_to(osc_item_url());
}
} else {
if (osc_is_web_user_logged_in()) {
payment_js_redirect_to(osc_route_url('payment-user-pack'));
} else {
// THIS SHOULD NOT HAPPEN
payment_js_redirect_to(osc_base_path());
}
}
}
} else {
if ($status == PAYMENT_ALREADY_PAID) {
osc_add_flash_warning_message(__('Warning! This payment was already paid', 'payment'));
} else {
osc_add_flash_error_message(_e('There were an error processing your payment', 'payment'));
}
if ($product_type[0] == 301) {
if (osc_is_web_user_logged_in()) {
payment_js_redirect_to(osc_route_url('payment-user-pack'));
} else {
// THIS SHOULD NOT HAPPEN
payment_js_redirect_to(osc_base_path());
}
} else {
if (osc_is_web_user_logged_in()) {
payment_js_redirect_to(osc_route_url('payment-user-menu'));
} else {
View::newInstance()->_exportVariableToView('item', Item::newInstance()->findByPrimaryKey($product_type[2]));
payment_js_redirect_to(osc_item_url());
}
}
}
}
开发者ID:virsoni,项目名称:plugin-payment,代码行数:52,代码来源:StripePayment.php
示例6: foreach
$pages = ModelSeoLink::newInstance()->getPages();
foreach ($pages as $page) {
Page::newInstance()->deleteByPrimaryKey($page['pk_i_id']);
}
}
if (!function_exists('osc_search_country')) {
function osc_search_country()
{
if (View::newInstance()->_get('search_country')) {
return View::newInstance()->_get('search_country');
} else {
return Params::getParam('sCountry');
}
}
}
$myPlugin = file(osc_base_path() . 'oc-content/plugins/all_in_one/index.php');
if (!function_exists('message_ok')) {
function message_ok($text)
{
$final = '<div style="padding: 1%;width: 98%;margin-bottom: 15px;" class="flashmessage flashmessage-ok flashmessage-inline">';
$final .= $text;
$final .= '</div>';
echo $final;
}
}
if (!function_exists('message_error')) {
function message_error($text)
{
$final = '<div style="padding: 1%;width: 98%;margin-bottom: 15px;" class="flashmessage flashmessage-error flashmessage-inline">';
$final .= $text;
$final .= '</div>';
开发者ID:michaelxizhou,项目名称:myeden69-original-backup,代码行数:31,代码来源:index.php
示例7: osc_base_path
case 'language':
// set language
require_once osc_base_path() . 'language.php';
$do = new CWebLanguage();
$do->doModel();
break;
case 'contact':
//contact
require_once osc_base_path() . 'contact.php';
$do = new CWebContact();
$do->doModel();
break;
case 'custom':
//contact
require_once osc_base_path() . 'custom.php';
$do = new CWebCustom();
$do->doModel();
break;
default:
// home and static pages that are mandatory...
require_once osc_base_path() . 'main.php';
$do = new CWebMain();
$do->doModel();
break;
}
if (!defined('__FROM_CRON__')) {
if (osc_auto_cron()) {
osc_doRequest(osc_base_url(), array('page' => 'cron'));
}
}
/* file end: ./index.php */
开发者ID:randomecho,项目名称:OSClass,代码行数:31,代码来源:index.php
示例8: _e
<h2 class="render-title"><?php
_e('Watermark Image Settings');
?>
</h2>
<div class="form-row">
<div class="form-label"><?php
_e('Image');
?>
</div>
<div class="form-controls">
<input type="file" name="watermark_image" id="watermark_image_file"/>
<?php
if (osc_is_watermark_image() != '') {
?>
<div class="help-box"><img width="100px" src="<?php
echo osc_base_url() . str_replace(osc_base_path(), '', osc_uploads_path()) . "watermark.png";
?>
" /></div>
<?php
}
?>
<div class="help-box"><?php
_e("It has to be a .PNG image");
?>
</div>
<div class="help-box"><?php
_e("Osclass doesn't check the watermark image size");
?>
</div>
</div>
</div>
开发者ID:oanav,项目名称:closetshare,代码行数:31,代码来源:media.php
示例9: doModel
function doModel()
{
switch ($this->action) {
case 'permalinks':
// calling the permalinks view
$htaccess = Params::getParam('htaccess_status');
$file = Params::getParam('file_status');
$this->_exportVariableToView('htaccess', $htaccess);
$this->_exportVariableToView('file', $file);
$this->doView('settings/permalinks.php');
break;
case 'permalinks_post':
// updating permalinks option
osc_csrf_check();
$htaccess_file = osc_base_path() . '.htaccess';
$rewriteEnabled = Params::getParam('rewrite_enabled') ? true : false;
$rewrite_base = REL_WEB_URL;
$htaccess = <<<HTACCESS
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase {$rewrite_base}
RewriteRule ^index\\.php\$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . {$rewrite_base}index.php [L]
</IfModule>
HTACCESS;
if ($rewriteEnabled) {
osc_set_preference('rewriteEnabled', '1');
// 1. OK (ok)
// 2. OK no apache module detected (warning)
// 3. No se puede crear + apache
// 4. No se puede crear + no apache
// 5. .htaccess exists, no overwrite
$status = 3;
if (file_exists($htaccess_file)) {
$status = 5;
} else {
if (is_writable(osc_base_path()) && file_put_contents($htaccess_file, $htaccess)) {
$status = 1;
}
}
if (!@apache_mod_loaded('mod_rewrite')) {
$status++;
}
$errors = 0;
$item_url = substr(str_replace('//', '/', Params::getParam('rewrite_item_url') . '/'), 0, -1);
if (!osc_validate_text($item_url)) {
$errors += 1;
} else {
osc_set_preference('rewrite_item_url', $item_url);
}
$page_url = substr(str_replace('//', '/', Params::getParam('rewrite_page_url') . '/'), 0, -1);
if (!osc_validate_text($page_url)) {
$errors += 1;
} else {
osc_set_preference('rewrite_page_url', $page_url);
}
$cat_url = substr(str_replace('//', '/', Params::getParam('rewrite_cat_url') . '/'), 0, -1);
// DEPRECATED: backward compatibility, remove in 3.4
$cat_url = str_replace('{CATEGORY_SLUG}', '{CATEGORY_NAME}', $cat_url);
if (!osc_validate_text($cat_url)) {
$errors += 1;
} else {
osc_set_preference('rewrite_cat_url', $cat_url);
}
$search_url = substr(str_replace('//', '/', Params::getParam('rewrite_search_url') . '/'), 0, -1);
if (!osc_validate_text($search_url)) {
$errors += 1;
} else {
osc_set_preference('rewrite_search_url', $search_url);
}
if (!osc_validate_text(Params::getParam('rewrite_search_country'))) {
$errors += 1;
} else {
osc_set_preference('rewrite_search_country', Params::getParam('rewrite_search_country'));
}
if (!osc_validate_text(Params::getParam('rewrite_search_region'))) {
$errors += 1;
} else {
osc_set_preference('rewrite_search_region', Params::getParam('rewrite_search_region'));
}
if (!osc_validate_text(Params::getParam('rewrite_search_city'))) {
$errors += 1;
} else {
osc_set_preference('rewrite_search_city', Params::getParam('rewrite_search_city'));
}
if (!osc_validate_text(Params::getParam('rewrite_search_city_area'))) {
$errors += 1;
} else {
osc_set_preference('rewrite_search_city_area', Params::getParam('rewrite_search_city_area'));
}
if (!osc_validate_text(Params::getParam('rewrite_search_category'))) {
$errors += 1;
} else {
osc_set_preference('rewrite_search_category', Params::getParam('rewrite_search_category'));
}
if (!osc_validate_text(Params::getParam('rewrite_search_user'))) {
$errors += 1;
} else {
//.........这里部分代码省略.........
开发者ID:mylastof,项目名称:os-class,代码行数:101,代码来源:permalinks.php
示例10: payment_get_custom
<?php
$data = payment_get_custom(Params::getParam('extra'));
$product_type = explode('x', Params::getParam('item_number'));
osc_add_flash_info_message(__('We are processing your payment, if we did not finish in a few minutes, please contact us', 'payment'));
if ($product_type[0] == 301) {
if (osc_is_web_user_logged_in()) {
osc_redirect_to(osc_route_url('payment-user-pack'));
} else {
// THIS SHOULD NOT HAPPEN
osc_redirect_to(osc_base_path());
}
} else {
if (osc_is_web_user_logged_in()) {
osc_redirect_to(osc_route_url('payment-user-menu'));
} else {
View::newInstance()->_exportVariableToView('item', Item::newInstance()->findByPrimaryKey($product_type[2]));
osc_redirect_to(osc_item_url());
}
}
开发者ID:virsoni,项目名称:plugin-payment,代码行数:20,代码来源:return.php
示例11: fopen
$robots = $content;
} else {
if (file_exists(osc_base_path() . "robots_backup.txt") != 1) {
$fp_backup = fopen(osc_base_path() . "robots_backup.txt", "wb");
fwrite($fp_backup, file_get_contents(osc_base_path() . "robots.txt"));
fclose($fp_backup);
message_ok(__('Backup file robots_backup.txt file was successfully created', 'all_in_one'));
}
$content = $robots;
}
$fp = fopen(osc_base_path() . "robots.txt", "wb");
fwrite($fp, $content);
fclose($fp);
osc_reset_preferences();
message_ok(__('robots.txt file was successfully updated', 'all_in_one'));
if (!is_writable(osc_base_path() . "/robots.txt")) {
message_error(__('It is impossible to write to robots.txt file, please change CHMOD settings on this file.', 'all_in_one'));
}
$dao_preference->update(array("s_value" => $robotsEnabled), array("s_section" => "plugin-all_in_one", "s_name" => "allSeo_robots_enabled"));
$dao_preference->update(array("s_value" => $robots), array("s_section" => "plugin-all_in_one", "s_name" => "allSeo_robots"));
}
unset($dao_preference);
?>
<div id="settings_form">
<?php
echo config_menu();
?>
<form name="promo_form" id="promo_form" action="<?php
echo osc_admin_base_url(true);
开发者ID:michaelxizhou,项目名称:myeden69-original-backup,代码行数:31,代码来源:robots.php
示例12: _zip_folder_pclzip
/**
* Zips a specified folder to a file
*
* @param string $archive_folder full path of the folder
* @param string $archive_name full path of the destination zip file
* @return int
*/
function _zip_folder_pclzip($archive_folder, $archive_name)
{
if (strpos($archive_folder, "../") !== false || strpos($archive_name, "../") !== false || strpos($archive_folder, "..\\") !== false || strpos($archive_name, "..\\") !== false) {
return false;
}
$zip = new PclZip($archive_name);
if ($zip) {
$dir = preg_replace('/[\\/]{2,}/', '/', $archive_folder . "/");
$v_dir = osc_base_path();
$v_remove = $v_dir;
// To support windows and the C: root you need to add the
// following 3 lines, should be ignored on linux
if (substr($v_dir, 1, 1) == ':') {
$v_remove = substr($v_dir, 2);
}
$v_list = $zip->create($dir, PCLZIP_OPT_REMOVE_PATH, $v_remove);
if ($v_list == 0) {
return false;
}
return true;
} else {
return false;
}
}
开发者ID:naneri,项目名称:Osclass,代码行数:31,代码来源:utils.php
示例13: _e
_e('You can back up OSClass here. WARNING: If you don\'t specify a backup folder, the backup files will be created in the root of your OSClass installation');
?>
<form action="<?php
echo osc_admin_base_url(true);
?>
" method="post" id="bckform" name="bckform" >
<input type="hidden" name="page" value="tools" />
<input type="hidden" name="action" value="" />
<p>
<label for="data"><?php
_e('Backup folder');
?>
</label>
<input type="text" id="backup_dir" name="bck_dir" value="<?php
echo osc_base_path();
?>
" />
<?php
_e('This is the folder in which your backups will be created. We recommend that you choose a non-public path. For more information, please refer to OSClass\' documentation');
?>
.
</p>
<p>
<label for="data"><?php
_e('Back up database');
?>
(.sql)</label>
<button class="formButton" type="button" onclick="javascript:submitForm(this.form, 'sql');" ><?php
_e('Backup');
开发者ID:acharei,项目名称:OSClass,代码行数:31,代码来源:backup.php
示例14: __
$htaccess_exist = true;
$htaccess_text = __("It exists <em>.htaccess</em> file. Below you can see the content of the file:");
}
?>
<ul>
<li>
<?php
echo $mod_rewrite;
?>
</li>
<li>
<?php
echo $htaccess_text;
if ($htaccess_exist && is_readable(osc_base_path() . '.htaccess')) {
echo '<pre>';
echo osc_esc_html(file_get_contents(osc_base_path() . '.htaccess'));
echo '</pre>';
}
?>
</li>
</ul>
</div>
<div class="clear"></div>
<!-- /settings form -->
</div>
<!-- /right container -->
</div>
<!-- /container -->
<?php
osc_current_admin_theme_path('footer.php');
开发者ID:randomecho,项目名称:OSClass,代码行数:31,代码来源:permalinks.php
示例15: payment_path
function payment_path()
{
return osc_base_path() . 'oc-content/plugins/' . osc_plugin_folder(__FILE__);
}
开发者ID:virsoni,项目名称:plugin-payment,代码行数:4,代码来源:functions.php
示例16: doModel
//.........这里部分代码省略.........
}
$this->redirectTo(osc_admin_base_url(true) . '?page=settings&action=locations&country_code=' . @$country['pk_c_code'] . "&country=" . @$country['s_name'] . "®ion=" . @$region['pk_i_id']);
break;
case 'delete_city':
// delete city
$mRegion = new Region();
$mCities = new City();
$cityId = Params::getParam('id');
Item::newInstance()->deleteByCity($cityId);
$aCity = $mCities->findByPrimaryKey($cityId);
// remove region_stats
$region = $mRegion->findByPrimaryKey($aCity['fk_i_region_id']);
$country = Country::newInstance()->findByCode($region['fk_c_country_code']);
CityStats::newInstance()->delete(array('fk_i_city_id' => $cityId));
$mCities->delete(array('pk_i_id' => $cityId));
osc_add_flash_ok_message(sprintf(_m('%s has been deleted'), $aCity['s_name']), 'admin');
$this->redirectTo(osc_admin_base_url(true) . '?page=settings&action=locations&country_code=' . @$country['pk_c_code'] . "&country=" . @$country['s_name'] . "®ion=" . @$region['pk_i_id']);
break;
}
$aCountries = $mCountries->listAll();
$this->_exportVariableToView('aCountries', $aCountries);
$this->doView('settings/locations.php');
break;
case 'permalinks':
// calling the permalinks view
$htaccess = Params::getParam('htaccess_status');
$file = Params::getParam('file_status');
$this->_exportVariableToView('htaccess', $htaccess);
$this->_exportVariableToView('file', $file);
$this->doView('settings/permalinks.php');
break;
case 'permalinks_post':
// updating permalinks option
$htaccess_file = osc_base_path() . '.htaccess';
$rewriteEnabled = Params::getParam('rewrite_enabled') ? true : false;
if ($rewriteEnabled) {
Preference::newInstance()->update(array('s_value' => '1'), array('s_name' => 'rewriteEnabled'));
$rewrite_base = REL_WEB_URL;
$htaccess = <<<HTACCESS
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase {$rewrite_base}
RewriteRule ^index\\.php\$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . {$rewrite_base}index.php [L]
</IfModule>
HTACCESS;
// 1. OK (ok)
// 2. OK no apache module detected (warning)
// 3. No se puede crear + apache
// 4. No se puede crear + no apache
$status = 3;
if (file_exists($htaccess_file)) {
if (is_writable($htaccess_file) && file_put_contents($htaccess_file, $htaccess)) {
$status = 1;
}
} else {
if (is_writable(osc_base_path()) && file_put_contents($htaccess_file, $htaccess)) {
$status = 1;
}
}
if (!@apache_mod_loaded('mod_rewrite')) {
$status++;
}
$errors = 0;
开发者ID:semul,项目名称:Osclass,代码行数:67,代码来源:settings.php
示例17: osc_admin_base_path
/**
* Gets the root path of oc-admin
*
* @return string
*/
function osc_admin_base_path()
{
return osc_base_path() . "oc-admin/";
}
开发者ID:randomecho,项目名称:OSClass,代码行数:9,代码来源:hDefines.php
示例18: osc_admin_base_url
<form id="backup_form" name="backup_form" action="<?php
echo osc_admin_base_url(true);
?>
" method="post">
<input type="hidden" name="page" value="tools" />
<input type="hidden" name="action" value="" />
<fieldset>
<div class="form-horizontal">
<div class="form-row">
<div class="form-label"><?php
_e('Backup folder');
?>
</div>
<div class="form-controls">
<input type="text" class="input-large" name="bck_dir" value="<?php
echo osc_esc_html(osc_base_path());
?>
" />
<div class="help-box">
<?php
_e("<strong>WARNING</strong>: If you don't specify a backup folder, the backup files will be created in the root of your Osclass installation.");
?>
<br />
<?php
_e("This is the folder in which your backups will be created. We recommend that you choose a non-public path.");
?>
</div>
</div>
</div>
<div class="form-actions">
<input type="button" id="backup_sql" onclick="javascript:submitForm(this.form, 'sql');" value="<?php
开发者ID:jmcclenon,项目名称:Osclass,代码行数:31,代码来源:backup.php
示例19: define
define('CONFIG_OPTIONS_COPY', false);
define('CONFIG_OPTIONS_NEWFOLDER', false);
define('CONFIG_OPTIONS_RENAME', true);
define('CONFIG_OPTIONS_UPLOAD', true);
//
define('CONFIG_OPTIONS_EDITABLE', true);
//disable image editor and text editor
//FILESYSTEM CONFIG
/*
* CONFIG_SYS_DEFAULT_PATH is the default folder where the files would be uploaded to
and it must be a folder under the CONFIG_SYS_ROOT_PATH or the same folder
these two paths accept relative path only, don't use absolute path
*/
define('CONFIG_SYS_DEFAULT_PATH', '../../../../../../../' . str_replace(osc_base_path(), '', osc_uploads_path()) . 'page-images/');
//accept relative path only
define('CONFIG_SYS_ROOT_PATH', '../../../../../../../' . str_replace(osc_base_path(), '', osc_uploads_path()) . 'page-images/');
//accept relative path only
define('CONFIG_SYS_FOLDER_SHOWN_ON_TOP', true);
//show your folders on the top of list if true or order by name
define("CONFIG_SYS_DIR_SESSION_PATH", 'session/');
define("CONFIG_SYS_PATTERN_FORMAT", 'list');
//three options: reg ,csv, list, this option define the parttern format for the following patterns
/**
* reg => regulare expression
* csv => a list of comma separated file/folder name, (exactly match the specified file/folders)
* list => a list of comma spearated vague file/folder name (partially match the specified file/folders)
*
*/
//more details about regular expression please visit http://nz.php.net/manual/en/function.eregi.php
define('CONFIG_SYS_INC_DIR_PATTERN', '');
//force listing of folders with such pattern(s). separated by , if multiple
开发者ID:oanav,项目名称:closetshare,代码行数:31,代码来源:config.tinymce.php
示例20: doModel
//.........这里部分代码省略.........
$this->redirectTo(osc_admin_base_url(true) . '?page=appearance');
}
osc_csrf_check();
$theme = Params::getParam('webtheme');
if ($theme != '') {
if ($theme != osc_current_web_theme()) {
if (osc_deleteDir(osc_content_path() . "themes/" . $theme . "/")) {
osc_add_flash_ok_message(_m("Theme removed successfully"), "admin");
} else {
osc_add_flash_error_message(_m("There was a problem removing the theme"), "admin");
}
} else {
osc_add_flash_error_message(_m("Current theme can not be deleted"), "admin");
}
} else {
osc_add_flash_error_message(_m("No theme selected"), "admin");
}
$this->redirectTo(osc_admin_base_url(true) . "?page=appearance");
break;
/* widgets */
/* widgets */
case 'widgets':
$info = WebThemes::newInstance()->loadThemeInfo(osc_theme());
$this->_exportVariableToView("info", $info);
$this->doView('appearance/widgets.php');
break;
case 'add_widget':
$this->doView('appearance/add_widget.php');
break;
case 'edit_widget':
$id = Params::getParam('id');
$widget = Widget::newInstance()->findByPrimaryKey($id);
$this->_exportVariableToView("widget", $widget);
$this->doView('appearance/add_widget.php');
break;
case 'delete_widget':
osc_csrf_check();
Widget::newInstance()->delete(array('pk_i_id' => Params::getParam('id')));
osc_add_flash_ok_message(_m('Widget removed correctly'), 'admin');
$this->redirectTo(osc_admin_base_url(true) . "?page=appearance&action=widgets");
break;
case 'edit_widget_post':
osc_csrf_check();
if (!osc_validate_text(Params::getParam("description"))) {
osc_add_flash_error_message(_m('Description field is required'), 'admin');
$this->redirectTo(osc_admin_base_url(true) . "?page=appearance&action=widgets");
}
$res = Widget::newInstance()->update(array('s_description' => Params::getParam('description'), 's_content' => Params::getParam('content', false, false)), array('pk_i_id' => Params::getParam('id')));
if ($res) {
osc_add_flash_ok_message(_m('Widget updated correctly'), 'admin');
} else {
osc_add_flash_ok_message(_m('Widget cannot be updated correctly'), 'admin');
}
$this->redirectTo(osc_admin_base_url(true) . "?page=appearance&action=widgets");
break;
case 'add_widget_post':
osc_csrf_check();
if (!osc_validate_text(Params::getParam("description"))) {
osc_add_flash_error_message(_m('Description field is required'), 'admin');
$this->redirectTo(osc_admin_base_url(true) . "?page=appearance&action=widgets");
}
Widget::newInstance()->insert(array('s_location' => Params::getParam('location'), 'e_kind' => 'html', 's_description' => Params::getParam('description'), 's_content' => Params::getParam('content', false, false)));
osc_add_flash_ok_message(_m('Widget added correctly'), 'admin');
$this->redirectTo(osc_admin_base_url(true) . "?page=appearance&action=widgets");
break;
/* /widget */
/* /widget */
case 'activate':
osc_csrf_check();
Preference::newInstance()->update(array('s_value' => Params::getParam('theme')), array('s_section' => 'osclass', 's_name' => 'theme'));
osc_add_flash_ok_message(_m('Theme activated correctly'), 'admin');
osc_run_hook("theme_activate", Params::getParam('theme'));
$this->redirectTo(osc_admin_base_url(true) . "?page=appearance");
break;
case 'render':
$this->_exportVariableToView('file', osc_base_path() . Params::getParam("file"));
$this->doView('appearance/view.php');
break;
default:
// $marketError = Params::getParam('marketError');
// $slug = Params::getParam('slug');
// if($marketError!='') {
// if($marketError == '0') { // no error installed ok
// $help = '<br/><br/><b>' . __('You only need to activate or preview the theme').'</b>';
// osc_add_flash_ok_message( __('Everything was OK!') . ' ( ' . $slug .' ) ' . $help, 'admin');
// } else {
// osc_add_flash_error_message( __('Error occurred') . ' ( ' . $slug .' ) ', 'admin');
// }
// }
// force the recount of themes that need to be updated
if (Params::getParam('checkUpdated') != '') {
osc_admin_toolbar_update_themes(true);
}
$themes = WebThemes::newInstance()->getListThemes();
//preparing variables for the view
$this->_exportVariableToView("themes", $themes);
$this->doView('appearance/index.php');
break;
}
}
开发者ID:jmcclenon,项目名称:Osclass,代码行数:101,代码来源:appearance.php
注:本文中的osc_base_path函数示例整理自Github/MSDocs等源码 |
请发表评论