function rcl_frontend_scripts() { global $rcl_options, $user_LK, $user_ID, $post; if (!isset($rcl_options['font_icons'])) { $rcl_options['font_icons'] = 1; } if ($user_LK) { rcl_dialog_scripts(); } if ($user_ID) { if ($user_ID == $user_LK || $post && isset($rcl_options['public_form_page_rcl']) && $post->ID == $rcl_options['public_form_page_rcl']) { rcl_crop_scripts(); rcl_webcam_scripts(); } rcl_fileupload_scripts(); } if (wp_style_is('font-awesome')) { wp_deregister_style('font-awesome'); } wp_enqueue_style('font-awesome', RCL_URL . 'css/font-awesome/css/font-awesome.min.css', array(), '4.5.0'); if (isset($rcl_options['minify_css']) && $rcl_options['minify_css'] == 1) { if ($rcl_options['custom_scc_file_recall'] != '') { wp_enqueue_style('style_custom_rcl', $rcl_options['custom_scc_file_recall']); } else { wp_enqueue_style('rcl-style', RCL_UPLOAD_URL . 'css/minify.css'); } } else { $css_ar = array('lk', 'recbar', 'regform', 'slider', 'users', 'style'); foreach ($css_ar as $name) { wp_enqueue_style('style_' . $name, RCL_URL . 'css/' . $name . '.css'); } } if ($rcl_options['color_theme']) { $dirs = array(RCL_PATH . 'css/themes', RCL_TAKEPATH . 'themes'); foreach ($dirs as $dir) { if (!file_exists($dir . '/' . $rcl_options['color_theme'] . '.css')) { continue; } wp_enqueue_style('rcl-theme', rcl_path_to_url($dir . '/' . $rcl_options['color_theme'] . '.css')); break; } } if ($user_ID) { wp_enqueue_script('rangyinputs', RCL_URL . 'js/rangyinputs.js'); } wp_enqueue_script('rcl-primary-scripts', RCL_URL . 'js/recall.js', array(), VER_RCL); if (!file_exists(RCL_UPLOAD_PATH . 'scripts/header-scripts.js')) { $rcl_addons = new rcl_addons(); $rcl_addons->get_update_scripts_file_rcl(); } wp_enqueue_script('rcl-header-scripts', RCL_UPLOAD_URL . 'scripts/header-scripts.js', array('rcl-primary-scripts'), VER_RCL); }
function __construct($atts) { global $editpost, $group_id, $rcl_options, $user_ID, $formData; $editpost = false; $this->can_edit = true; extract(shortcode_atts(array('cats' => false, 'id' => 1, 'id_upload' => 'upload-public-form', 'accept' => 'image/*', 'post_type' => 'post', 'type_editor' => null, 'wp_editor' => null, 'group_id' => $group_id), $atts)); $this->post_type = $post_type; $this->id_upload = $id_upload; $this->terms = $cats; $this->form_id = $id; $this->accept = $accept; if (!isset($wp_editor)) { if (isset($rcl_options['wp_editor'])) { $cnt = count($rcl_options['wp_editor']); if ($cnt == 1) { $type = $rcl_options['wp_editor'][0]; } else { $type = 3; } } $this->wp_editor = isset($type) ? $type : 0; } else { $this->wp_editor = $wp_editor; } $this->type_editor = $type_editor; if (!isset($this->type_editor)) { $this->type_editor = isset($rcl_options['type_editor-' . $this->post_type]) ? $rcl_options['type_editor-' . $this->post_type] : $rcl_options['type_text_editor']; } if (isset($_GET['rcl-post-edit'])) { $this->post_id = $_GET['rcl-post-edit']; $editpost = get_post($this->post_id); $this->post_type = $editpost->post_type; if ($this->post_type == 'post-group') { if (!rcl_can_user_edit_post_group($this->post_id) && !current_user_can('edit_post', $this->post_id)) { $this->can_edit = false; } $group_id = rcl_get_group_id_by_post($this->post_id); $widget_options = rcl_get_group_option($group_id, 'widgets_options'); if (isset($widget_options['group-public-form-widget'])) { $this->type_editor = $widget_options['group-public-form-widget']['type_form']; } } else { if (!current_user_can('edit_post', $this->post_id)) { $this->can_edit = false; } } $form_id = get_post_meta($this->post_id, 'publicform-id', 1); if ($form_id) { $this->form_id = $form_id; } } $taxs = array(); $taxs = apply_filters('taxonomy_public_form_rcl', $taxs); if (isset($rcl_options['accept-' . $this->post_type])) { $this->accept = $rcl_options['accept-' . $this->post_type]; } $formData = (object) array('form_id' => $this->form_id, 'post_id' => $this->post_id, 'post_type' => $this->post_type, 'id_upload' => $this->id_upload, 'terms' => $this->terms, 'accept' => $this->accept, 'type_editor' => $this->type_editor, 'wp_editor' => $this->wp_editor, 'taxonomy' => $taxs); if ($this->user_can()) { rcl_fileapi_scripts(); rcl_fileupload_scripts(); } if ($this->post_id) { add_filter('after_public_form_rcl', array(&$this, 'delete_button'), 10, 2); } }