Import legacy nurinda.co.id website
This commit is contained in:
1 parent
3f59bb9038
commit
6e21646ac4
13389 files changed
+3246690
No files matched your search
+167
@@ -0,0 +1,167 @@
|
||||
<?php
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
die( '-1' );
|
||||
}
|
||||
|
||||
require_once vc_path_dir( 'EDITORS_DIR', 'navbar/class-vc-navbar.php' );
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class Vc_Navbar_Frontend extends Vc_Navbar {
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
protected $controls = array(
|
||||
'add_element',
|
||||
'templates',
|
||||
'view_post',
|
||||
'save_update',
|
||||
'screen_size',
|
||||
//'guides_switch', // disabled in 4.9
|
||||
'custom_css',
|
||||
);
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $controls_filter_name = 'vc_nav_front_controls';
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $brand_url = 'https://wpbakery.com/?utm_campaign=VCplugin&utm_source=vc_user&utm_medium=frontend_editor';
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $css_class = 'vc_navbar vc_navgar-frontend';
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getControlGuidesSwitch() {
|
||||
return '<li class="vc_pull-right">'
|
||||
. '<button id="vc_guides-toggle-button" class="vc_btn vc_btn-primary vc_btn-sm vc_navbar-btn"'
|
||||
. ' title="' . __( "Toggle editor's guides", 'js_composer' ) . '">'
|
||||
. __( 'Guides ON', 'js_composer' )
|
||||
. '</button>'
|
||||
. '</li>';
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getControlScreenSize() {
|
||||
$disable_responsive = vc_settings()->get( 'not_responsive_css' );
|
||||
if ( '1' !== $disable_responsive ) {
|
||||
$screen_sizes = array(
|
||||
array(
|
||||
'title' => __( 'Desktop', 'js_composer' ),
|
||||
'size' => '100%',
|
||||
'key' => 'default',
|
||||
'active' => true,
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Tablet landscape mode', 'js_composer' ),
|
||||
'size' => '1024px',
|
||||
'key' => 'landscape-tablets',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Tablet portrait mode', 'js_composer' ),
|
||||
'size' => '768px',
|
||||
'key' => 'portrait-tablets',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Smartphone landscape mode', 'js_composer' ),
|
||||
'size' => '480px',
|
||||
'key' => 'landscape-smartphones',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Smartphone portrait mode', 'js_composer' ),
|
||||
'size' => '320px',
|
||||
'key' => 'portrait-smartphones',
|
||||
),
|
||||
);
|
||||
$output = '<li class="vc_pull-right">'
|
||||
. '<div class="vc_dropdown" id="vc_screen-size-control">'
|
||||
. '<a href="#" class="vc_dropdown-toggle"'
|
||||
. ' title="' . __( 'Responsive preview', 'js_composer' ) . '"><i class="vc-composer-icon vc_current-layout-icon vc-c-icon-layout_default"'
|
||||
. ' id="vc_screen-size-current"></i><i class="vc-composer-icon vc-c-icon-arrow_drop_down"></i></a>'
|
||||
. '<ul class="vc_dropdown-list">';
|
||||
while ( $screen = current( $screen_sizes ) ) {
|
||||
$output .= '<li><a href="#" title="' . esc_attr( $screen['title'] ) . '"'
|
||||
. ' class="vc_screen-width vc-composer-icon vc-c-icon-layout_' . $screen['key']
|
||||
. ( isset( $screen['active'] ) && $screen['active'] ? ' active' : '' )
|
||||
. '" data-size="' . $screen['size'] . '"></a></li>';
|
||||
next( $screen_sizes );
|
||||
}
|
||||
$output .= '</ul></div></li>';
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
return '';
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getControlSaveUpdate() {
|
||||
$post = $this->post();
|
||||
$post_type = get_post_type_object( $this->post->post_type );
|
||||
$can_publish = current_user_can( $post_type->cap->publish_posts );
|
||||
ob_start();
|
||||
?>
|
||||
<li class="vc_show-mobile vc_pull-right">
|
||||
<button data-url="<?php esc_attr_e( get_edit_post_link( $post->ID ) . '&wpb_vc_js_status=true&classic-editor' ) ?>"
|
||||
class="vc_btn vc_btn-default vc_btn-sm vc_navbar-btn vc_btn-backend-editor" id="vc_button-cancel"
|
||||
title="<?php _e( 'Cancel all changes and return to WP dashboard', 'js_composer' ) ?>"><?php echo vc_user_access()
|
||||
->part( 'backend_editor' )
|
||||
->can()
|
||||
->get() ? __( 'Backend Editor', 'js_composer' ) : __( 'Edit', 'js_composer' ); ?></button>
|
||||
<?php if ( ! in_array( $post->post_status, array(
|
||||
'publish',
|
||||
'future',
|
||||
'private',
|
||||
) )
|
||||
) : ?>
|
||||
<?php if ( 'draft' === $post->post_status ) : ?>
|
||||
<button type="button" class="vc_btn vc_btn-default vc_btn-sm vc_navbar-btn vc_btn-save-draft"
|
||||
id="vc_button-save-draft"
|
||||
title="<?php esc_attr_e( 'Save Draft', 'js_composer' ) ?>"><?php _e( 'Save Draft', 'js_composer' ) ?></button>
|
||||
<?php elseif ( 'pending' === $post->post_status && $can_publish ) : ?>
|
||||
<button type="button" class="vc_btn vc_btn-primary vc_btn-sm vc_navbar-btn vc_btn-save"
|
||||
id="vc_button-save-as-pending"
|
||||
title="<?php esc_attr_e( 'Save as Pending', 'js_composer' ) ?>"><?php _e( 'Save as Pending', 'js_composer' ) ?></button>
|
||||
<?php endif ?>
|
||||
<?php if ( $can_publish ) : ?>
|
||||
<button type="button" class="vc_btn vc_btn-primary vc_btn-sm vc_navbar-btn vc_btn-save"
|
||||
id="vc_button-update" title="<?php esc_attr_e( 'Publish', 'js_composer' ) ?>"
|
||||
data-change-status="publish"><?php _e( 'Publish', 'js_composer' ) ?></button>
|
||||
<?php else : ?>
|
||||
<button type="button" class="vc_btn vc_btn-primary vc_btn-sm vc_navbar-btn vc_btn-save"
|
||||
id="vc_button-update" title="<?php esc_attr_e( 'Submit for Review', 'js_composer' ) ?>"
|
||||
data-change-status="pending"><?php _e( 'Submit for Review', 'js_composer' ) ?></button>
|
||||
<?php endif ?>
|
||||
<?php else : ?>
|
||||
<button type="button" class="vc_btn vc_btn-primary vc_btn-sm vc_navbar-btn vc_btn-save"
|
||||
id="vc_button-update"
|
||||
title="<?php esc_attr_e( 'Update', 'js_composer' ) ?>"><?php _e( 'Update', 'js_composer' ) ?></button>
|
||||
<?php endif ?>
|
||||
</li>
|
||||
<?php
|
||||
$output = ob_get_contents();
|
||||
ob_end_clean();
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getControlViewPost() {
|
||||
return '<li class="vc_pull-right">'
|
||||
. '<a href="' . esc_attr( get_permalink( $this->post() ) ) . '" class="vc_icon-btn vc_back-button"'
|
||||
. ' title="' . esc_attr__( 'Exit WPBakery Page Builder edit mode', 'js_composer' ) . '"><i class="vc-composer-icon vc-c-icon-close"></i></a>'
|
||||
. '</li>';
|
||||
}
|
||||
}
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
die( '-1' );
|
||||
}
|
||||
|
||||
class Vc_Navbar_Undoredo {
|
||||
public function __construct() {
|
||||
// Backend
|
||||
add_filter( 'vc_nav_controls', array(
|
||||
$this,
|
||||
'addControls',
|
||||
) );
|
||||
|
||||
// Frontend
|
||||
add_filter( 'vc_nav_front_controls', array(
|
||||
$this,
|
||||
'addControls',
|
||||
) );
|
||||
}
|
||||
|
||||
public function addControls( $controls ) {
|
||||
$controls[] = array(
|
||||
'redo',
|
||||
'<li class="vc_pull-right"><a id="vc_navbar-redo" href="javascript:;" class="vc_icon-btn" disabled title="' . __( 'Redo', 'js_composer' ) . '"><i class="vc_navbar-icon fa fa-repeat"></i></a></li>',
|
||||
);
|
||||
$controls[] = array(
|
||||
'undo',
|
||||
'<li class="vc_pull-right"><a id="vc_navbar-undo" href="javascript:;" class="vc_icon-btn" disabled title="' . __( 'Undo', 'js_composer' ) . '"><i class="vc_navbar-icon fa fa-undo"></i></a></li>',
|
||||
);
|
||||
|
||||
return $controls;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,195 @@
|
||||
<?php
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
die( '-1' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Renders navigation bar for Editors.
|
||||
*/
|
||||
class Vc_Navbar implements Vc_Render {
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
protected $controls = array(
|
||||
'add_element',
|
||||
'templates',
|
||||
'save_backend',
|
||||
'preview',
|
||||
'frontend',
|
||||
'custom_css',
|
||||
'fullscreen',
|
||||
'windowed',
|
||||
);
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $brand_url = 'https://wpbakery.com/?utm_campaign=VCplugin&utm_source=vc_user&utm_medium=backend_editor';
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $css_class = 'vc_navbar';
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $controls_filter_name = 'vc_nav_controls';
|
||||
/**
|
||||
* @var bool|WP_Post
|
||||
*/
|
||||
protected $post = false;
|
||||
|
||||
/**
|
||||
* @param WP_Post $post
|
||||
*/
|
||||
public function __construct( WP_Post $post ) {
|
||||
$this->post = $post;
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate array of controls by iterating property $controls list.
|
||||
* vc_filter: vc_nav_controls - hook to override list of controls
|
||||
* @return array - list of arrays witch contains key name and html output for button.
|
||||
*/
|
||||
public function getControls() {
|
||||
$list = array();
|
||||
foreach ( $this->controls as $control ) {
|
||||
$method = vc_camel_case( 'get_control_' . $control );
|
||||
if ( method_exists( $this, $method ) ) {
|
||||
$list[] = array( $control, $this->$method() . "\n" );
|
||||
}
|
||||
}
|
||||
|
||||
return apply_filters( $this->controls_filter_name, $list );
|
||||
}
|
||||
|
||||
/**
|
||||
* Get current post.
|
||||
* @return null|WP_Post
|
||||
*/
|
||||
public function post() {
|
||||
if ( $this->post ) {
|
||||
return $this->post;
|
||||
}
|
||||
|
||||
return get_post();
|
||||
}
|
||||
|
||||
/**
|
||||
* Render template.
|
||||
*/
|
||||
public function render() {
|
||||
vc_include_template( 'editors/navbar/navbar.tpl.php', array(
|
||||
'css_class' => $this->css_class,
|
||||
'controls' => $this->getControls(),
|
||||
'nav_bar' => $this,
|
||||
'post' => $this->post(),
|
||||
) );
|
||||
}
|
||||
|
||||
/**
|
||||
* vc_filter: vc_nav_front_logo - hook to override WPBakery Page Builder logo
|
||||
* @return mixed|void
|
||||
*/
|
||||
public function getLogo() {
|
||||
$output = '<a id="vc_logo" class="vc_navbar-brand" title="' . __( 'WPBakery Page Builder', 'js_composer' )
|
||||
. '" href="' . esc_attr( $this->brand_url ) . '" target="_blank">'
|
||||
. __( 'WPBakery Page Builder', 'js_composer' ) . '</a>';
|
||||
|
||||
return apply_filters( 'vc_nav_front_logo', $output );
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getControlCustomCss() {
|
||||
if ( ! vc_user_access()->part( 'post_settings' )->can()->get() ) {
|
||||
return '';
|
||||
}
|
||||
|
||||
return '<li class="vc_pull-right"><a id="vc_post-settings-button" href="javascript:;" class="vc_icon-btn vc_post-settings" title="'
|
||||
. __( 'Page settings', 'js_composer' ) . '">'
|
||||
. '<span id="vc_post-css-badge" class="vc_badge vc_badge-custom-css" style="display: none;">' . __( 'CSS', 'js_composer' )
|
||||
. '</span><i class="vc-composer-icon vc-c-icon-cog"></i></a>'
|
||||
. '</li>';
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getControlFullscreen() {
|
||||
return '<li class="vc_show-mobile vc_pull-right">'
|
||||
. '<a id="vc_fullscreen-button" class="vc_icon-btn vc_fullscreen-button" title="'. __( 'Full screen', 'js_composer' ) . '"><i class="vc-composer-icon vc-c-icon-fullscreen"></i></a>'
|
||||
. '</li>';
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getControlWindowed() {
|
||||
return '<li class="vc_show-mobile vc_pull-right">'
|
||||
. '<a id="vc_windowed-button" class="vc_icon-btn vc_windowed-button" title="'. __( 'Exit full screen', 'js_composer' ) . '"><i class="vc-composer-icon vc-c-icon-fullscreen_exit"></i></a>'
|
||||
. '</li>';
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getControlAddElement() {
|
||||
if ( vc_user_access()
|
||||
->part( 'shortcodes' )
|
||||
->checkStateAny( true, 'custom', null )
|
||||
->get() &&
|
||||
vc_user_access_check_shortcode_all( 'vc_row' ) && vc_user_access_check_shortcode_all( 'vc_column' )
|
||||
) {
|
||||
return '<li class="vc_show-mobile">'
|
||||
. ' <a href="javascript:;" class="vc_icon-btn vc_element-button" data-model-id="vc_element" id="vc_add-new-element" title="'
|
||||
. '' . __( 'Add new element', 'js_composer' ) . '">'
|
||||
. ' <i class="vc-composer-icon vc-c-icon-add_element"></i>'
|
||||
. ' </a>'
|
||||
. '</li>';
|
||||
}
|
||||
|
||||
return '';
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getControlTemplates() {
|
||||
if ( ! vc_user_access()->part( 'templates' )->can()->get() ) {
|
||||
return '';
|
||||
}
|
||||
|
||||
return '<li><a href="javascript:;" class="vc_icon-btn vc_templates-button" id="vc_templates-editor-button" title="'
|
||||
. __( 'Templates', 'js_composer' ) . '"><i class="vc-composer-icon vc-c-icon-add_template"></i></a></li>';
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getControlFrontend() {
|
||||
if ( ! vc_enabled_frontend() ) {
|
||||
return '';
|
||||
}
|
||||
|
||||
return '<li class="vc_pull-right" style="display: none;">'
|
||||
. '<a href="' . vc_frontend_editor()->getInlineUrl() . '" class="vc_btn vc_btn-primary vc_btn-sm vc_navbar-btn" id="wpb-edit-inline">' . __( 'Frontend', 'js_composer' ) . '</a>'
|
||||
. '</li>';
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getControlPreview() {
|
||||
return '';
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getControlSaveBackend() {
|
||||
return '<li class="vc_pull-right vc_save-backend">'
|
||||
. '<a href="javascript:;" class="vc_btn vc_btn-grey vc_btn-sm vc_navbar-btn vc_control-preview">' . __( 'Preview', 'js_composer' ) . '</a>'
|
||||
. '<a class="vc_btn vc_btn-sm vc_navbar-btn vc_btn-primary vc_control-save" id="wpb-save-post">' . __( 'Update', 'js_composer' ) . '</a>'
|
||||
. '</li>';
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user