function mce_external_plugins($plugin_array) { if (file_exists(wpui_dir('/inc/wpuimce/editor_plugin.js'))) { $plugin_array['wpuimce'] = wpui_url('/inc/wpuimce/editor_plugin.js'); } return $plugin_array; }
/** * Load the modules. */ private function load_modules() { if (!is_dir(wpui_dir('modules'))) { return false; } if ($mod_dir = opendir(wpui_dir('modules'))) { while (false != ($module = readdir($mod_dir))) { if ('php' == substr($module, -3)) { @(include_once wpui_dir('modules/' . $module)); } } // end while. } // end if mod_dir. }
/** * Install & Activate the updater plugin. * * @return void * @author Kavin Gray **/ function wpui_install_updater() { // include_once( ABSPATH . 'wp-admin/includes/file.php' ); // WP_Filesystem(); // global $wp_filesystem; $copy_plugin = idq_copy(wpui_dir('inc/wpui-updater/'), WP_CONTENT_DIR . '/plugins/wpui-updater'); if (!$copy_plugin) { echo json_encode(array('status' => 'error', 'message' => 'Copying the plugin <code>wpui-updater</code> to Plugins directory failed. Please copy manually.')); die(-1); } $activate = activate_plugin(WP_PLUGIN_DIR . '/wpui-updater/wpui-updater.php'); echo json_encode(is_wp_error($activate) ? array('status' => 'error', 'message' => 'Failed to activate plugin. Please Activate the plugin "WP UI Updater" from plugins page') : array('status' => 'success', 'message' => 'Plugin <code>WP UI Updater</code> was Successfully installed and activated!')); die(0); }
function widget($args, $instance) { extract($args); echo $before_widget; $title = apply_filters('widget_title', $instance['title']); if (!empty($title)) { echo $before_title . $title . $after_title; } $scode = '['; // echo '<pre>'; // echo 'Exporting : $instance' . "\n"; // echo "====================\n"; // var_export($instance); // echo '</pre>'; if ($instance['type'] == 'spoiler') { include_once wpui_dir('inc/class-wpui-posts.php'); $wpuiPosts = new wpuiPosts(); $query = array(); if (isset($instance['search_type'])) { $stype = $instance['search_type']; if ($stype == 'cat' || $stype == 'tag') { if (empty($instance['selected'])) { return; } $query[$stype] = $instance['selected']; } if ($stype == 'recent' || $stype == 'random' || $stype == 'popular') { $query['get'] = $stype; } } if (!empty($instance['number'])) { $query['number'] = $instance['number']; } $cusPosts = $wpuiPosts->wpui_get_posts($query); foreach ($cusPosts as $key => $posty) { $scode .= 'wpspoiler name="' . $posty['title'] . '"]' . $posty['content']; if (!empty($instance['arguments'])) { $scode .= $instance['arguments']; } $scode .= '[/wpspoiler]'; } } else { $scode .= 'wptabposts '; if ($instance['type'] == 'accordion') { $scode .= ' type="accordion"'; } if (isset($instance['search_type'])) { $stype = $instance['search_type']; if ($stype == 'cat' || $stype == 'tag') { if (empty($instance['selected'])) { return; } $scode .= ' ' . $stype . '="' . $instance['selected'] . '"'; } if ($stype == 'recent' || $stype == 'random' || $stype == 'popular') { $scode .= ' get="' . $stype . '"'; } } if (isset($instance['style']) && $instance['style'] !== 'default') { $scode .= ' style="' . $instance['style'] . '"'; } if (isset($instance['template']) && $instance['template'] !== '1') { $scode .= ' template="' . $instance['template'] . '"'; } if (!empty($instance['number'])) { $scode .= ' number="' . $instance['number'] . '"'; } if (!empty($instance['names'])) { $scode .= ' names="' . $instance['names'] . '"'; } if (!empty($instance['arguments'])) { $scode .= $instance['arguments']; } $scode .= '] [/wptabposts]'; } // echo '<pre>'; // echo 'Exporting : $scode' . "\n"; // echo "====================\n"; // var_export($scode); // echo '</pre>'; // echo $scode; echo do_shortcode($scode); echo $after_widget; }
function wpui_editor_dialogs() { if (isset($this->options['enable_tinymce_menu']) && $this->options['enable_tinymce_menu'] == 'on' || isset($this->options['enable_quicktags_buttons']) && $this->options['enable_quicktags_buttons'] == 'on') { @(include_once wpui_dir('inc/editor-dialogs.php')); } }
function choose_wpui_style() { // echo wpui_get_file( wpui_url( 'js/wpui-choosestyles.php' ) ); @(include wpui_dir('js/wpui-choosestyles.php')); die; }