Permalink
Browse files

FIX: coflict after merge

  • Loading branch information...
2 parents d6677f5 + d80c232 commit 4f8bea71ff0cbc0b1b9271d48473b2cbe16a200e @cheh cheh committed Dec 27, 2016
Showing with 34 additions and 29 deletions.
  1. +2 −2 cherry-core.php
  2. +1 −1 config.json
  3. +31 −26 modules/cherry-interface-builder/cherry-interface-builder.php
View
@@ -1,7 +1,7 @@
<?php
/**
* Class Cherry Core
- * Version: 1.3.2
+ * Version: 1.4.0
*
* @package Cherry_Framework
* @subpackage Class
@@ -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';
View
@@ -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",
@@ -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' => '',
@@ -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 ) {
@@ -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 );
}
/**
@@ -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 ) {

0 comments on commit 4f8bea7

Please sign in to comment.