function get_template_rcl($file_temp, $path = false) { _deprecated_function('get_template_rcl', '4.2', 'rcl_get_template_path'); return rcl_get_template_path($file_temp, $path); }
function public_form() { global $user_ID, $formFields; if (!$this->can_edit) { return '<p align="center">' . __('You can not edit this publication :(', 'wp-recall') . '</p>'; } if (!$this->user_can()) { if ($this->post_type == 'post-group') { return '<div class="public-post-group">' . '<h3 >' . __('Sorry, but you have no rights to publish within groups :(', 'wp-recall') . '</h3>' . '</div>'; } else { if (!$user_ID) { return '<p align="center">' . __('You must be logged in to post. Login or register', 'wp-recall') . '</p>'; } return '<h3 class="aligncenter">' . __('Sorry, but you have no right<br>to publish the records on this site :(', 'wp-recall') . '</h3>'; } } $formfields = array('title' => true, 'termlist' => true, 'editor' => true, 'excerpt' => false, 'custom_fields' => true, 'upload' => true, 'tags' => true); $formFields = apply_filters('fields_public_form_rcl', $formfields, $this); if (!$formFields['tags']) { remove_filter('public_form_rcl', 'rcl_add_tags_input', 10); } $form = '<div class="public_block">'; $id_form = $this->post_id ? $this->post_id : 0; if (!$id_form) { if (!isset($_SESSION['new-' . $this->post_type])) { $_SESSION['new-' . $this->post_type] = 1; $form .= '<script>Object.keys(localStorage) .forEach(function(key){ if (/^form-' . $this->post_type . '-0/.test(key)) { localStorage.removeItem(key); } });</script>'; } } $id_form = 'form-' . $this->post_type . '-' . $id_form; $form .= '<form id="' . $id_form . '" class="'; $form .= $this->post_id ? 'edit-form' : 'public-form'; $form .= '" onsubmit="document.getElementById(\'edit-post-rcl\').disabled=true;document.getElementById(\'edit-post-rcl\').value=\'' . __('Being sent, please wait...', 'wp-recall') . '\';" action="" method="post" enctype="multipart/form-data"> ' . wp_nonce_field('edit-post-rcl', '_wpnonce', true, false); if (!$user_ID) { $form .= '<div class="rcl-form-field"> <label>' . __('Your Name', 'wp-recall') . ' <span class="required">*</span></label> <input required type="text" value="" name="name-user"> </div> <div class="rcl-form-field"> <label>' . __('Your E-mail', 'wp-recall') . ' <span class="required">*</span></label> <input required type="text" value="" name="email-user"> </div>'; } if (rcl_get_template_path($this->post_type . '-form.php', __FILE__)) { $form .= rcl_get_include_template($this->post_type . '-form.php', __FILE__); } else { $form .= rcl_get_include_template('public-form.php', __FILE__); } $fields = ''; $form .= apply_filters('rcl_public_form', $fields, $this); $form .= $this->submit_and_hidden() . '</form>'; $form .= '<script type="text/javascript"> function addfile_content($file){ var ifr = jQuery("#contentarea_ifr").contents().find("#tinymce").html(); jQuery("#contentarea").insertAtCaret($file+" "); jQuery("#contentarea_ifr").contents().find("#tinymce").html(ifr+$file+" "); return false; } </script>'; $after = ''; $form .= apply_filters('after_public_form_rcl', $after, $this); $form .= '</div>'; return $form; }
function rcl_include_template($file_temp, $path = false) { $pathfile = rcl_get_template_path($file_temp, $path); if (!$pathfile) { return false; } include $pathfile; }