Skip to content

Commit

Permalink
FIX: coflict after merge
Browse files Browse the repository at this point in the history
  • Loading branch information
cheh committed Dec 27, 2016
2 parents d6677f5 + d80c232 commit 4f8bea7
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 29 deletions.
4 changes: 2 additions & 2 deletions cherry-core.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/**
* Class Cherry Core
* Version: 1.3.2
* Version: 1.4.0
*
* @package Cherry_Framework
* @subpackage Class
Expand Down Expand Up @@ -171,7 +171,7 @@ public static function load_all_modules() {
/**
* Load the framework textdomain.
*
* @since 1.3.2
* @since 1.4.0
*/
public function load_textdomain() {
$mo_file_path = dirname( __FILE__ ) . '/languages/' . get_locale() . '.mo';
Expand Down
2 changes: 1 addition & 1 deletion config.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name" : "Cherry Framework",
"version" : "1.3.2",
"version" : "1.4.0",
"description" : "",
"doc_link" : "https://github.com/CherryFramework/cherry-framework-docs",
"git_link" : "https://github.com/CherryFramework/cherry-framework",
Expand Down
57 changes: 31 additions & 26 deletions modules/cherry-interface-builder/cherry-interface-builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,20 +38,20 @@ class Cherry_Interface_Builder {
* @var array
*/
private $args = array(
'views' => array(
'section' => 'inc/views/section.php',
'component-tab-vertical' => 'inc/views/component-tab-vertical.php',
'component-tab-horizontal' => 'inc/views/component-tab-horizontal.php',
'component-toggle' => 'inc/views/component-toggle.php',
'component-accordion' => 'inc/views/component-accordion.php',
'component-repeater' => 'inc/views/component-repeater.php',
'settings' => 'inc/views/settings.php',
'control' => 'inc/views/control.php',
'settings-children-title' => 'inc/views/settings-children-title.php',
'tab-children-title' => 'inc/views/tab-children-title.php',
'toggle-children-title' => 'inc/views/toggle-children-title.php',
'form' => 'inc/views/form.php',
'html' => 'inc/views/html.php',
'views' => array(
'section' => 'inc/views/section.php',
'component-tab-vertical' => 'inc/views/component-tab-vertical.php',
'component-tab-horizontal' => 'inc/views/component-tab-horizontal.php',
'component-toggle' => 'inc/views/component-toggle.php',
'component-accordion' => 'inc/views/component-accordion.php',
'component-repeater' => 'inc/views/component-repeater.php',
'settings' => 'inc/views/settings.php',
'control' => 'inc/views/control.php',
'settings-children-title' => 'inc/views/settings-children-title.php',
'tab-children-title' => 'inc/views/tab-children-title.php',
'toggle-children-title' => 'inc/views/toggle-children-title.php',
'form' => 'inc/views/form.php',
'html' => 'inc/views/html.php',
),
'views_args' => array(
'parent' => '',
Expand Down Expand Up @@ -193,13 +193,15 @@ public function register_html( array $args = array() ) {
* @return void
*/
protected function add_new_element( array $args = array(), $type = 'section' ) {

if ( ! isset( $args[0] ) && ! is_array( current( $args ) ) ) {

if ( 'control' !== $type && 'component' !== $type ) {
$args['type'] = $type;
}

$this->structure[ $args['id'] ] = $args;

} else {
foreach ( $args as $key => $value ) {

Expand Down Expand Up @@ -271,16 +273,17 @@ public function reset_structure() {
*/
protected function get_view( $type = 'control', array $args = array() ) {

if ( empty( $view ) ) {
$path = dirname( __FILE__ ) . '/';
$path .= ( array_key_exists( $type, $this->args['views'] ) ) ? $this->args['views'][ $type ] : $this->args['views']['control'] ;
if ( empty( $args['view'] ) ) {
$path = ( array_key_exists( $type, $this->args['views'] ) ) ? $this->args['views'][ $type ] : $this->args['views']['control'];

$path = is_array( $path ) ? $path[0] : $path;
$path = file_exists( $path ) ? $path : trailingslashit( dirname( __FILE__ ) ) . $path;

} else {
$path = $view;
$path = $args['view'];
}

$view = Cherry_Toolkit::render_view( $path, $args );

return $view;
return Cherry_Toolkit::render_view( $path, $args );
}

/**
Expand Down Expand Up @@ -322,24 +325,26 @@ public function render( $echo = true, array $args = array() ) {
*/
protected function build( array $args = array() ) {
$output = '';
$views = $this->args['views'];
$views = $this->args['views'];

foreach ( $args as $key => $value ) {
$value = wp_parse_args(
$value,
$this->args['views_args']
);

$value['class'] = isset( $value['class'] ) ? $value['class'] . ' ' : '' ;
$value['class'] .= $value['id'] . ' ' ;
$value['class'] = isset( $value['class'] ) ? $value['class'] . ' ' : '';
$value['class'] .= $value['id'] . ' ';

if ( $value['scroll'] ) {
$value['class'] .= 'cherry-scroll ';
}

if ( $value['master'] ) {
$value['class'] .= $value['master'] . ' ' ;
$value['class'] .= $value['master'] . ' ';
}

$type = array_key_exists( $value['type'], $views ) ? $value['type'] : 'field' ;
$type = array_key_exists( $value['type'], $views ) ? $value['type'] : 'field';
$has_child = isset( $value['children'] ) && is_array( $value['children'] ) && ! empty( $value['children'] );

switch ( $type ) {
Expand Down

0 comments on commit 4f8bea7

Please sign in to comment.