Skip to content

Commit

Permalink
Update include statements
Browse files Browse the repository at this point in the history
  • Loading branch information
cheesypoof committed Aug 15, 2016
1 parent 255855c commit 485528c
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 25 deletions.
9 changes: 4 additions & 5 deletions couch/addons/cart/cart.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
*/

if ( !defined('K_COUCH_DIR') ) die(); // cannot be loaded directly
require_once( K_COUCH_DIR.'addons/cart/session.php' );

define( 'PP_CART_VERSION', '1.0' );
define( 'PP_ACTION_UNDEFINED', 0 );
Expand Down Expand Up @@ -118,8 +117,8 @@ function KCart(){
function populate_config(){

$pp = array();
if( file_exists(K_COUCH_DIR.'addons/cart/config.php') ){
require_once( K_COUCH_DIR.'addons/cart/config.php' );
if( file_exists(K_ADDONS_DIR.'cart/config.php') ){
require_once( K_ADDONS_DIR.'cart/config.php' );
}
$this->config = array_map( "trim", $pp );
unset( $pp );
Expand Down Expand Up @@ -1149,8 +1148,8 @@ function gateway_handler( $params, $node ){

} // end class

if( file_exists(K_COUCH_DIR.'addons/cart/cart_ex.php') ){
require_once( K_COUCH_DIR.'addons/cart/cart_ex.php' );
if( file_exists(K_ADDONS_DIR.'cart/cart_ex.php') ){
require_once( K_ADDONS_DIR.'cart/cart_ex.php' );
$CART = new KCartEx();
}
else{
Expand Down
8 changes: 4 additions & 4 deletions couch/addons/data-bound-form/data-bound-form.php
Original file line number Diff line number Diff line change
Expand Up @@ -627,7 +627,7 @@ function check_nonce( $params, $node ){
$FUNCS->register_tag( 'validate_nonce', array('KDataBoundForm', 'validate_nonce') );
$FUNCS->register_tag( 'check_nonce', array('KDataBoundForm', 'check_nonce') );

require_once( K_COUCH_DIR.'addons/data-bound-form/securefile.php' );
require_once( K_COUCH_DIR.'addons/data-bound-form/throttle.php' );
require_once( K_COUCH_DIR.'addons/data-bound-form/datetime.php' );
require_once( K_COUCH_DIR.'addons/data-bound-form/checkspam.php' );
require_once( K_ADDONS_DIR.'data-bound-form/securefile.php' );
require_once( K_ADDONS_DIR.'data-bound-form/throttle.php' );
require_once( K_ADDONS_DIR.'data-bound-form/datetime.php' );
require_once( K_ADDONS_DIR.'data-bound-form/checkspam.php' );
4 changes: 2 additions & 2 deletions couch/addons/extended/extended-users.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ function KExtendedUsers(){
function populate_config(){

$t = array();
if( file_exists(K_COUCH_DIR.'addons/extended/config.php') ){
require_once( K_COUCH_DIR.'addons/extended/config.php' );
if( file_exists(K_ADDONS_DIR.'extended/config.php') ){
require_once( K_ADDONS_DIR.'extended/config.php' );
}
else{/*
die(
Expand Down
6 changes: 3 additions & 3 deletions couch/addons/inline/inline.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ function load_edit_handler( $params, $node ){
<link rel="stylesheet" href="<?php echo $css_link; ?>" />
<?php
if( !$skip_ckeditor ){
require_once( K_COUCH_DIR.'addons/inline/theme/scripts.php' );
require_once( K_ADDONS_DIR.'inline/theme/scripts.php' );
}
else{
$CTX->set( 'k_disable_inline_edit', '1', 'global' );
Expand Down Expand Up @@ -219,7 +219,7 @@ static function register_admin_routes(){
$route = array(
'name'=>'edit',
'path'=>'edit',
'include_file'=>K_COUCH_DIR.'addons/inline/inline_ex.php',
'include_file'=>K_ADDONS_DIR.'inline/inline_ex.php',
'class'=> 'InlineEx',
'action'=>'edit_action',
'module'=>'inline', /* owner module of this route */
Expand All @@ -232,7 +232,7 @@ static function register_admin_routes(){
static function register_renderables(){
global $FUNCS;

$FUNCS->register_render( 'inline_content_form', array('template_path'=>K_COUCH_DIR.'addons/inline/theme/') );
$FUNCS->register_render( 'inline_content_form', array('template_path'=>K_ADDONS_DIR.'inline/theme/') );
}

} // end class
Expand Down
4 changes: 1 addition & 3 deletions couch/addons/kfunctions.example.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
<?php
if ( !defined('K_COUCH_DIR') ) die(); // cannot be loaded directly

//require_once( K_COUCH_DIR.'addons/cart/session.php' );
//require_once( K_COUCH_DIR.'addons/cart/cart.php' ); // automatically includes session
//require_once( K_COUCH_DIR.'addons/data-bound-form/data-bound-form.php' );
//require_once( K_COUCH_DIR.'addons/cart/cart.php' );
//require_once( K_COUCH_DIR.'addons/inline/inline.php' );
//require_once( K_COUCH_DIR.'addons/extended/extended-folders.php' );
//require_once( K_COUCH_DIR.'addons/extended/extended-comments.php' );
Expand Down
2 changes: 1 addition & 1 deletion couch/addons/repeatable/repeatable.php
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,7 @@ function get_search_data(){
static function register_renderables(){
global $FUNCS;

$FUNCS->register_render( 'repeatable_column_deleted', array('template_path'=>K_COUCH_DIR.'addons/repeatable/theme/', 'template_ctx_setter'=>array('Repeatable', '_render_repeatable_column_deleted')) );
$FUNCS->register_render( 'repeatable_column_deleted', array('template_path'=>K_ADDONS_DIR.'repeatable/theme/', 'template_ctx_setter'=>array('Repeatable', '_render_repeatable_column_deleted')) );
}

static function _render_repeatable_column_deleted( $arr_deleted_html ){
Expand Down
14 changes: 7 additions & 7 deletions couch/header.php
Original file line number Diff line number Diff line change
Expand Up @@ -359,11 +359,11 @@

// addons to 1.3
define( 'K_ADDONS_DIR', K_COUCH_DIR . 'addons/' );
require_once( K_COUCH_DIR . 'addons/nicedit/nicedit.php' );
require_once( K_COUCH_DIR . 'addons/repeatable/repeatable.php' );
require_once( K_COUCH_DIR . 'addons/relation/relation.php' );
require_once( K_COUCH_DIR . 'addons/cart/session.php' );
require_once( K_COUCH_DIR . 'addons/data-bound-form/data-bound-form.php' );
require_once( K_ADDONS_DIR . 'nicedit/nicedit.php' );
require_once( K_ADDONS_DIR . 'repeatable/repeatable.php' );
require_once( K_ADDONS_DIR . 'relation/relation.php' );
require_once( K_ADDONS_DIR . 'cart/session.php' );
require_once( K_ADDONS_DIR . 'data-bound-form/data-bound-form.php' );

// Current user's authentication info
$AUTH = new KAuth( );
Expand All @@ -388,8 +388,8 @@
if( !defined('K_THEME_URL') ) define( 'K_THEME_URL', '' );

// include custom functions/addons if any
if( file_exists(K_COUCH_DIR . 'addons/kfunctions.php') ){
include_once( K_COUCH_DIR.'addons/kfunctions.php' );
if( file_exists(K_ADDONS_DIR . 'kfunctions.php') ){
include_once( K_ADDONS_DIR . 'kfunctions.php' );
}
if( file_exists(K_SITE_DIR . 'kfunctions.php') ){
include_once( K_SITE_DIR . 'kfunctions.php' );
Expand Down

0 comments on commit 485528c

Please sign in to comment.