Файловый менеджер - Редактировать - /home/freeclou/app.optimyar.com/front-web/build/assets/resources/agGrid/inc.zip
Назад
PK �y[ZX�]� � admin/404page-admin-page.phpnu �[��� <?php /** * As of version 11.0.0 this file is no longer needed * * It is only included in the setup to override the file when upgrading from an earlier version */ if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly }PK �y[*� � admin/index.phpnu �[��� <?php // Silence is goldenPK �y[�0Ӑ � ppf/assets/css/pp-admin-page.cssnu �[��� body { background-color: #fff; } #wpcontent { padding-left: 0 !important; color: #434343 !important; } .pp-admin-page-wrapper { margin: 0; } .pp-admin-notice-area { padding: 0; } .pp-admin-notice-area .notice { margin: 0; } .pp-admin-page-header { background-color: #E2E2E2; } .rtl .pp-admin-page-header { margin-left: 0; } .pp-admin-page-header nav { margin-right: 24px; text-align: right; line-height: 1; padding-top: 6px; } .rtl .pp-admin-page-header nav { text-align: left; margin-right: 0; margin-left: 24px; } .pp-admin-page-header nav a { display: inline-block; padding: 0 3px; color: #434343; text-decoration: none; font-size: 12px; height: 24px; line-height: 24px; } .pp-admin-page-header nav a span.text { white-space: nowrap; padding-left: 4px; } .rtl .pp-admin-page-header nav a span.text { padding-left: 0; padding-right: 4px; } @media only screen and (max-width: 960px) { .pp-admin-page-header nav a { font-size: 36px; padding: 0 12px; } .pp-admin-page-header nav a span.text { display: none; } } .pp-admin-page-title { padding: 12px 24px; color: #434343; } .pp-admin-page-title h1 { color: #434343; margin: 0; padding: 0; } .pp-admin-page-header .tab-navigation { display: flex; flex-wrap: wrap; margin: 0 24px; list-style: none; } .pp-admin-page-header .tab-navigation li { margin: 0; } .pp-admin-page-header .tab-navigation .tabset { padding: 12px 24px; font-size: 18px; color: #434343; cursor: pointer; background: none; border: none; border-top-left-radius: 3px; border-top-right-radius: 3px; outline: none; transition: background-color 0.3s ease; } .pp-admin-page-header .tab-navigation .tabset:hover { background-color: rgba( 255, 255, 255, 0.3 ); } .pp-admin-page-header .tab-navigation .tabset.current, .pp-admin-page-header .tab-navigation .tabset.current:hover { background-color: #fff; color: #434343; } .pp-admin-page-header .tab-navigation .tabset.has-icon { padding-left: 60px; background-position: 24px center; background-repeat: no-repeat; } .pp-admin-page-header .tab-navigation .tabset.icon-general { background-image: url( ../img/general.svg ); } .pp-admin-page-header .tab-navigation .tabset.icon-videos { background-image: url( ../img/videos.svg ); } .pp-admin-page-header .tab-navigation .tabset.icon-advanced { background-image: url( ../img/advanced.svg ); } .pp-admin-page-header .tab-navigation .tabset.icon-addons { background-image: url( ../img/addons.svg ); } .pp-admin-page-header .tab-navigation .tabset.icon-info { background-image: url( ../img/info.svg ); } .pp-admin-page-inner { padding: 24px; background-color: #fff; } .pp-admin-page-inner .tab-panel .panel { display: none; } .pp-admin-page-inner .tab-panel .panel.current { display: block; } .pp-admin-page-inner .tab-panel .panel.current.nosubmit ~ .submit { display: none; } .pp-admin-page-inner .tab-panel p.submit { padding-bottom: 0; margin-bottom: 0; } .wp-core-ui .pp-admin-page-inner .tab-panel .button-primary { background-color: #4D648D; border: 1px solid #4D648D; box-shadow: none; text-shadow: none; font-size: 16px; line-height: 1; height: auto; padding: 12px 24px; transition: all 0.3s ease; } .wp-core-ui .pp-admin-page-inner .tab-panel .button-primary:hover, .wp-core-ui .pp-admin-page-inner .tab-panel .button-primary:focus { background-color: #283655; border: 1px solid #283655; } .pp-admin-page-footer { margin-top: 20px; padding: 24px; } .pp-admin-page-wrapper .form-table th, .form-table td { display: block; width: auto; } .pp-admin-page-wrapper .form-table td { padding: 0; margin-bottom: 24px; } .pp-admin-page-wrapper .form-table td p { padding: 0; line-height: 1.2; margin-bottom: 24px; } .pp-admin-page-wrapper .form-table th { display: none; } .wp-admin .pp-admin-page-wrapper select { border: 3px solid #434343; border-radius: 6px; padding: 6px; line-height: 1.5; height: auto; } .pp-admin-page-wrapper a { color: #4D648D; transition: color 0.3s ease; } .pp-admin-page-wrapper a:hover, .pp-admin-page-wrapper a:focus { color: #0073aa; } .pp-admin-page-wrapper .toggle { display: flex; } .pp-admin-page-wrapper .toggle .slider { width: 120px; } .pp-admin-page-wrapper .toggle .caption { flex: 1; } .pp-admin-page-wrapper .toggle input[type="checkbox"] { display: none; } .pp-admin-page-wrapper .toggle input[type="checkbox"] + label { cursor: pointer; text-indent: -9999px; width: 80px; height: 40px; background: #959595; display: block; border-radius: 40px; position: relative; transition: all 0.3s ease; } .pp-admin-page-wrapper .toggle input[type="checkbox"]:disabled + label { background-color: #CDCDCD; } .pp-admin-page-wrapper .toggle input[type="checkbox"] + label:after { content: ''; position: absolute; top: 5px; width: 30px; height: 30px; border-radius: 30px; transition: all 0.3s ease; background-color: #FFF; } .pp-admin-page-wrapper .toggle input[type="checkbox"]:disabled + label:after { background-color: #E2E2E2; } body:not(.rtl) .pp-admin-page-wrapper .toggle input[type="checkbox"] + label:after, .rtl .pp-admin-page-wrapper .toggle input[type="checkbox"]:checked + label:after { left: 5px; transform: none; } .pp-admin-page-wrapper .toggle input[type="checkbox"]:enabled:checked + label { background: #434343; } body:not(.rtl) .pp-admin-page-wrapper .toggle input[type="checkbox"]:checked + label:after, .rtl .pp-admin-page-wrapper .toggle input[type="checkbox"] + label:after { left: calc(100% - 5px); transform: translateX(-100%); } .form-table.pp-admin-section-fields { margin-top: 0; }PK �y[D���; ; ppf/assets/img/addons.svgnu �[��� <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="black" width="24px" height="24px"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M4 6H2v14c0 1.1.9 2 2 2h14v-2H4V6zm16-4H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm0 14H8V4h12v12zm-7-2h2v-3h3V9h-3V6h-2v3h-3v2h3z"/></svg>PK �y[?�5U U ppf/assets/img/advanced.svgnu �[��� <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="black" width="24px" height="24px"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M22.61 18.99l-9.08-9.08c.93-2.34.45-5.1-1.44-7C9.79.61 6.21.4 3.66 2.26L7.5 6.11 6.08 7.52 2.25 3.69C.39 6.23.6 9.82 2.9 12.11c1.86 1.86 4.57 2.35 6.89 1.48l9.11 9.11c.39.39 1.02.39 1.41 0l2.3-2.3c.4-.38.4-1.01 0-1.41zm-3 1.6l-9.46-9.46c-.61.45-1.29.72-2 .82-1.36.2-2.79-.21-3.83-1.25C3.37 9.76 2.93 8.5 3 7.26l3.09 3.09 4.24-4.24-3.09-3.09c1.24-.07 2.49.37 3.44 1.31 1.08 1.08 1.49 2.57 1.24 3.96-.12.71-.42 1.37-.88 1.96l9.45 9.45-.88.89z"/></svg>PK �y[���� � ppf/assets/img/general.svgnu �[��� <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="black" width="24px" height="24px"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M19.43 12.98c.04-.32.07-.64.07-.98 0-.34-.03-.66-.07-.98l2.11-1.65c.19-.15.24-.42.12-.64l-2-3.46c-.09-.16-.26-.25-.44-.25-.06 0-.12.01-.17.03l-2.49 1c-.52-.4-1.08-.73-1.69-.98l-.38-2.65C14.46 2.18 14.25 2 14 2h-4c-.25 0-.46.18-.49.42l-.38 2.65c-.61.25-1.17.59-1.69.98l-2.49-1c-.06-.02-.12-.03-.18-.03-.17 0-.34.09-.43.25l-2 3.46c-.13.22-.07.49.12.64l2.11 1.65c-.04.32-.07.65-.07.98 0 .33.03.66.07.98l-2.11 1.65c-.19.15-.24.42-.12.64l2 3.46c.09.16.26.25.44.25.06 0 .12-.01.17-.03l2.49-1c.52.4 1.08.73 1.69.98l.38 2.65c.03.24.24.42.49.42h4c.25 0 .46-.18.49-.42l.38-2.65c.61-.25 1.17-.59 1.69-.98l2.49 1c.06.02.12.03.18.03.17 0 .34-.09.43-.25l2-3.46c.12-.22.07-.49-.12-.64l-2.11-1.65zm-1.98-1.71c.04.31.05.52.05.73 0 .21-.02.43-.05.73l-.14 1.13.89.7 1.08.84-.7 1.21-1.27-.51-1.04-.42-.9.68c-.43.32-.84.56-1.25.73l-1.06.43-.16 1.13-.2 1.35h-1.4l-.19-1.35-.16-1.13-1.06-.43c-.43-.18-.83-.41-1.23-.71l-.91-.7-1.06.43-1.27.51-.7-1.21 1.08-.84.89-.7-.14-1.13c-.03-.31-.05-.54-.05-.74s.02-.43.05-.73l.14-1.13-.89-.7-1.08-.84.7-1.21 1.27.51 1.04.42.9-.68c.43-.32.84-.56 1.25-.73l1.06-.43.16-1.13.2-1.35h1.39l.19 1.35.16 1.13 1.06.43c.43.18.83.41 1.23.71l.91.7 1.06-.43 1.27-.51.7 1.21-1.07.85-.89.7.14 1.13zM12 8c-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4zm0 6c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2z"/></svg>PK �y[#�y1 1 ppf/assets/img/info.svgnu �[��� <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="black" width="24px" height="24px"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M11 7h2v2h-2zm0 4h2v6h-2zm1-9C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8z"/></svg>PK �y[_�Fu+ + ppf/assets/img/videos.svgnu �[��� <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="black" width="24px" height="24px"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M4 6H2v14c0 1.1.9 2 2 2h14v-2H4V6zm16-4H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm0 14H8V4h12v12zM12 5.5v9l6-4.5z"/></svg>PK �y[PM]�1 1 ppf/assets/js/jquery.cookie.jsnu �[��� /*! * jQuery Cookie Plugin v1.4.1 * https://github.com/carhartl/jquery-cookie * * Copyright 2013 Klaus Hartl * Released under the MIT license */ (function (factory) { if (typeof define === 'function' && define.amd) { // AMD define(['jquery'], factory); } else if (typeof exports === 'object') { // CommonJS factory(require('jquery')); } else { // Browser globals factory(jQuery); } }(function ($) { var pluses = /\+/g; function encode(s) { return config.raw ? s : encodeURIComponent(s); } function decode(s) { return config.raw ? s : decodeURIComponent(s); } function stringifyCookieValue(value) { return encode(config.json ? JSON.stringify(value) : String(value)); } function parseCookieValue(s) { if (s.indexOf('"') === 0) { // This is a quoted cookie as according to RFC2068, unescape... s = s.slice(1, -1).replace(/\\"/g, '"').replace(/\\\\/g, '\\'); } try { // Replace server-side written pluses with spaces. // If we can't decode the cookie, ignore it, it's unusable. // If we can't parse the cookie, ignore it, it's unusable. s = decodeURIComponent(s.replace(pluses, ' ')); return config.json ? JSON.parse(s) : s; } catch(e) {} } function read(s, converter) { var value = config.raw ? s : parseCookieValue(s); return $.isFunction(converter) ? converter(value) : value; } var config = $.cookie = function (key, value, options) { // Write if (value !== undefined && !$.isFunction(value)) { options = $.extend({}, config.defaults, options); if (typeof options.expires === 'number') { var days = options.expires, t = options.expires = new Date(); t.setTime(+t + days * 864e+5); } return (document.cookie = [ encode(key), '=', stringifyCookieValue(value), options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE options.path ? '; path=' + options.path : '', options.domain ? '; domain=' + options.domain : '', options.secure ? '; secure' : '' ].join('')); } // Read var result = key ? undefined : {}; // To prevent the for loop in the first place assign an empty array // in case there are no cookies at all. Also prevents odd result when // calling $.cookie(). var cookies = document.cookie ? document.cookie.split('; ') : []; for (var i = 0, l = cookies.length; i < l; i++) { var parts = cookies[i].split('='); var name = decode(parts.shift()); var cookie = parts.join('='); if (key && key === name) { // If second argument (value) is a function it's a converter... result = read(cookie, value); break; } // Prevent storing a cookie that we couldn't decode. if (!key && (cookie = read(cookie)) !== undefined) { result[name] = cookie; } } return result; }; config.defaults = {}; $.removeCookie = function (key, options) { if ($.cookie(key) === undefined) { return false; } // Must not alter options, thus extending a fresh object... $.cookie(key, '', $.extend({}, options, { expires: -1 })); return !$.cookie(key); }; })); PK �y[��j�W W ppf/assets/js/pp-admin-page.jsnu �[��� jQuery( document ).ready(function( $ ) { var cookie_name = pp_admin_cookie_prefix + '_current_tab'; $( '.tab-navigation .tabset' ).click( function() { if ( $( this ).not( '.current' ) ) { $( '.tab-panel .panel.current' ).removeClass( 'current '); $( '#' + $(this).data('tab-content') ).addClass( 'current' ); $( '.tab-navigation .tabset.current' ).removeClass( 'current '); $( this ).addClass( 'current' ); $.cookie( cookie_name, $( '.tab-navigation .tabset.current' ).attr('id') ); } }); var current_tab = jQuery.cookie( cookie_name ); if ( current_tab === undefined ) { current_tab = $( '.tab-navigation .tabset:first' ).attr('id'); $.removeCookie( cookie_name ); } $( '#' + current_tab ).trigger( 'click' ); });PK �y[s�p� ppf/loader.phpnu �[��� <?php /** * Plugin Foundation Loader * * Peter's Plugins Foundation 09 * * @package PPF09 * @author Peter Raschendorfer * @license GPL2+ */ if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly } require_once ( __DIR__ . '/ppf-class.php' ); require_once ( __DIR__ . '/ppf-subclass.php' ); require_once ( __DIR__ . '/ppf-plugin.php' ); require_once ( __DIR__ . '/ppf-settings.php' ); require_once ( __DIR__ . '/ppf-admin.php' ); require_once ( __DIR__ . '/ppf-plugin-addon.php' );PK �y[��Ԟ�d �d ppf/ppf-admin.phpnu �[��� <?php /** * Admin Class * * Peter's Plugins Foundation 09 * * @package PPF09 * @author Peter Raschendorfer * @license GPL2+ */ if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly } if ( !class_exists( 'PPF09_Admin' ) ) { abstract class PPF09_Admin extends PPF09_SubClass { /** * settings sections * * @since PPF01 * @var array * @access private * * as of PPF04 we initialize an empty array */ private $_sections = array(); /** * is setting registered? * * @since PPF04 * @var bool * @access private */ private $_settings_registered = false; /** * toolbar * * @since PPF01 * @var string * @access private */ private $_toolbar; /** * id of screen * * this can be set via set_screen_id() * * @since PPF01 * @var array * @access private */ private $_my_screen_id; /** * add multiple setting sections * * @since PPF01 * @param array $sections array of setting sections to add * @access public * @see add_settings() * * as of PPF04 we add the sections to the _sections array to allow adding more sections */ public function add_setting_sections( $sections ) { foreach( $sections as $section ) { // as of PPF04 we use add_setting_section() $this->add_setting_section( $section ); } // since PPF04 $this->maybe_register_setting(); } /** * add a single setting section * * @since PPF04 * @param array $sections setting section to add * @access public * @see add_settings() */ public function add_setting_section( $section ) { // as of PPF04 add sections to _sections array one by one $this->_sections[] = $section; if ( array_key_exists( 'fields', $section ) ) { $this->add_settings( $section ); } $this->maybe_register_setting(); } /** * register the setting * * @since PPF04 * @access private * * was part of add_setting_sections() before PPF04 */ public function maybe_register_setting() { if ( ! $this->_settings_registered ) { // Register the options // since PPF03 only if there is a settings class // so we can use the same function also if we don't need any settings if ( false !== $this->settings() ) { register_setting( $this->core()->get_plugin_slug(), $this->settings()->get_option_name(), array( 'sanitize_callback' => array( $this, 'sanitize_callback' ) ) ); } $this->_settings_registered = true; } } /** * helper function to add a complete setting section * * @since PPF01 * @param array $settings array of settings to add * string $section => ID of the section * int $order => sort order * this was added in PPF04, so we check if it exists for backwards compatibility * string $title => title for section (used by print_setting_sections()) * string $icon => icon for tab * since PPF05 * string $html => HTML code to add to this section * array $fields => multidimensional array of fields to add * string $key => key of the option array * string $callback => function to call * as of PPF04 this can be an array to enable external callbacks * array $callbackargs => array of arguments to pass to callback function * introduced in PPF08 * bool $nosubmit => this section should not show the submit button * @access private */ private function add_settings( $settings ) { $section_id = $this->core()->get_plugin_slug() . '-' . $settings['section']; add_settings_section( $section_id, '', null, $this->core()->get_plugin_slug() ); foreach ( $settings['fields'] as $field ) { $field_id = $this->core()->get_plugin_slug() . '-' . $field['key']; // since PPF04 if ( is_array( $field['callback'] ) ) { $callback = $field['callback']; } else { $callback = array( $this, $field['callback'] ); } $callbackargs = false; if ( isset( $field['callbackargs'] ) && is_array( $field['callbackargs'] ) ) { $callbackargs = $field['callbackargs']; } add_settings_field( $field_id, '' , $callback, $this->core()->get_plugin_slug(), $section_id, $callbackargs ); } return; } /** * helper function to print out a slider styled checkbox * * @since PPF01 * @param string $key option key name * @param string $title title * @param string $help anchor to link to in manual * @param string $video YouTube video ID * @param string $note second line * @param bool $disabled true/false (optional) * @access public */ public function print_slider_check( $key, $title, $help, $video, $note, $disabled = false ) { $dis = ''; if ( $disabled ) { $dis = ' disabled="disabled"'; } $hlp = ''; if ( ! empty( $help ) ) { $hlp = $this->add_manual_link( $help ); } $vid = ''; if ( ! empty( $video ) ) { $vid = $this->add_video_link( $video ); } $add = ''; if ( ! empty( $note ) ) { $add = '<br />' . $note; } echo '<p class="toggle"><span class="slider"><input type="checkbox" name="' . $this->settings()->get_option_key_name( $key ) . '" id="' . $this->core()->get_plugin_slug() . '-' . $key . '" value="1"' . checked( true, $this->settings()->get( $key ), false ) . $dis . ' /><label for="' . $this->core()->get_plugin_slug() . '-' . $key . '" class="check"></label></span><span class="caption">' . $title . $hlp . $vid . $add . '</span></p>'; } /** * helper function to add a plugin manual link * * @since PPF01 * @param string $anchor name of the anchor to link to * @return string * @access private */ private function add_manual_link( $anchor = '' ) { return ' <a class="dashicons dashicons-editor-help" href="https://petersplugins.com/' . $this->core()->get_plugin_slug() . '/manual/#' . $anchor . '"></a>'; } /** * helper function to add a video link * * @since PPF01 * @param string $youtubeid ID of the YouTube video * @return string * @access private */ private function add_video_link( $youtubeid = '' ) { return ' <a class="dashicons dashicons-video-alt3" href="https://youtu.be/' . $youtubeid . '" data-lity></a>'; } /** * print out setting sections * it is not possible to use do_settings_sections() because we are not able to create a tabbed interface * * @since PPF01 * @access public * @see add_settings() */ public function print_setting_sections() { $currentclass = ' current'; foreach( $this->_sections as $section ) { $section_id = $this->core()->get_plugin_slug() . '-' . $section['section']; $extraclass = ''; if ( array_key_exists( 'nosubmit', $section ) && true === $section['nosubmit'] ) { $extraclass = ' nosubmit'; } echo '<div class="panel' . $extraclass . $currentclass . '" id="content-' . $section_id . '">'; if ( array_key_exists( 'html', $section ) ) { echo '<div class="pp-admin-section-html">'; echo $section['html']; echo '</div>'; } if ( array_key_exists( 'fields', $section ) ) { echo '<table class="form-table pp-admin-section-fields">'; do_settings_fields( $this->core()->get_plugin_slug(), $section_id ); echo '</table>'; } echo '</div>'; $currentclass = ''; } } /** * print out setting sections navigation * * @since PPF01 * @access public * @see add_settings() */ public function print_setting_sections_nav() { $currentclass = ' current'; echo '<ul class="tab-navigation">'; foreach( $this->_sections as $section ) { $section_id = $this->core()->get_plugin_slug() . '-' . $section['section']; $iconclass = ''; if ( isset( $section['icon'] ) ) { $iconclass = ' has-icon icon-' . $section['icon']; } echo '<li><div class="tabset' . $currentclass . $iconclass . '" id="tab-' . $section_id . '" data-tab-content="content-' . $section_id . '">' . $section['title'] . '</div>'; $currentclass = ''; } echo '</ul>'; } /** * sanitize the posted values * * @since PPF01 * @param array $settings array of settings to save * @access public */ public function sanitize_callback( $settings ) { // since PPF06 // if wen don't get anything we need to create an empty array if ( empty( $settings ) ) { $settings = array(); } foreach ( $this->settings()->get_defaults() as $key => $value ) { if ( true === is_bool( $value ) ) { if ( ! array_key_exists( $key, $settings ) ) { // we have to add the missing keys // HTML forms only send data if a checkbox is checked // missing keys would be overwritten with their default on next load // this concerns only boolean values // if key does not exist the checkbox was not checked // so we have to handle it as false $settings[$key] = false; } else { // also we check if a given value is boolean // otherwise we reset it to false // this is for security // so it is not possible to pass non boolean values // if a checkbox was checked we get 1 // so we only have to check for 1 if ( 1 != $settings[$key] ) { $settings[$key] = false; } } } } // it is not possible to do other sanitation because we do not know what to do // more sanitation has to be done by the plugin itself return $this->sanitize_settings( $settings ); } /** * sanitize the settings * called by sanitize_callback() * this can be used to sanitize the settings after missing keys have been added * * @since PPF01 * @param array $settings array of settings to save * @access public */ public function sanitize_settings( $settings ) { return $settings; } /** * add toolbar icons * * @since PPF01 * @param array $icons array of icons to show in toolbar * string $link => URL to link to * string $title => title to show * string $icon => icon to use from dashicons * @access public */ public function add_toolbar_icons( $icons ) { $this->_toolbar = '<nav>'; foreach ( $icons as $icon ) { $this->_toolbar .= '<a href="' . esc_url( $icon['link'] ) . '" title="' . $icon['title'] . '"><span class="dashicons ' . $icon['icon'] . '"></span><span class="text">' . $icon['title'] . '</span></a>'; } $this->_toolbar .= '</nav>'; } /** * show the admin page * * @since PPF01 * @param string $capability minimum required capability to show page (optional) * @access public */ public function show( $capability = 'read' ) { if ( !current_user_can( $capability ) ) { wp_die( esc_html__( 'You do not have sufficient permissions to access this page.' ) ); } // sort the sections // see add_settings() $sort = false; foreach( $this->_sections as $section ) { if ( array_key_exists( 'order', $section ) ) { $sort = true; break; } } if ( $sort ) { usort( $this->_sections, function( $a, $b ) { return $a['order'] - $b['order']; } ); } // end of sort if ( get_current_screen()->parent_base != 'options-general' ) { // On Option Screens settings_errors() is called automatically settings_errors(); } echo '<div class="wrap pp-admin-page-wrapper" id="pp-' . $this->core()->get_plugin_slug() . '-settings"><div class="pp-admin-notice-area"><div class="wp-header-end"></div></div>'; echo '<div class="pp-admin-page-header">'; echo $this->_toolbar; echo '<div class="pp-admin-page-title"><h1>' . $this->core()->get_plugin_shortname() . '</h1>'; echo '</div>'; $this->print_setting_sections_nav(); echo '</div>'; echo '<div class="pp-admin-page-inner"><form method="POST" action="options.php">'; echo '<div class="tab-panel">'; settings_fields( $this->core()->get_plugin_slug() ); $this->print_setting_sections(); submit_button(); echo '</div></form></div>'; echo '<div class="pp-admin-page-footer"><p>Need help? <a href="https://wordpress.org/support/plugin/404page/" target="_blank">Get Support</a>.</p>'; echo '<p>⭐ Love 404 Page? <a href="https://wordpress.org/support/plugin/404page/reviews/#new-post" target="_blank">Please rate it 5-stars on WordPress.org.</a> Thank you!</p>'; echo '<p>Maintained with ❤️ and ☕ by <a href="https://www.nerdpress.net" target="_blank">NerdPress</a>.</p></div></div>'; echo '<script>var pp_admin_cookie_prefix="' . $this->core()->get_plugin_slug() . '";</script>'; wp_enqueue_style( $this->core()->get_plugin_slug() . '-ppf03', $this->get_foundation_asset_url( 'css', 'pp-admin-page.css' ) ); wp_enqueue_script( $this->core()->get_plugin_slug() . '-ppf03-cookie', $this->get_foundation_asset_url( 'js', 'jquery.cookie.js' ), array( 'jquery' ), false, true ); wp_enqueue_script( $this->core()->get_plugin_slug() . '-ppf03', $this->get_foundation_asset_url( 'js', 'pp-admin-page.js' ), array( 'jquery', $this->core()->get_plugin_slug() . '-ppf03-cookie' ), false, true ); } /** * set screen id * * @since PPF01 * @param string $id id of screen * @access public */ public function set_screen_id( $id ) { $this->_my_screen_id = $id; } /** * get screen id * * @since PPF01 * @return string * @access public */ public function get_screen_id() { return $this->_my_screen_id; } /** * show admin notice to ask for rating * this function does not show the notice immediately * this function just needs to be called and it takes care of everything * * @since PPF01 * @param array $content array of texts to show * string $title => e.g. 'Are you happy with the example plugin?' * string $subtitle => e.g. 'You've been using this plugin for a while now. Would be great to get some feedback!' * string $button_yes => e.g. 'Yes, I'm happy with it' * string $button_no => e.g. 'Not really' * string $button_later => e.g. 'Ask me later' * string $button_close => e.g. 'Never show again' * string $like => e.g. 'I'm really glad you like it. I do not ask for a donation. All I'm asking you for is to give it a good rating. Thank you very much. * string $button_rate => e.g. 'Yes, I'd like to rate it' * string $dislike => e.g. 'I'm really sorry you don't like it. Would you please do me a favor and drop me line, why you are not happy with it? Maybe I can do better...' * string $button_contact => e.g. 'Yes sure' * @param array $links array of links * string $rate => e.g. https://wordpress.org/support/plugin/example/reviews/ * string $contact => e.g. https://petersplugins.com/contact/ * @access public */ public function init_rating_notice( $content, $links ) { // quit immediately if message has already been closed if ( 'YES' == $this->core()->data_get( 'ask_rating_closed' ) ) { return; } $show_notice_start = $this->core()->data_get( 'ask_rating_start' ); // if start date is not set, set it and quit immediately if ( false === $show_notice_start ) { $this->core()->data_set( 'ask_rating_start', time() + 30 * DAY_IN_SECONDS ); $this->core()->data_save(); return; } // quit immediately if start date is not reached yet if ( time() < $show_notice_start ) { return; } // quit immediately if current user is not an admin if ( ! current_user_can( 'manage_options' ) ) { return; } $prefix = 'pp-' . $this->core()->get_plugin_slug(); $nonce = wp_create_nonce( $prefix ); // prepare to show notice add_action( 'admin_notices', function() use( $content, $links, $prefix, $nonce ) { // show notice only on certain pages // it's not possible to check this earlier, because we need the id of the current screen for that if ( ! in_array( get_current_screen()->id, array( 'dashboard', 'themes', 'plugins', 'options-general' , $this->get_screen_id() ) ) ) { return; } ?> <div class="notice notice-info" id="<?php echo $prefix; ?>-review-notice"> <h3 style="margin-bottom: 0"><?php echo $content['title']; ?></h3> <div class="<?php echo $prefix; ?>-review-notice-container"> <div id="<?php echo $prefix; ?>-review-step-1" class="<?php echo $prefix; ?>-review-notice-step"> <p><?php echo $content['subtitle']; ?></p> <p><a id="<?php echo $prefix; ?>-review-happy" class="button button-primary" href="javascript:void(0);"><?php echo $content['button_yes']; ?></a> <a id="<?php echo $prefix; ?>-review-unhappy" class="button" href="javascript:void(0);"><?php echo $content['button_no']; ?></a></p> </div> <div id="<?php echo $prefix; ?>-review-step-like" class="<?php echo $prefix; ?>-review-notice-step"> <p><?php echo $content['like']; ?></p> <p><a class="button button-primary" href="<?php echo $links['rate']; ?>"><?php echo $content['button_rate']; ?></a></p> </div> <div id="<?php echo $prefix; ?>-review-step-dislike" class="<?php echo $prefix; ?>-review-notice-step"> <p><?php echo $content['dislike']; ?></p> <p><a class="button button-primary" href="<?php echo $links['contact']; ?>"><?php echo $content['button_contact']; ?></a></p> </div> </div> <p class="wp-clearfix"><a id="<?php echo $prefix; ?>-review-later" class="<?php echo $prefix; ?>-review-action" href="javascript:void(0);"><?php echo $content['button_later']; ?></a> <a id="<?php echo $prefix; ?>-review-close" class="<?php echo $prefix; ?>-review-action" href="javascript:void(0);"><?php echo $content['button_close']; ?></a></p> </div> <?php } ); // Since PPF04 we add CSS and JS to footer for compatibility reasons add_action( 'admin_print_footer_scripts', function() use( $content, $links, $prefix, $nonce ) { // show notice only on certain pages // it's not possible to check this earlier, because we need the id of the current screen for that if ( ! in_array( get_current_screen()->id, array( 'dashboard', 'themes', 'plugins', 'options-general' , $this->get_screen_id() ) ) ) { return; } echo ' <style type="text/css"> #' . $prefix . '-review-step-like, #' . $prefix . '-review-step-dislike { display: none; } #' . $prefix . 'review-later, #' . $prefix . '-review-close, #' . $prefix . '-review-later:before, #' . $prefix . '-review-close:before { display: block; height: 20px; line-height: 20px; text-decoration: none; } #' . $prefix . '-review-later, #' . $prefix . '-review-close { float: left; position: relative; padding-left: 22px; } #' . $prefix . '-review-later { margin-right: 12px; } #' . $prefix . '-review-later:before, #' . $prefix . '-review-close:before { font-family: dashicons; font-size: 20px; position: absolute; left: 0; top: 0; } #' . $prefix . '-review-later:before { content: "\f508"; } #' . $prefix . '-review-close:before { content: "\f153"; } </style> <script type="text/javascript"> jQuery( function( $ ) { $( "#' . $prefix . '-review-happy" ).click( function() { $( "#' . $prefix . '-review-step-1" ).fadeOut( 400, function() { $( "#' . $prefix . '-review-step-like" ).fadeIn(); }); } ); $( "#' . $prefix . '-review-unhappy" ).click( function() { $( "#' . $prefix . '-review-step-1" ).fadeOut( 400, function() { $( "#' . $prefix . '-review-step-dislike" ).fadeIn(); }); } ); $( ".' . $prefix . '-review-action" ).click( function() { $.post( ajaxurl, { action : "' . $prefix . '-review-action", command : $(this).attr( "id" ), securekey : "' . $nonce .'" } ); $( "#' . $prefix . '-review-notice" ).fadeOut(); } ); } ); </script>'; } ); // prepare for ajax add_action( 'wp_ajax_' . $prefix . '-review-action', function() use( $prefix ) { check_ajax_referer( $prefix, 'securekey' ); // dies if check fails if ( isset( $_POST['command'] ) ) { if ( $prefix . '-review-later' == $_POST['command'] ) { // move start date 14 days into future $this->core()->data_set( 'ask_rating_start', time() + 14 * DAY_IN_SECONDS ); $this->core()->data_save(); } if ( $prefix . '-review-close' == $_POST['command'] ) { // do not show notice again $this->core()->data_set( 'ask_rating_closed', 'YES' ); $this->core()->data_save(); } } wp_die(); } ); } } }PK �y[eJqMR R ppf/ppf-class.phpnu �[��� <?php /** * Base Class * * Peter's Plugins Foundation 09 * * @package PPF09 * @author Peter Raschendorfer * @license GPL2+ */ if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly } if ( !class_exists( 'PPF09_Class' ) ) { abstract class PPF09_Class { /** * foundation dir * * removed in PPF02 * * @since PPF01 * @var string * @access private */ // private $_dir; /** * Init the Class * * @since PPF01 * @see getInstance */ public function __construct() { // removed in PPF02 // $this->_dir = __DIR__; } /** * get foundation directory * * @since PPF01 * @access protected * @return string */ protected function get_foundation_dir() { // since PPF02 we have to get the Directory of the Called Class to allow multiple classes based on the same Plugin Foundation $rc = new ReflectionClass( get_called_class() ); return dirname( $rc->getFileName() ) . '/ppf'; } /** * get url for foundation asset file * * @since PPF01 * @access protected * @param string $dir sub-directory of assets dir (js, css) * @param string $file filename * @return string */ protected function get_foundation_asset_url( $dir, $file ) { return plugins_url() . str_replace( WP_PLUGIN_DIR, '', $this->get_foundation_dir() ) . '/assets/' . $dir . '/' . $file; } /** * get path for foundation asset file * * @since PPF01 * @access protected * @param string $dir sub-directory of assets dir (js, css) * @param string $file filename * @return string */ protected function get_foundation_asset_path( $dir, $file ) { return plugin_dir_path( $this->get_foundation_dir() ) . 'assets/' . $dir . '/' . $file; } /** * add action * * @since PPF01 * @access public * @param string $wpaction name of the action to add * @param int $priority priority - optional - default 10 * @param int $accepted_args number of arguments the function accepts - optional - default 1 */ public function add_action( $wpaction, $priority = 10, $accepted_args = 1 ) { add_action( $wpaction, array( $this, 'action_' . $wpaction ), $priority, $accepted_args ); } /** * add multiple actions * this function does not allow to specify priority and accepted_args * * @since PPF01 * @access public * @param array $actions array of actions to add * @see add_action() */ public function add_actions( $actions ) { foreach ( $actions as $action ) { $this->add_action( $action ); } } /** * add filter * * @since PPF01 * @access public * @param string $wpfilter name of the filter to add * @param int $priority priority - optional - default 10 * @param int $accepted_args number of arguments the function accepts - optional - default 1 */ public function add_filter( $wpfilter, $priority = 10, $accepted_args = 1 ) { add_filter( $wpfilter, array( $this, 'filter_' . $wpfilter ), $priority, $accepted_args ); } } }PK �y[9*.�� � ppf/ppf-plugin-addon.phpnu �[��� <?php /** * Plugin Addon Base Class * * Peter's Plugins Foundation 09 * * @package PPF09 * @author Peter Raschendorfer * @license GPL2+ */ if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly } if ( !class_exists( 'PPF09_Plugin_Addon' ) ) { abstract class PPF09_Plugin_Addon extends PPF09_Plugin { /** * Base Plugin Name * * @since PPF04 * @var string * @access protected */ protected $base_plugin_name; /** * Base Plugin Function * * @since PPF04 * @var string * @access protected */ protected $base_plugin_function; /** * Base Plugin Min Required Version * * @since PPF04 * @var string * @access protected */ protected $base_plugin_min_version; /** * Init the Class * * @since PPF04 * same as PPFxx_Plugin plus * @type string $base_plugin_name Name of Base Plugin * @type string $base_plugin_function Function to access Base Plugin * @type string $base_plugin_min_version Minimal required version of Base Plugin */ public function __construct( $settings ) { $this->plugin_file = $settings['file']; $this->plugin_slug = $settings['slug']; $this->plugin_name = $settings['name']; $this->plugin_shortname = $settings['shortname']; $this->plugin_version = $settings['version']; $this->base_plugin_name = $settings['base_plugin_name']; $this->base_plugin_function = $settings['base_plugin_function']; $this->base_plugin_min_version = $settings['base_plugin_min_version']; $this->_data_key = str_replace( '-', '_', $settings['slug'] ) . '_data'; $this->data_load(); $this->addon_check(); } /** * get Base Plugin Name * * @since PPF04 * @access public * @return string */ public function get_base_plugin_name() { return $this->base_plugin_name; } /** * get Base Plugin Function * * @since PPF04 * @access public * @return string */ public function get_base_plugin_function() { return $this->base_plugin_function; } /** * get Base Plugin minimum required version^ * * @since PPF04 * @access public * @return string */ public function get_base_plugin_min_version() { return $this->base_plugin_min_version; } /** * check if base plugin exists and has required minimum version * * @since PPF04 * @access private */ private function addon_check() { // we need to place all the stuff in plugins_loaded to ensure the base plugin is loaded add_action( 'plugins_loaded', function() { $this->plugin_install_update(); $this->plugin_init(); if ( ! $this->base_exists() ) { add_action('admin_notices', array( $this, 'admin_notice_base_plugin_not_found' ) ); } elseif ( version_compare( $this->get_base_plugin_min_version(), $this->call_base()->get_plugin_version(), '>' ) ) { add_action('admin_notices', array( $this, 'admin_notice_base_plugin_version_insufficient' ) ); } else { $this->addon_init(); } } ); } /** * call base plugin * * @since PPF04 */ public function call_base() { $base = $this->get_base_plugin_function(); if ( function_exists( $base ) ) { return $base(); } return false; } /** * check if base function exists * * @since PPF04 */ public function base_exists() { $base = $this->get_base_plugin_function(); if ( function_exists( $base ) ) { return true; } return false; } /** * addon init * * force to be defined * * @since PPF04 */ abstract public function addon_init(); /** * add admin notice if base plugin not found * * force to be defined * * @since PPF04 */ abstract public function admin_notice_base_plugin_not_found(); /** * add admin notice if base plugin version insufficient * * force to be defined * * @since PPF04 */ abstract public function admin_notice_base_plugin_version_insufficient(); } }PK �y[ h�ɹ- �- ppf/ppf-plugin.phpnu �[��� <?php /** * Plugin Base Class * * Peter's Plugins Foundation 09 * * @package PPF09 * @author Peter Raschendorfer * @license GPL2+ */ if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly } if ( !class_exists( 'PPF09_Plugin' ) ) { abstract class PPF09_Plugin extends PPF09_Class { /** * Instances * * since PPF02 this is an array to allow multiple classes based on the same Plugin Foundation * * @since PPF02 * @var singleton * @access protected */ protected static $_instances = array(); /** * Plugin Name * * @since PPF01 * @var string * @access protected * was private prior to PPF04 */ protected $plugin_name; /** * Plugin Short Name (for Display) * * @since PPF01 * @var string * @access protected * was private prior to PPF04 */ protected $plugin_shortname; /** * Plugin File * * @since PPF01 * @var string * @access protected * was private prior to PPF04 */ protected $plugin_file; /** * Plugin Base Dir * * @since PPF01 * @var string * @access protected * was private prior to PPF04 */ protected $plugin_dir; /** * Plugin Slug * * @since PPF01 * @var string * @access protected * was private prior to PPF04 */ protected $plugin_slug; /** * Plugin Version * * @since PPF01 * @var int * @access protected * was private prior to PPF04 */ protected $plugin_version; /** * name of plugin data in databse (meta_key) * * @since PPF01 * @var string * @access protected * was private prior to PPF04 */ protected $_data_key; /** * stored data * * @since PPF01 * @var array * @access protected * was private prior to PPF04 */ protected $_data; /** * Settings Class ( if the plugin uses settings ) * * @since PPF01 * @var object * @access protected * was private prior to PPF04 */ protected $settings; /** * Init the Class * * @since PPF01 * @see getInstance * @access public - must be public due to an error in PHP 7.1 - fixed in PHP 7.2 */ public function __construct( $settings ) { $this->plugin_file = $settings['file']; $this->plugin_slug = $settings['slug']; $this->plugin_name = $settings['name']; $this->plugin_shortname = $settings['shortname']; $this->plugin_version = $settings['version']; $this->plugin_dir = dirname( $settings['file'] ); $this->_data_key = str_replace( '-', '_', $settings['slug'] ) . '_data'; $this->data_load(); $this->plugin_install_update(); $this->plugin_init(); } /** * plugin init * * force to be defined * * @since PPF01 */ abstract public function plugin_init(); /** * Prevent Cloning * * @since PPF01 */ final protected function __clone() {} /** * Get the Instance * * @since PPF01 * @param array $settings { * @type string $file Plugin Main File Path and Name * @type string $slug Plugin Slug * @type string $name Plugin Name * @type string $version Plugin Verion * } * @return singleton */ final public static function getInstance( $settings ) { $calledClass = get_called_class(); if ( !isset( self::$_instances[$calledClass] ) ) { self::$_instances[$calledClass] = new $calledClass( $settings ); } return self::$_instances[$calledClass]; } /** * get plugin file * * @since PPF01 * @access public * @return string */ public function get_plugin_file() { return $this->plugin_file; } /** * get plugin slug * * @since PPF01 * @access public * @return string */ public function get_plugin_slug() { return $this->plugin_slug; } /** * get plugin name * * @since PPF01 * @access public * @return string */ public function get_plugin_name() { return $this->plugin_name; } /** * get plugin shortname * * @since PPF01 * @access public * @return string */ public function get_plugin_shortname() { return $this->plugin_shortname; } /** * get plugin version * * @since PPF01 * @access public * @return string */ public function get_plugin_version() { return $this->plugin_version; } /** * get url for asset file * * @since PPF01 * @access public * @param string $dir sub-directory of assets dir (js, css) * @param string $file filename * @return string */ public function get_asset_url( $dir, $file ) { return plugins_url( 'assets/' . $dir . '/' . $file, $this->get_plugin_file() ); } /** * get path for asset file * * @since PPF01 * @access public * @param string $dir sub-directory of assets dir (js, css) * @param string $file filename * @return string */ public function get_asset_path( $dir, $file ) { return plugin_dir_path( $this->get_plugin_file() ) . 'assets/' . $dir . '/' . $file; } /** * add a sub class * * @since PPF01 * @access private * @param string $class name of the class * @param string $file class file without extension php (must bei located in inc dir) * @param object $_core the core class * @param object $_settings the settings class (optional) * @return class */ private function add_sub_class( $class, $file, $_core, $_settings = false ) { require_once plugin_dir_path( $this->get_plugin_file() ) . 'inc/' . $file . '.php'; return new $class( $_core, $_settings); } /** * add a sub class as well in frontend as in backend * * @since PPF01 * @access public * @uses add_sub_class() * @return class */ public function add_sub_class_always( $class, $file, $_core, $_settings = false ) { return $this->add_sub_class( $class, $file, $_core, $_settings ); } /** * add a sub class only in frontend * * @since PPF01 * @access public * @uses add_sub_class() * @return class or false */ public function add_sub_class_frontend( $class, $file, $_core, $_settings = false ) { if ( ! is_admin() ) { return $this->add_sub_class( $class, $file, $_core, $_settings ); } return false; } /** * add a sub class only in backend * * @since PPF01 * @access public * @uses add_sub_class() * @return class or false */ public function add_sub_class_backend( $class, $file, $_core, $_settings = false ) { if ( is_admin() ) { return $this->add_sub_class( $class, $file, $_core, $_settings ); } return false; } /** * add the settings class ( if the plugin uses settings ) * * @since PPF01 * @access public * @param string $class name of the class * @param string $file class file without extension php (must bei located in inc dir) * @param object $_core the core class * @param object $defaults the settings defaults */ public function add_settings_class( $class, $file, $_core, $defaults ) { require_once plugin_dir_path( $this->get_plugin_file() ) . 'inc/' . $file . '.php'; $this->settings = new $class( $_core, $defaults ); } /** * get settings class * * @since PPF01 * @access public * @return object */ public function settings() { return $this->settings; } /** * do plugin install or update * * @since PPF01 * @access protected (since PPF04, was private before) */ protected function plugin_install_update() { $version = $this->data_get( 'current_version' ); if ( false === $version || version_compare( $version, $this->get_plugin_version(), '<' ) ) { if ( false === $version ) { // the plugin was not installed before (or the plugin foundation was not used before...) $this->do_plugin_install(); } else { // do updates if needed $this->do_plugin_update( $version, $this->get_plugin_version() ); } $this->data_set( 'current_version', $this->get_plugin_version() ); $this->data_save(); } } /** * plugin install * * to be overwritten * * @since PPF01 * @access public */ public function do_plugin_install() {} /** * plugin update * * to be overwritten * * @since PPF01 * @access public */ public function do_plugin_update( $stored_version, $actual_version ) {} /** * load plugin data from database * * @since PPF01 * @access public */ public function data_load() { $this->_data = get_option( $this->_data_key, array() ); } /** * get a data value * * @since PPF01 * @param string $key data key * @access public */ public function data_get( $key ) { if ( is_array( $this->_data ) && array_key_exists( $key, $this->_data ) ) { return $this->_data[$key]; } else { return false; } } /** * set a data value * * @since PPF01 * @param string $key data key * @param string $value new value * @access public */ public function data_set( $key, $value ) { return $this->_data[$key] = $value; } /** * save data to database * * @since PPF01 * @access public */ public function data_save() { update_option( $this->_data_key, $this->_data ); } /** * remove all data from database * * @since PPF01 * @access public */ public function data_remove() { delete_option( $this->_data_key ); } } }PK �y[�6S�s s ppf/ppf-settings.phpnu �[��� <?php /** * Settings Class * * Peter's Plugins Foundation 09 * * @package PPF09 * @author Peter Raschendorfer * @license GPL2+ */ if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly } if ( !class_exists( 'PPF09_Settings' ) ) { abstract class PPF09_Settings extends PPF09_SubClass { /** * name of settings in databse (meta_key) * * @since PPF01 * @var string * @access protected * was private prior to PPF04 */ protected $_key; /** * current settings * * @since PPF01 * @var array * @access protected * was private prior to PPF04 */ protected $_settings; /** * settings defaults * * @since PPF01 * @var array * @access protected * was private prior to PPF04 */ protected $_defaults; /** * Init the Class * * @since PPF01 * @access public */ public function __construct( $_core, $defaults ) { parent::__construct( $_core, false ); $this->_key = $this->get_option_name(); $this->_defaults = $defaults; $this->load(); } /** * Sub-Class init * do nothing * * @since PPF01 * @access public */ public function init() { } /** * get option name for settings * * @since PPF01 * @access public * @return string option name */ public function get_option_name() { return str_replace( '-', '_', $this->core()->get_plugin_slug() ) . '_settings'; } /** * load settings from database * settings are automatically loaded, but reload can be forced from outside * * @since PPF01 * @access public */ public function load() { $this->_settings = get_option( $this->_key, array() ); $this->_settings = wp_parse_args( $this->_settings, $this->_defaults ); $this->sanitize_settings(); } /** * sanitize settings * this function can be used to sanitize settings after they are loaded * * @since PPF01 * @access public */ public function sanitize_settings() { // Just to be defined here } /** * get a settings value * * @since PPF01 * @param string $key settings key * @access public */ public function get( $key ) { // as of PPF04 we check if the key exists if ( array_key_exists( $key, $this->_settings ) ) { return $this->_settings[$key]; } else { return null; } } /** * set a settings value * * @since PPF01 * @param string $key settings key * @param string $value new value * @access public */ public function set( $key, $value ) { return $this->_settings[$key] = $value; } /** * save settings to database * * @since PPF01 * @access public */ public function save() { update_option( $this->_key, $this->_settings ); } /** * get option key name for HTML form fields * * @since PPF01 * @param string $key settings key * @access public * @return string option key name */ public function get_option_key_name( $key ) { return $this->get_option_name() . '[' . $key . ']'; } /** * get the defaults * * @since PPF01 * @access public * @return array defaults */ public function get_defaults() { return $this->_defaults; } /** * remove * * @since PPF01 * @access public */ public function remove() { delete_option( $this->_key ); } } }PK �y[�DI� � ppf/ppf-subclass.phpnu �[��� <?php /** * Plugin Base Sub-Class * * Peter's Plugins Foundation 09 * * @package PPF09 * @author Peter Raschendorfer * @license GPL2+ */ if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly } if ( !class_exists( 'PPF09_SubClass' ) ) { abstract class PPF09_SubClass extends PPF09_Class { /** * reference to core class * * @since PPF01 * @var object * @access protected * was private prior to PPF04 */ protected $_core; /** * reference to settings class * * @since PPF01 * @var object * @access protected * was private prior to PPF04 */ protected $_settings; /** * Init the Class * * @since PPF01 * @access public */ public function __construct( $_core, $_settings = false ) { parent::__construct(); $this->_core = $_core; $this->_settings = $_settings; $this->init(); } /** * Sub-Class init * * force to be defined * * @since PPF01 */ abstract public function init(); /** * get core class * * @since PPF01 * @access public * @return object */ public function core() { return $this->_core; } /** * get settings class * * @since PPF01 * @access public * @return object */ public function settings() { return $this->_settings; } } }PK �y[�R�b>