Initial commit
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
/**
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
namespace WCFE\Libraries\CSS\jQuery\Theme;
|
||||
|
||||
# Script resource
|
||||
use WPPFW\Services\Queue\StyleResource;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class Theme extends StyleResource {
|
||||
|
||||
/**
|
||||
* put your comment there...
|
||||
*
|
||||
* @var mixed
|
||||
*/
|
||||
protected $fileName = 'jquery-ui.min.css';
|
||||
|
||||
}
|
||||
|
After Width: | Height: | Size: 212 B |
|
After Width: | Height: | Size: 208 B |
|
After Width: | Height: | Size: 335 B |
|
After Width: | Height: | Size: 207 B |
|
After Width: | Height: | Size: 262 B |
|
After Width: | Height: | Size: 262 B |
|
After Width: | Height: | Size: 332 B |
|
After Width: | Height: | Size: 280 B |
|
After Width: | Height: | Size: 6.8 KiB |
|
After Width: | Height: | Size: 4.4 KiB |
|
After Width: | Height: | Size: 6.8 KiB |
|
After Width: | Height: | Size: 6.8 KiB |
|
After Width: | Height: | Size: 4.4 KiB |
7
wordpress_plugins/wp-config-file-editor/Libraries/CSS/jQuery/Theme/jquery-ui.min.css
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
/**
|
||||
*
|
||||
*/
|
||||
|
||||
namespace WCFE\Libraries\Forms\Rules;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class RequiredField extends \WPPFW\Forms\Rules\RequiredField
|
||||
{
|
||||
|
||||
/**
|
||||
* put your comment there...
|
||||
*
|
||||
* @param mixed $message
|
||||
*/
|
||||
protected function getMessageString( $message )
|
||||
{
|
||||
|
||||
switch ( $message )
|
||||
{
|
||||
case self::MSG_CANNOT_EMPTY:
|
||||
|
||||
return \WCFE\Plugin::__( 'Field Cannot be empty' );
|
||||
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
$string = false;
|
||||
}
|
||||
|
||||
return $string;
|
||||
}
|
||||
|
||||
}
|
||||
|
After Width: | Height: | Size: 2.5 KiB |
|
After Width: | Height: | Size: 1.5 KiB |
|
After Width: | Height: | Size: 1.5 KiB |
@@ -0,0 +1,158 @@
|
||||
<?php
|
||||
/**
|
||||
*
|
||||
*/
|
||||
|
||||
namespace WCFE\Libraries;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
abstract class InstallerService extends \WCFE\Libraries\PersistObject {
|
||||
|
||||
const STATE_FRESH_INSTALL = 2;
|
||||
const STATE_INSTALLED = 0;
|
||||
const STATE_UPGRADE = -1;
|
||||
const STATE_DOWNGRADE = 1;
|
||||
|
||||
|
||||
/**
|
||||
* put your comment there...
|
||||
*
|
||||
* @var mixed
|
||||
*/
|
||||
private $currentVersion;
|
||||
|
||||
/**
|
||||
* put your comment there...
|
||||
*
|
||||
* @var mixed
|
||||
*/
|
||||
protected $installedVersion;
|
||||
|
||||
/**
|
||||
* put your comment there...
|
||||
*
|
||||
* @var mixed
|
||||
*/
|
||||
protected $_upgraders = array();
|
||||
|
||||
/**
|
||||
* put your comment there...
|
||||
*
|
||||
* @param \WPPFW\Obj\IFactory $factory
|
||||
* @param mixed $currentVersion
|
||||
* @return InstallerService
|
||||
*/
|
||||
public function __construct( \WPPFW\Obj\IFactory & $factory )
|
||||
{
|
||||
|
||||
$stateAdapter = new \WPPFW\MVC\Model\State\GlobalWPOptionsModelState( $factory, get_class( $this ) );
|
||||
|
||||
parent::__construct( $stateAdapter );
|
||||
|
||||
$this->currentVersion = $this->_getCurrentVersion();
|
||||
}
|
||||
|
||||
/**
|
||||
* put your comment there...
|
||||
*
|
||||
*/
|
||||
protected abstract function _getCurrentVersion();
|
||||
|
||||
/**
|
||||
* put your comment there...
|
||||
*
|
||||
*/
|
||||
public function getInstalledVersion()
|
||||
{
|
||||
return $this->installedVersion;
|
||||
}
|
||||
|
||||
/**
|
||||
* put your comment there...
|
||||
*
|
||||
*/
|
||||
public function getState()
|
||||
{
|
||||
|
||||
$installedVersion = $this->getInstalledVersion();
|
||||
|
||||
return ( ! $installedVersion ) ?
|
||||
self::STATE_FRESH_INSTALL :
|
||||
version_compare( $installedVersion, $this->currentVersion );
|
||||
}
|
||||
|
||||
/**
|
||||
* put your comment there...
|
||||
*
|
||||
*/
|
||||
public final function install()
|
||||
{
|
||||
return $this->processUpgraders( 0 );
|
||||
}
|
||||
|
||||
/**
|
||||
* put your comment there...
|
||||
*
|
||||
* @param mixed $startIndex
|
||||
*/
|
||||
protected function processUpgraders( $startIndex )
|
||||
{
|
||||
|
||||
# Run all upgraders, stop on error
|
||||
for ( $currentIndex = $startIndex; $currentIndex < count( $this->_upgraders ) ; $currentIndex++ )
|
||||
{
|
||||
|
||||
$upgraderName = str_replace( array( '.', '-' ), array( '', '_' ), $this->_upgraders[ $currentIndex ] );
|
||||
|
||||
$upgraderMethodName = "upgrade_{$upgraderName}";
|
||||
|
||||
if ( method_exists( $this, $upgraderMethodName ) )
|
||||
{
|
||||
|
||||
if ( ! $this->$upgraderMethodName() )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
# Set version number
|
||||
$this->installedVersion = $this->currentVersion;
|
||||
|
||||
# Save state
|
||||
$this->writeState();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* put your comment there...
|
||||
*
|
||||
*/
|
||||
public function uninstall() { }
|
||||
|
||||
/**
|
||||
* put your comment there...
|
||||
*
|
||||
*/
|
||||
public final function upgrade()
|
||||
{
|
||||
|
||||
$result = false;
|
||||
|
||||
$installedVersion = $this->getInstalledVersion();
|
||||
|
||||
$installedVersionUIdx = array_search( $installedVersion, $this->_upgraders );
|
||||
|
||||
if ( $installedVersionUIdx !== FALSE )
|
||||
{
|
||||
$result = $this->processUpgraders( $installedVersionUIdx );
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
/**
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
namespace WCFE\Libraries\JavaScript\AceEditor;
|
||||
|
||||
# Script resource
|
||||
use WPPFW\Services\Queue\ScriptResource;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class Theme extends ScriptResource {
|
||||
|
||||
/**
|
||||
* put your comment there...
|
||||
*
|
||||
* @var mixed
|
||||
*/
|
||||
protected $fileName = 'theme-xcode.js';
|
||||
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
/**
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
namespace WCFE\Libraries\JavaScript\AceEditor;
|
||||
|
||||
# Script resource
|
||||
use WPPFW\Services\Queue\ScriptResource;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class ACEditor extends ScriptResource {
|
||||
|
||||
/**
|
||||
* put your comment there...
|
||||
*
|
||||
* @var mixed
|
||||
*/
|
||||
protected $fileName = 'ace.js';
|
||||
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
/**
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
namespace WCFE\Libraries\JavaScript\AceEditor;
|
||||
|
||||
# Script resource
|
||||
use WPPFW\Services\Queue\ScriptResource;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class ACEExtLanguageTools extends ScriptResource {
|
||||
|
||||
/**
|
||||
* put your comment there...
|
||||
*
|
||||
* @var mixed
|
||||
*/
|
||||
protected $fileName = 'ext-language_tools.js';
|
||||
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
/**
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
namespace WCFE\Libraries\JavaScript\AceEditor;
|
||||
|
||||
# Script resource
|
||||
use WPPFW\Services\Queue\ScriptResource;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class ACEExtSearchBox extends ScriptResource {
|
||||
|
||||
/**
|
||||
* put your comment there...
|
||||
*
|
||||
* @var mixed
|
||||
*/
|
||||
protected $fileName = 'ext-searchbox.js';
|
||||
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
/**
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
namespace WCFE\Libraries\JavaScript\AceEditor;
|
||||
|
||||
# Script resource
|
||||
use WPPFW\Services\Queue\ScriptResource;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class ACEModePHP extends ScriptResource {
|
||||
|
||||
/**
|
||||
* put your comment there...
|
||||
*
|
||||
* @var mixed
|
||||
*/
|
||||
protected $fileName = 'mode-php.js';
|
||||
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
define("ace/theme/xcode",["require","exports","module","ace/lib/dom"],function(e,t,n){t.isDark=!1,t.cssClass="ace-xcode",t.cssText=".ace-xcode .ace_gutter {background: #e8e8e8;color: #333}.ace-xcode .ace_print-margin {width: 1px;background: #e8e8e8}.ace-xcode {background-color: #FFFFFF;color: #000000}.ace-xcode .ace_cursor {color: #000000}.ace-xcode .ace_marker-layer .ace_selection {background: #B5D5FF}.ace-xcode.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px #FFFFFF;}.ace-xcode .ace_marker-layer .ace_step {background: rgb(198, 219, 174)}.ace-xcode .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid #BFBFBF}.ace-xcode .ace_marker-layer .ace_active-line {background: rgba(0, 0, 0, 0.071)}.ace-xcode .ace_gutter-active-line {background-color: rgba(0, 0, 0, 0.071)}.ace-xcode .ace_marker-layer .ace_selected-word {border: 1px solid #B5D5FF}.ace-xcode .ace_constant.ace_language,.ace-xcode .ace_keyword,.ace-xcode .ace_meta,.ace-xcode .ace_variable.ace_language {color: #C800A4}.ace-xcode .ace_invisible {color: #BFBFBF}.ace-xcode .ace_constant.ace_character,.ace-xcode .ace_constant.ace_other {color: #275A5E}.ace-xcode .ace_constant.ace_numeric {color: #3A00DC}.ace-xcode .ace_entity.ace_other.ace_attribute-name,.ace-xcode .ace_support.ace_constant,.ace-xcode .ace_support.ace_function {color: #450084}.ace-xcode .ace_fold {background-color: #C800A4;border-color: #000000}.ace-xcode .ace_entity.ace_name.ace_tag,.ace-xcode .ace_support.ace_class,.ace-xcode .ace_support.ace_type {color: #790EAD}.ace-xcode .ace_storage {color: #C900A4}.ace-xcode .ace_string {color: #DF0002}.ace-xcode .ace_comment {color: #008E00}.ace-xcode .ace_indent-guide {background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==) right repeat-y}";var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass)})
|
||||
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
/**
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
namespace WCFE\Libraries\JavaScript;
|
||||
|
||||
# Script resource
|
||||
use WPPFW\Services\Queue\ScriptResource;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class ChechboxList extends ScriptResource {
|
||||
|
||||
/**
|
||||
* put your comment there...
|
||||
*
|
||||
* @var mixed
|
||||
*/
|
||||
protected $fileName = 'checkbox-list.js';
|
||||
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
/**
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
namespace WCFE\Libraries\JavaScript;
|
||||
|
||||
# Script resource
|
||||
use WPPFW\Services\Queue\ScriptResource;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class ErrorsDialog extends ScriptResource {
|
||||
|
||||
/**
|
||||
* put your comment there...
|
||||
*
|
||||
* @var mixed
|
||||
*/
|
||||
protected $fileName = 'ErrorsDialog.js';
|
||||
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
|
||||
|
||||
( function( $ )
|
||||
{
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
WCFEErrorsDialog = new function()
|
||||
{
|
||||
|
||||
this.show = function( errorsList )
|
||||
{
|
||||
|
||||
// Create errors list
|
||||
var errorsListEle = $( '#wcfe-errors-dialog-errors-list' ).empty();
|
||||
|
||||
for ( var errIndex = 0; errIndex < errorsList.length; errIndex ++ )
|
||||
{
|
||||
errorsListEle.append( '<li>' + errorsList[ errIndex ] + '</li>' );
|
||||
}
|
||||
|
||||
// Show Popup
|
||||
tb_show( WCFEErrorsDialogL10N.title , '#TB_inline?inlineId=wcfe-errors-dialog&width=500px&height=400px' )
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
} ) ( jQuery );
|
||||
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
/**
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
return array
|
||||
(
|
||||
'title' => $this->__( 'Config File Editor Errors' ),
|
||||
);
|
||||
@@ -0,0 +1,437 @@
|
||||
/**
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
( function( $ )
|
||||
{
|
||||
|
||||
/**
|
||||
* put your comment there...
|
||||
*
|
||||
*/
|
||||
var editInput, childListToggler, addNewChildEle;
|
||||
|
||||
/**
|
||||
* put your comment there...
|
||||
*
|
||||
*/
|
||||
var _onediting = function( event )
|
||||
{
|
||||
|
||||
if ( event.keyCode == 13 )
|
||||
{
|
||||
|
||||
// End Edit
|
||||
endEdit( 'save' );
|
||||
|
||||
// Dont submit
|
||||
return false;
|
||||
}
|
||||
else if ( event.keyCode == 27 )
|
||||
{
|
||||
endEdit();
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* put your comment there...
|
||||
*
|
||||
* @param event
|
||||
*/
|
||||
var _oninlineadd = function( event )
|
||||
{
|
||||
var link = $( this );
|
||||
|
||||
// Get parent checkbox name
|
||||
var li = link.parent().parent();
|
||||
var parentName = li.find( '>input[type="checkbox"]' ).prop( 'name' );
|
||||
|
||||
// Create new checkbox item from parent checkbox
|
||||
var newLi = li.clone()
|
||||
newLi.find( '>ul' ).remove();
|
||||
newLi.find( '>span' ).text( '' );
|
||||
|
||||
newLi.find( 'input[type="checkbox"]' ).prop( 'name', parentName );
|
||||
|
||||
li.find( '>ul' ).prepend( newLi );
|
||||
|
||||
_onedit( { target : newLi.find( '>span' ).get( 0 ) } );
|
||||
|
||||
link.hide();
|
||||
|
||||
return false;
|
||||
};
|
||||
|
||||
/**
|
||||
* put your comment there...
|
||||
*
|
||||
*/
|
||||
var _oninputaddnew = function( event )
|
||||
{
|
||||
switch ( event.keyCode )
|
||||
{
|
||||
case 13:
|
||||
|
||||
var input = $( event.target );
|
||||
|
||||
// Add to checkbox list when pressing enter
|
||||
var list = input.prev();
|
||||
var listItem = $( '<li></li>' ).appendTo( list );
|
||||
var itemName = input.prop( 'id' ) + '[]';
|
||||
var textEle;
|
||||
var options = list.data( 'WCFECheckboxList' ).options;
|
||||
|
||||
$( '<input type="checkbox" name="' + itemName + '" value="' + input.val() + '" checked="checked" />' )
|
||||
|
||||
.appendTo( listItem )
|
||||
|
||||
.after( textEle = $( '<span>' + input.val() + '</span>' ) );
|
||||
|
||||
if ( options.allowEdit )
|
||||
{
|
||||
textEle.click( _onedit );
|
||||
}
|
||||
|
||||
// Clear input
|
||||
input.val( '' );
|
||||
|
||||
return false;
|
||||
break;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* put your comment there...
|
||||
*
|
||||
* @param event
|
||||
*/
|
||||
var _onedit = function( event )
|
||||
{
|
||||
var li = $( event.target.parentNode );
|
||||
var textEle = $( event.target );
|
||||
|
||||
// Expand list
|
||||
li.parent().addClass( 'expanded' ).show();
|
||||
|
||||
textEle.hide();
|
||||
|
||||
// Show input with checkbox value
|
||||
editInput.insertBefore( textEle )
|
||||
.css( { width : '40%' } )
|
||||
.val( textEle.text() )
|
||||
.show()
|
||||
.focus();
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
* put your comment there...
|
||||
*
|
||||
*/
|
||||
var _onunchecked = function( event )
|
||||
{
|
||||
deleteItem( event.target );
|
||||
};
|
||||
|
||||
/**
|
||||
* put your comment there...
|
||||
*
|
||||
* @param checkbox
|
||||
*/
|
||||
var deleteItem = function( checkbox )
|
||||
{
|
||||
editInput.detach();
|
||||
childListToggler.detach();
|
||||
|
||||
if ( addNewChildEle )
|
||||
{
|
||||
addNewChildEle.detach();
|
||||
}
|
||||
|
||||
$( checkbox ).parent().remove();
|
||||
};
|
||||
|
||||
/**
|
||||
* put your comment there...
|
||||
*
|
||||
*/
|
||||
var endEdit = function( action )
|
||||
{
|
||||
|
||||
var li = editInput.parent();
|
||||
var checkbox = li.find( 'input[type="checkbox"]' );
|
||||
var textEle = li.find( '>span' );
|
||||
value = editInput.val();
|
||||
|
||||
if ( editInput.css( 'display' ) == 'none' )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// hide edit input element
|
||||
editInput.hide();
|
||||
|
||||
textEle.show();
|
||||
|
||||
// Remove if new and no value specified
|
||||
if ( ! value || action == undefined )
|
||||
{
|
||||
|
||||
if ( ! textEle.text() )
|
||||
{
|
||||
|
||||
deleteItem( checkbox );
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
// Save edit
|
||||
textEle.text( value );
|
||||
|
||||
// Setting name
|
||||
var checkboxName = checkbox.prop( 'name' );
|
||||
var newCheckboxName = checkboxName.replace( /\[[^\]]*\]$/, '[' + value + ']' );
|
||||
|
||||
// Add [] if current level is container (can has childs)
|
||||
/// TEMP SOLUTION TO CHECK 0
|
||||
if ( li.parent().data( 'wcfe-ui-hierarchical-component-level' ) == 0 )
|
||||
{
|
||||
newCheckboxName += '[]';
|
||||
}
|
||||
|
||||
checkbox.prop( 'name', newCheckboxName );
|
||||
};
|
||||
|
||||
/**
|
||||
* put your comment there...
|
||||
*
|
||||
* @param list
|
||||
*/
|
||||
var inlineAddNew = function( list )
|
||||
{
|
||||
var checkbox = $( '<input type="checkbox" value="1" checked="checked" />' );
|
||||
var textEle = $( '<span></span>' );
|
||||
var li = $( '<li></li>' );
|
||||
var childList = $( '<ul class="checkbox-row wcfe-ui-hierarchical-component-level_1"></ul>' );
|
||||
var args = list.data( 'WCFECheckboxList' ).options;
|
||||
var baseName = list.parent().find( '#' + list.prop( 'id' ) + '-baseName' ).val() + '[]';
|
||||
|
||||
checkbox.prop( 'name', baseName );
|
||||
|
||||
li.append( checkbox ).append( textEle ).append( childList );
|
||||
|
||||
list.prepend( li );
|
||||
|
||||
_onedit( { target : textEle.get( 0 ) } );
|
||||
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* put your comment there...
|
||||
*
|
||||
* @param list
|
||||
*/
|
||||
var setListLevels = function( list, level )
|
||||
{
|
||||
|
||||
var nextLevel = level + 1;
|
||||
|
||||
// Set list level
|
||||
list.addClass( 'wcfe-ui-hierarchical-component-level_' + level );
|
||||
list.data( 'wcfe-ui-hierarchical-component-level', level );
|
||||
|
||||
// Find child lists
|
||||
list.find( '>li' ).each(
|
||||
|
||||
function()
|
||||
{
|
||||
var childList = $( this ).find( '>ul' );
|
||||
|
||||
childList.each(
|
||||
|
||||
function()
|
||||
{
|
||||
setListLevels( $( this ), nextLevel );
|
||||
}
|
||||
|
||||
);
|
||||
|
||||
}
|
||||
);
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
$.fn.WCFECheckboxList = function( options )
|
||||
{
|
||||
|
||||
var args = $.extend(
|
||||
{
|
||||
allowNew : true,
|
||||
addNewMode : 'input',
|
||||
allowEdit : false,
|
||||
newPlaceholder : null,
|
||||
addMaxLevels : -1
|
||||
}, options );
|
||||
|
||||
// Add new item
|
||||
if ( args.allowNew )
|
||||
{
|
||||
switch ( args.addNewMode )
|
||||
{
|
||||
|
||||
case 'inline':
|
||||
|
||||
var checkboxListElement = this;
|
||||
|
||||
$( '<a href="#"></a>' ).prependTo( this )
|
||||
.addClass( 'inline-add-button' )
|
||||
.text( args.levels[ 0 ].addText )
|
||||
.click(
|
||||
|
||||
function()
|
||||
{
|
||||
|
||||
inlineAddNew( $( event.target ).next() );
|
||||
|
||||
return false;
|
||||
|
||||
}
|
||||
);
|
||||
|
||||
// Allow adding child items to the max specified level
|
||||
addNewChildEle = $( '<a href="#" class="add-new-child"></a>' ).click( _oninlineadd );
|
||||
|
||||
this.delegate( 'li>span', 'mouseenter',
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
function()
|
||||
{
|
||||
|
||||
var itemEle = $( this );
|
||||
var currentLevel = itemEle.parent().parent().data( 'wcfe-ui-hierarchical-component-level' );
|
||||
|
||||
if ( currentLevel < args.addMaxLevels )
|
||||
{
|
||||
itemEle.append( addNewChildEle.show().text( args.levels[ currentLevel + 1 ].addText ) );
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
this.delegate( 'li>span', 'mouseleave',
|
||||
|
||||
function( event )
|
||||
{
|
||||
|
||||
addNewChildEle.hide();
|
||||
}
|
||||
|
||||
);
|
||||
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
this.find( '.checkbox-list-input' ).keydown( _oninputaddnew ).attr( 'placeholder', args.newPlaceholder );
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Delete
|
||||
this.delegate( 'input:checkbox', 'change', _onunchecked );
|
||||
|
||||
// Edit
|
||||
if ( args.allowEdit )
|
||||
{
|
||||
this.find( 'li>span' ).click( _onedit );
|
||||
}
|
||||
|
||||
// Set list levels
|
||||
var rootList = this.find( '>ul' );
|
||||
setListLevels( rootList, 0 );
|
||||
|
||||
editInput = $( '<input type="text" />' ).hide().keydown( _onediting ).blur( endEdit );
|
||||
childListToggler = $( '<a class="child-items-toggler" href="#"></a>' ).hide().click(
|
||||
|
||||
function()
|
||||
{
|
||||
|
||||
var childList = childListToggler.parent().next().toggle().toggleClass( 'expanded' );
|
||||
|
||||
if ( childList.hasClass( 'expanded' ) )
|
||||
{
|
||||
childListToggler.addClass( 'expanded' );
|
||||
}
|
||||
else
|
||||
{
|
||||
childListToggler.removeClass( 'expanded' );
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
);
|
||||
|
||||
// Child lists toggler
|
||||
$( this ).delegate( '>ul li', 'mouseover',
|
||||
|
||||
function()
|
||||
{
|
||||
|
||||
var itemEle = $( this );
|
||||
var list = itemEle.parent();
|
||||
var childList = itemEle.find( '>ul' );
|
||||
var currentLevel = list.data( 'wcfe-ui-hierarchical-component-level' );
|
||||
|
||||
if ( currentLevel < args.addMaxLevels )
|
||||
{
|
||||
childListToggler.prependTo( itemEle.find( '>span' ) );
|
||||
|
||||
if ( childList.hasClass( 'expanded' ) )
|
||||
{
|
||||
childListToggler.addClass( 'expanded' );
|
||||
}
|
||||
else
|
||||
{
|
||||
childListToggler.removeClass( 'expanded' );
|
||||
}
|
||||
|
||||
childListToggler.show();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
);
|
||||
|
||||
$( this ).delegate( '>ul li', 'mouseleave',
|
||||
|
||||
function()
|
||||
{
|
||||
childListToggler.detach();
|
||||
}
|
||||
|
||||
);
|
||||
|
||||
// Hold supplied instances vars for later reference
|
||||
rootList.each(
|
||||
function()
|
||||
{
|
||||
$( this ).data( 'WCFECheckboxList', { options : args } );
|
||||
}
|
||||
);
|
||||
|
||||
return this;
|
||||
};
|
||||
|
||||
} ( jQuery ) );
|
||||
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
/**
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
namespace WCFE\Libraries\JavaScript;
|
||||
|
||||
# Script resource
|
||||
use WPPFW\Services\Queue\ScriptResource;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class jQueryCookies extends ScriptResource {
|
||||
|
||||
/**
|
||||
* put your comment there...
|
||||
*
|
||||
* @var mixed
|
||||
*/
|
||||
protected $fileName = 'jquery.cookie.js';
|
||||
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
/**
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
namespace WCFE\Libraries\JavaScript;
|
||||
|
||||
# Script resource
|
||||
use WPPFW\Services\Queue\ScriptResource;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class jQueryMenu extends ScriptResource {
|
||||
|
||||
/**
|
||||
* put your comment there...
|
||||
*
|
||||
* @var mixed
|
||||
*/
|
||||
protected $fileName = 'jquery-menu-ui.min.js';
|
||||
|
||||
}
|
||||
6
wordpress_plugins/wp-config-file-editor/Libraries/JavaScript/jquery-menu-ui.min.js
vendored
Normal file
7
wordpress_plugins/wp-config-file-editor/Libraries/JavaScript/jquery-ui.min.css
vendored
Normal file
@@ -0,0 +1,117 @@
|
||||
/*!
|
||||
* 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);
|
||||
};
|
||||
|
||||
}));
|
||||
@@ -0,0 +1,121 @@
|
||||
<?php
|
||||
/**
|
||||
*
|
||||
*/
|
||||
|
||||
namespace WCFE\Libraries;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class ParseString
|
||||
{
|
||||
|
||||
/**
|
||||
* put your comment there...
|
||||
*
|
||||
* @var mixed
|
||||
*/
|
||||
protected $data = array();
|
||||
|
||||
/**
|
||||
* put your comment there...
|
||||
*
|
||||
* @param mixed $string
|
||||
* @return WCFEParserString
|
||||
*/
|
||||
public function __construct( $string )
|
||||
{
|
||||
$this->parse( $string );
|
||||
}
|
||||
|
||||
/**
|
||||
* put your comment there...
|
||||
*
|
||||
*/
|
||||
public function & getData()
|
||||
{
|
||||
return $this->data;
|
||||
}
|
||||
|
||||
/**
|
||||
* put your comment there...
|
||||
*
|
||||
* @param mixed $string
|
||||
*/
|
||||
protected function parse( $rawData )
|
||||
{
|
||||
|
||||
# Split into vars
|
||||
$vars = explode( '&', $rawData );
|
||||
|
||||
# FOr each var get name and valie operands
|
||||
foreach ( $vars as $name )
|
||||
{
|
||||
|
||||
# Get name value pairs
|
||||
$operands = explode( '=', $name );
|
||||
|
||||
# Decode name and value
|
||||
$varName = urldecode( $operands[ 0 ] );
|
||||
$varValue = urldecode( $operands[ 1 ] );
|
||||
|
||||
# Pretend that var name as child of DUMMY POST array
|
||||
preg_match( '/([a-zA-Z0-9-_]+)/', $varName, $varBaseName );
|
||||
$varBaseName = $varBaseName[ 0 ];
|
||||
|
||||
# Get array names
|
||||
preg_match_all( '/\[([^\]]*)\]/', $varName, $arrayNames, PREG_SET_ORDER );
|
||||
|
||||
array_unshift( $arrayNames, array( "[{$varBaseName}]", $varBaseName ) );
|
||||
|
||||
# Last element is the value element
|
||||
$valueElementName = array_pop( $arrayNames );
|
||||
$valueElementName = $valueElementName[ 1 ];
|
||||
|
||||
# Move inside until reaching the target element parent
|
||||
$pointer =& $this->data;
|
||||
|
||||
foreach ( $arrayNames as $arrayName )
|
||||
{
|
||||
$elementName = $arrayName[ 1 ];
|
||||
|
||||
if ( ! isset( $pointer[ $elementName ] ) )
|
||||
{
|
||||
$pointer[ $elementName ] = array();
|
||||
}
|
||||
|
||||
$pointer =& $pointer[ $elementName ];
|
||||
}
|
||||
|
||||
# Set element value
|
||||
if ( trim( $valueElementName ) )
|
||||
{
|
||||
$pointer[ $valueElementName ] = $varValue;
|
||||
}
|
||||
else
|
||||
{
|
||||
$pointer[ ] = $varValue;
|
||||
}
|
||||
|
||||
# Get outside to the root and repeat!
|
||||
$pointer =& $this->data;
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* put your comment there...
|
||||
*
|
||||
* @param mixed $string
|
||||
* @return WCFEPostRequestRawParser
|
||||
*/
|
||||
public static function & parseString( $string )
|
||||
{
|
||||
$instance = new ParseString( $string );
|
||||
|
||||
return $instance->getData();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,106 @@
|
||||
<?php
|
||||
/**
|
||||
*
|
||||
*/
|
||||
|
||||
namespace WCFE\Libraries;
|
||||
|
||||
|
||||
use WPPFW\MVC\Model\State\IModelStateAdapter;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
abstract class PersistObject
|
||||
{
|
||||
|
||||
/**
|
||||
* put your comment there...
|
||||
*
|
||||
* @var mixed
|
||||
*/
|
||||
private $stateAdapter;
|
||||
|
||||
/**
|
||||
* put your comment there...
|
||||
*
|
||||
* @param IModelStateAdapter $adapter
|
||||
* @return {PersistObject|IModelStateAdapter}
|
||||
*/
|
||||
public function __construct( IModelStateAdapter & $adapter )
|
||||
{
|
||||
|
||||
$this->stateAdapter = $adapter;
|
||||
|
||||
// Read state
|
||||
$this->readState();
|
||||
|
||||
$this->init();
|
||||
}
|
||||
|
||||
/**
|
||||
* put your comment there...
|
||||
*
|
||||
*/
|
||||
public function & getStateAdapter()
|
||||
{
|
||||
return $this->stateAdapter;
|
||||
}
|
||||
|
||||
/**
|
||||
* put your comment there...
|
||||
*
|
||||
*/
|
||||
protected function init() { }
|
||||
|
||||
/**
|
||||
* put your comment there...
|
||||
*
|
||||
*/
|
||||
public function & readState()
|
||||
{
|
||||
|
||||
$stateAdapter =& $this->getStateAdapter();
|
||||
|
||||
foreach ( $stateAdapter->read() as $propName => $value )
|
||||
{
|
||||
|
||||
$this->$propName = $value;
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* put your comment there...
|
||||
*
|
||||
*/
|
||||
public function & writeState()
|
||||
{
|
||||
|
||||
$stateVars = array();
|
||||
$stateAdapter =& $this->getStateAdapter();
|
||||
$moduleClassReflection = new \ReflectionClass( $this );
|
||||
|
||||
# Copy all protected properties
|
||||
$statePropperties = $moduleClassReflection->getProperties( \ReflectionProperty::IS_PROTECTED );
|
||||
|
||||
foreach ( $statePropperties as $property )
|
||||
{
|
||||
|
||||
$propertyName = $property->getName();
|
||||
|
||||
if ( strpos( $propertyName, '_' ) === 0 )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
$stateVars[ $propertyName ] =& $this->$propertyName;
|
||||
}
|
||||
|
||||
$stateAdapter->write( $stateVars );
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
<?php
|
||||
/**
|
||||
*
|
||||
*/
|
||||
|
||||
namespace WCFE\Libraries;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class ResStorage {
|
||||
|
||||
/**
|
||||
* put your comment there...
|
||||
*
|
||||
* @var mixed
|
||||
*/
|
||||
private $basePath;
|
||||
|
||||
/**
|
||||
* put your comment there...
|
||||
*
|
||||
* @var mixed
|
||||
*/
|
||||
private $baseUrl;
|
||||
|
||||
/**
|
||||
* put your comment there...
|
||||
*
|
||||
* @param mixed $baseUrl
|
||||
* @param mixed $basePath
|
||||
* @return ResStorage
|
||||
*/
|
||||
public function __construct( $baseUrl, $basePath )
|
||||
{
|
||||
$this->baseUrl = $baseUrl;
|
||||
$this->basePath = $basePath;
|
||||
}
|
||||
|
||||
/**
|
||||
* put your comment there...
|
||||
*
|
||||
*/
|
||||
public function getBasePath()
|
||||
{
|
||||
return $this->basePath;
|
||||
}
|
||||
|
||||
/**
|
||||
* put your comment there...
|
||||
*
|
||||
*/
|
||||
public function getBaseUrl()
|
||||
{
|
||||
return $this->baseUrl;
|
||||
}
|
||||
|
||||
/**
|
||||
* put your comment there...
|
||||
*
|
||||
* @param mixed $name
|
||||
*/
|
||||
public function & getRes( $class )
|
||||
{
|
||||
|
||||
# Get url for the requested class
|
||||
$url = $this->baseUrl;
|
||||
$path = $this->basePath;
|
||||
|
||||
$resClassEntities = explode( '\\', $class );
|
||||
|
||||
# Remove base namespace as it represnt baseUrl!
|
||||
array_shift( $resClassEntities );
|
||||
|
||||
# Remove class name
|
||||
array_pop( $resClassEntities );
|
||||
|
||||
$urlPathToRes = implode( '/', $resClassEntities );
|
||||
$filePathToRes = implode( DIRECTORY_SEPARATOR, $resClassEntities );
|
||||
|
||||
$resUrl = "{$url}/{$urlPathToRes}";
|
||||
$resPath = "{$path}/{$filePathToRes}";
|
||||
|
||||
# Generate unique name for the rquested resource
|
||||
$queueName = implode( '-', explode( '\\', strtolower( $class ) ) );
|
||||
|
||||
# Create res class
|
||||
$resObject = new $class( $queueName, $resUrl, $resPath );
|
||||
|
||||
return $resObject;
|
||||
}
|
||||
|
||||
}
|
||||