- Move get_extents function to include/functions.inc.php.
- Change all plugins version to 2.0. - LocalFiles Editor can now edit and create template extension. - Editarea (for LocalFiles Editor) go to version 0.7.2.2 (chrome compatible) - Editarea activation is now saved in database with AJAX. git-svn-id: http://piwigo.org/svn/trunk@2588 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
parent
fd0b26af45
commit
1eb3d18ae2
46 changed files with 693 additions and 351 deletions
|
@ -35,39 +35,6 @@
|
|||
* (see permalinks in our documentation for further explanation).
|
||||
*/
|
||||
|
||||
// +-----------------------------------------------------------------------+
|
||||
// | functions |
|
||||
// +-----------------------------------------------------------------------+
|
||||
|
||||
/**
|
||||
* returns a list of templates currently available in template-extension
|
||||
*
|
||||
* Each .tpl file is extracted from template-extension.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
function get_extents($start='')
|
||||
{
|
||||
if ($start == '') { $start = './template-extension'; }
|
||||
$dir = opendir($start);
|
||||
$extents = array();
|
||||
|
||||
while (($file = readdir($dir)) !== false)
|
||||
{
|
||||
if ( $file == '.' or $file == '..' or $file == '.svn') continue;
|
||||
$path = $start . '/' . $file;
|
||||
if (is_dir($path))
|
||||
{
|
||||
$extents = array_merge($extents, get_extents($path));
|
||||
}
|
||||
elseif ( !is_link($path) and file_exists($path)
|
||||
and strripos($path,'.tpl') > 0 )
|
||||
{
|
||||
$extents[] = substr($path, 21);
|
||||
}
|
||||
}
|
||||
return $extents;
|
||||
}
|
||||
// +-----------------------------------------------------------------------+
|
||||
// initialization |
|
||||
// +-----------------------------------------------------------------------+
|
||||
|
|
|
@ -1788,4 +1788,32 @@ function get_user_access_level_html_options($MinLevelAccess = ACCESS_FREE, $MaxL
|
|||
return $tpl_options;
|
||||
}
|
||||
|
||||
/**
|
||||
* returns a list of templates currently available in template-extension
|
||||
* Each .tpl file is extracted from template-extension.
|
||||
* @return array
|
||||
*/
|
||||
function get_extents($start='')
|
||||
{
|
||||
if ($start == '') { $start = './template-extension'; }
|
||||
$dir = opendir($start);
|
||||
$extents = array();
|
||||
|
||||
while (($file = readdir($dir)) !== false)
|
||||
{
|
||||
if ( $file == '.' or $file == '..' or $file == '.svn') continue;
|
||||
$path = $start . '/' . $file;
|
||||
if (is_dir($path))
|
||||
{
|
||||
$extents = array_merge($extents, get_extents($path));
|
||||
}
|
||||
elseif ( !is_link($path) and file_exists($path)
|
||||
and get_extension($path) == 'tpl' )
|
||||
{
|
||||
$extents[] = substr($path, 21);
|
||||
}
|
||||
}
|
||||
return $extents;
|
||||
}
|
||||
|
||||
?>
|
|
@ -1,9 +1,11 @@
|
|||
<?php
|
||||
/*
|
||||
Plugin Name: Advanced Menu Manager
|
||||
Version: 1.0.0
|
||||
Version: 2.0
|
||||
Description: Gestion avancée du menu / Advanced management of menu
|
||||
Plugin URI: http://phpwebgallery.net/ext/extension_view.php?eid=
|
||||
Plugin URI: http://piwigo.org
|
||||
Author: Piwigo team
|
||||
Author URI: http://piwigo.org
|
||||
*/
|
||||
|
||||
/*
|
||||
|
|
|
@ -58,11 +58,12 @@ $tabsheet->assign();
|
|||
// +-----------------------------------------------------------------------+
|
||||
// | Variables init
|
||||
// +-----------------------------------------------------------------------+
|
||||
$edited_file = '';
|
||||
$edited_file = isset($_POST['edited_file']) ? $_POST['edited_file'] : '';
|
||||
$content_file = '';
|
||||
$new_file['localconf'] = "<?php\n\n".l10n('locfiledit_newfile')."\n\n\n\n\n?>";
|
||||
$new_file['css'] = l10n('locfiledit_newfile') . "\n\n";
|
||||
$new_file['lang'] = "<?php\n\n" . l10n('locfiledit_newfile') . "\n\n\n\n\n?>";
|
||||
$new_file['localconf'] = "<?php\n\n/* ".l10n('locfiledit_newfile')." */\n\n\n\n\n?>";
|
||||
$new_file['css'] = "/* " . l10n('locfiledit_newfile') . " */\n\n";
|
||||
$new_file['tpl'] = "{* " . l10n('locfiledit_newfile') . " *}\n\n";
|
||||
$new_file['lang'] = $new_file['localconf'];
|
||||
$new_file['plug'] = "<?php\n/*
|
||||
Plugin Name: " . l10n('locfiledit_onglet_plug') . "
|
||||
Version: 1.0
|
||||
|
@ -71,16 +72,14 @@ Plugin URI: http://www.phpwebgallery.net
|
|||
Author:
|
||||
Author URI:
|
||||
*/\n\n\n\n\n?>";
|
||||
$newfile_page = isset($_GET['newfile']) ? true : false;
|
||||
|
||||
// Editarea options
|
||||
$editarea = array(
|
||||
'start_highlight' => true,
|
||||
$editarea_options = array(
|
||||
'language' => substr($user['language'], 0, 2),
|
||||
'start_highlight' => true,
|
||||
'allow_toggle' => false,
|
||||
'toolbar' => 'search,fullscreen, |,select_font, |, undo, redo, change_smooth_selection, highlight, reset_highlight, |, help');
|
||||
if (isset($conf['editarea_options']) and is_array($conf['editarea_options']))
|
||||
{
|
||||
$editarea = array_merge($editarea, $conf['editarea_options']);
|
||||
}
|
||||
|
||||
// Edit selected file for CSS, template and language
|
||||
if ((isset($_POST['edit'])) and !is_numeric($_POST['file_to_edit']))
|
||||
|
@ -90,13 +89,39 @@ if ((isset($_POST['edit'])) and !is_numeric($_POST['file_to_edit']))
|
|||
file_get_contents($edited_file) : $new_file[$page['tab']];
|
||||
}
|
||||
|
||||
// Edit new tpl file
|
||||
if (isset($_POST['create_tpl']))
|
||||
{
|
||||
$filename = $_POST['tpl_name'];
|
||||
if (get_extension($filename) != 'tpl')
|
||||
{
|
||||
$filename .= '.tpl';
|
||||
}
|
||||
if (!preg_match('/^[a-zA-Z0-9-_.]+$/', $filename))
|
||||
{
|
||||
array_push($page['errors'], l10n('locfiledit_filename_error'));
|
||||
$newfile_page = true;
|
||||
}
|
||||
if (is_numeric($_POST['tpl_model']) and $_POST['tpl_model'] != '0')
|
||||
{
|
||||
array_push($page['errors'], l10n('locfiledit_model_error'));
|
||||
$newfile_page = true;
|
||||
}
|
||||
if (file_exists($_POST['tpl_parent'] . '/' . $filename))
|
||||
{
|
||||
array_push($page['errors'], l10n('locfiledit_file_already_exists'));
|
||||
$newfile_page = true;
|
||||
}
|
||||
if (!$newfile_page)
|
||||
{
|
||||
$edited_file = $_POST['tpl_parent'] . '/' . $filename;
|
||||
$content_file = ($_POST['tpl_model'] == '0') ? $new_file['tpl'] : file_get_contents($_POST['tpl_model']);
|
||||
}
|
||||
}
|
||||
|
||||
// +-----------------------------------------------------------------------+
|
||||
// | Process tabsheet
|
||||
// +-----------------------------------------------------------------------+
|
||||
$options[] = l10n('locfiledit_choose_file');
|
||||
$selected = 0;
|
||||
|
||||
switch ($page['tab'])
|
||||
{
|
||||
case 'localconf':
|
||||
|
@ -108,11 +133,13 @@ switch ($page['tab'])
|
|||
array('SHOW_DEFAULT' => LOCALEDIT_PATH
|
||||
. 'show_default.php?file=include/config_default.inc.php',
|
||||
'FILE' => 'config_default.inc.php')));
|
||||
$editarea['syntax'] = 'php';
|
||||
$editarea_options['syntax'] = 'php';
|
||||
break;
|
||||
|
||||
case 'css':
|
||||
$template_dir = PHPWG_ROOT_PATH . 'template';
|
||||
$selected = 0;
|
||||
$options[] = l10n('locfiledit_choose_file');
|
||||
$options[] = '----------------------';
|
||||
$value = PHPWG_ROOT_PATH . "template-common/local-layout.css";
|
||||
$options[$value] = 'template-common / local-layout.css';
|
||||
|
@ -135,37 +162,110 @@ switch ($page['tab'])
|
|||
$template->assign('css_lang_tpl', array(
|
||||
'OPTIONS' => $options,
|
||||
'SELECTED' => $selected));
|
||||
$editarea['syntax'] = 'css';
|
||||
$editarea_options['syntax'] = 'css';
|
||||
break;
|
||||
|
||||
case 'tpl':
|
||||
$template_dir = PHPWG_ROOT_PATH . 'template';
|
||||
foreach (get_dirs($template_dir) as $pwg_template)
|
||||
// New file form creation
|
||||
if ($newfile_page and !is_adviser())
|
||||
{
|
||||
$dir = $template_dir . '/' . $pwg_template . '/';
|
||||
$options[] = '----------------------';
|
||||
if (is_dir($dir) and $content = opendir($dir))
|
||||
$filename = isset($_POST['tpl_name']) ? $_POST['tpl_name'] : '';
|
||||
$selected['model'] = isset($_POST['tpl_model']) ? $_POST['tpl_model'] : '0';
|
||||
$selected['parent'] = isset($_POST['tpl_parent']) ? $_POST['tpl_parent'] : PHPWG_ROOT_PATH . 'template-extension';
|
||||
|
||||
// Parent directories list
|
||||
$options['parent'] = array(PHPWG_ROOT_PATH . 'template-extension' => 'template-extension');
|
||||
$options['parent'] = array_merge($options['parent'], get_rec_dirs(PHPWG_ROOT_PATH . 'template-extension'));
|
||||
|
||||
// Model list
|
||||
$eligible_templates = array(
|
||||
'about.tpl',
|
||||
'identification.tpl',
|
||||
'mainpage_categories.tpl',
|
||||
'thumbnails.tpl',
|
||||
'redirect.tpl',
|
||||
// 'menubar.tpl'
|
||||
'header.tpl',
|
||||
'footer.tpl',
|
||||
'index.tpl',
|
||||
'nbm.tpl',
|
||||
'notification.tpl',
|
||||
'picture_content.tpl',
|
||||
'picture.tpl',
|
||||
'popuphelp.tpl',
|
||||
'profile.tpl',
|
||||
'profile_content.tpl',
|
||||
'register.tpl',
|
||||
'search.tpl',
|
||||
'search_rules.tpl',
|
||||
'slideshow.tpl',
|
||||
'tags.tpl',
|
||||
'upload.tpl');
|
||||
|
||||
$options['model'][] = l10n('locfiledit_empty_page');
|
||||
$options['model'][] = '----------------------';
|
||||
foreach (get_extents() as $pwg_template)
|
||||
{
|
||||
while ($node = readdir($content))
|
||||
$value = PHPWG_ROOT_PATH . 'template-extension/' . $pwg_template;
|
||||
$options['model'][$value] = 'template-extension / ' . str_replace('/', ' / ', $pwg_template);
|
||||
}
|
||||
$template_dir = PHPWG_ROOT_PATH . 'template';
|
||||
foreach (get_dirs($template_dir) as $pwg_template)
|
||||
{
|
||||
if (count($options['model']) > 2)
|
||||
{
|
||||
if (is_file($dir . $node)
|
||||
and strtolower(get_extension($node)) == 'tpl'
|
||||
and !strpos($node , '.bak.tpl'))
|
||||
$options['model'][] = '----------------------';
|
||||
}
|
||||
$dir = $template_dir . '/' . $pwg_template . '/';
|
||||
if (is_dir($dir) and $content = opendir($dir))
|
||||
{
|
||||
while ($node = readdir($content))
|
||||
{
|
||||
$value = $dir . $node;
|
||||
$options[$value] = $pwg_template . ' / ' . $node;
|
||||
if ($edited_file == $value) $selected = $value;
|
||||
if (is_file($dir . $node) and in_array($node, $eligible_templates))
|
||||
{
|
||||
$value = $dir . $node;
|
||||
$options['model'][$value] = $pwg_template . ' / ' . $node;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// Assign variables to template
|
||||
$template->assign('create_tpl', array(
|
||||
'NEW_FILE_NAME' => $filename,
|
||||
'MODEL_OPTIONS' => $options['model'],
|
||||
'MODEL_SELECTED' => $selected['model'],
|
||||
'PARENT_OPTIONS' => $options['parent'],
|
||||
'PARENT_SELECTED' => $selected['parent']));
|
||||
break;
|
||||
}
|
||||
// List existing template extensions
|
||||
$template_dir = PHPWG_ROOT_PATH . 'template-extension';
|
||||
$selected = 0;
|
||||
$options[] = l10n('locfiledit_choose_file');
|
||||
$options[] = '----------------------';
|
||||
foreach (get_extents() as $pwg_template)
|
||||
{
|
||||
$value = './template-extension/' . $pwg_template;
|
||||
$options[$value] = str_replace('/', ' / ', $pwg_template);
|
||||
if ($edited_file == $value) $selected = $value;
|
||||
}
|
||||
if ($selected == 0 and !empty($edited_file))
|
||||
{
|
||||
$options[$edited_file] = str_replace(array('./template-extension/', '/'), array('', ' / '), $edited_file);
|
||||
$selected = $edited_file;
|
||||
}
|
||||
$template->assign('css_lang_tpl', array(
|
||||
'OPTIONS' => $options,
|
||||
'SELECTED' => $selected));
|
||||
$editarea['syntax'] = 'html';
|
||||
'OPTIONS' => $options,
|
||||
'SELECTED' => $selected,
|
||||
'NEW_FILE_URL' => $my_base_url.'&tab=tpl&newfile',
|
||||
'NEW_FILE_CLASS' => empty($edited_file) ? '' : 'top_right'));
|
||||
|
||||
$editarea_options['syntax'] = 'html';
|
||||
break;
|
||||
|
||||
case 'lang':
|
||||
$selected = 0;
|
||||
$options[] = l10n('locfiledit_choose_file');
|
||||
$options[] = '----------------------';
|
||||
foreach (get_languages() as $language_code => $language_name)
|
||||
{
|
||||
|
@ -188,33 +288,29 @@ switch ($page['tab'])
|
|||
$template->assign('css_lang_tpl', array(
|
||||
'OPTIONS' => $options,
|
||||
'SELECTED' => $selected));
|
||||
$editarea['syntax'] = 'php';
|
||||
$editarea_options['syntax'] = 'php';
|
||||
break;
|
||||
|
||||
case 'plug':
|
||||
$edited_file = PHPWG_PLUGINS_PATH . "PersonalPlugin/main.inc.php";
|
||||
$content_file = file_exists($edited_file) ?
|
||||
file_get_contents($edited_file) : $new_file['plug'];
|
||||
$editarea['syntax'] = 'php';
|
||||
$editarea_options['syntax'] = 'php';
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
// +-----------------------------------------------------------------------+
|
||||
// | Load backup file
|
||||
// +-----------------------------------------------------------------------+
|
||||
if (isset($_POST['restore']) and !is_adviser())
|
||||
{
|
||||
$edited_file = $_POST['edited_file'];
|
||||
$content_file = file_get_contents(
|
||||
substr_replace($edited_file , '.bak' , strrpos($edited_file ,'.') , 0));
|
||||
|
||||
$content_file = file_get_contents(get_bak_file($edited_file));
|
||||
array_push($page['infos'],
|
||||
l10n('locfiledit_bak_loaded1'),
|
||||
l10n('locfiledit_bak_loaded2'));
|
||||
l10n('locfiledit_bak_loaded1'),
|
||||
l10n('locfiledit_bak_loaded2'));
|
||||
}
|
||||
|
||||
|
||||
// +-----------------------------------------------------------------------+
|
||||
// | Save file
|
||||
// +-----------------------------------------------------------------------+
|
||||
|
@ -232,33 +328,21 @@ if (isset($_POST['submit']) and !is_adviser())
|
|||
}
|
||||
else
|
||||
{
|
||||
if ($page['tab'] == 'plug'
|
||||
and !is_dir(PHPWG_PLUGINS_PATH . 'PersonalPlugin'))
|
||||
if ($page['tab'] == 'plug' and !is_dir(PHPWG_PLUGINS_PATH . 'PersonalPlugin'))
|
||||
{
|
||||
@mkdir(PHPWG_PLUGINS_PATH . "PersonalPlugin");
|
||||
}
|
||||
if (file_exists($edited_file))
|
||||
{
|
||||
@copy($edited_file,
|
||||
substr_replace($edited_file,
|
||||
'.bak',
|
||||
strrpos($edited_file , '.'),
|
||||
0)
|
||||
);
|
||||
@copy($edited_file, get_bak_file($edited_file));
|
||||
array_push($page['infos'], sprintf(l10n('locfiledit_saved_bak'), substr(get_bak_file($edited_file), 2)));
|
||||
}
|
||||
|
||||
if ($file = @fopen($edited_file , "w"))
|
||||
{
|
||||
@fwrite($file , $content_file);
|
||||
@fclose($file);
|
||||
array_push($page['infos'],
|
||||
l10n('locfiledit_save_config'),
|
||||
sprintf(l10n('locfiledit_saved_bak'),
|
||||
substr(substr_replace($edited_file,
|
||||
'.bak',
|
||||
strrpos($edited_file , '.'),
|
||||
0),
|
||||
2)));
|
||||
array_unshift($page['infos'], l10n('locfiledit_save_config'));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -267,7 +351,6 @@ if (isset($_POST['submit']) and !is_adviser())
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
// +-----------------------------------------------------------------------+
|
||||
// | template initialization
|
||||
// +-----------------------------------------------------------------------+
|
||||
|
@ -284,20 +367,22 @@ if (!empty($edited_file))
|
|||
array('EDITED_FILE' => $edited_file,
|
||||
'CONTENT_FILE' => htmlspecialchars($content_file),
|
||||
'FILE_NAME' => trim($edited_file, './\\')));
|
||||
if (file_exists(
|
||||
substr_replace($edited_file ,'.bak',strrpos($edited_file , '.'),0)))
|
||||
if (file_exists(get_bak_file($edited_file)))
|
||||
{
|
||||
$template->assign('restore', true);
|
||||
}
|
||||
if (file_exists($edited_file))
|
||||
{
|
||||
$template->assign('restore_infos', true);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Editarea
|
||||
if (!isset($conf['editarea_options']) or $conf['editarea_options'] !== false)
|
||||
{
|
||||
$template->assign('editarea', array(
|
||||
'URL' => LOCALEDIT_PATH . 'editarea/edit_area_full.js',
|
||||
'OPTIONS' => $editarea));
|
||||
}
|
||||
$template->assign(array(
|
||||
'F_ACTION' => PHPWG_ROOT_PATH.'admin.php?page=plugin&section=LocalFilesEditor%2Fadmin.php&tab=' . $page['tab'],
|
||||
'LOCALEDIT_PATH' => LOCALEDIT_PATH,
|
||||
'LOAD_EDITAREA' => isset($conf['LocalFilesEditor']) ? $conf['LocalFilesEditor'] : 'off',
|
||||
'EDITAREA_OPTIONS' => $editarea_options));
|
||||
|
||||
$template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content');
|
||||
|
||||
|
|
|
@ -1,48 +1,103 @@
|
|||
{if isset($editarea)}
|
||||
<script type="text/javascript" src="{$editarea.URL}"></script>
|
||||
{* $Id$ *}
|
||||
{html_head}<link rel="stylesheet" type="text/css" href="{$LOCALEDIT_PATH}locfiledit.css">{/html_head}
|
||||
{known_script id="jquery" src=$ROOT_URL|@cat:"template-common/lib/jquery.packed.js"}
|
||||
{known_script id="editarea" src=$LOCALEDIT_PATH|@cat:"editarea/edit_area_full.js"}
|
||||
<script type="text/javascript">
|
||||
editAreaLoader.init({ldelim}
|
||||
id: "text"
|
||||
{foreach from=$editarea.OPTIONS key=option item=value}
|
||||
, {$option}: {$value|editarea_quote}
|
||||
{/foreach}
|
||||
{rdelim});
|
||||
var editarea = "{$LOAD_EDITAREA}";
|
||||
|
||||
function loadEditarea() {ldelim}
|
||||
editAreaLoader.init({ldelim}
|
||||
id: "text"
|
||||
{foreach from=$EDITAREA_OPTIONS key=option item=value}
|
||||
, {$option}: {$value|editarea_quote}
|
||||
{/foreach}
|
||||
});
|
||||
jQuery("#showedit").hide();
|
||||
jQuery("#hideedit").show();
|
||||
jQuery.post("plugins/LocalFilesEditor/update_config.php", {ldelim} editarea: "on"});
|
||||
}
|
||||
|
||||
function unloadEditarea() {ldelim}
|
||||
editAreaLoader.delete_instance("text");
|
||||
jQuery("#hideedit").hide();
|
||||
jQuery("#showedit").show();
|
||||
jQuery.post("plugins/LocalFilesEditor/update_config.php", {ldelim} editarea: "off"});
|
||||
}
|
||||
</script>
|
||||
{/if}
|
||||
|
||||
<div class="titrePage">
|
||||
<h2>LocalFiles Editor</h2>
|
||||
</div>
|
||||
|
||||
<form method="post" class="properties" action="" ENCTYPE="multipart/form-data">
|
||||
<div style="text-align:center;">
|
||||
<form method="post" class="properties" action="{$F_ACTION}" ENCTYPE="multipart/form-data" name="form">
|
||||
|
||||
<div id="LocalFilesEditor">
|
||||
|
||||
<input type="hidden" value="{$zone_edit.EDITED_FILE}" name="edited_file"/>
|
||||
|
||||
{if isset ($create_tpl)}
|
||||
<table>
|
||||
<tr>
|
||||
<td style="text-align: right;">{'locfiledit_new_filename'|@translate}</td>
|
||||
<td style="text-align: left;"><input type="text" size="55" maxlength="50" value="{$create_tpl.NEW_FILE_NAME}" name="tpl_name"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align: right;">{'locfiledit_parent_directory'|@translate}</td>
|
||||
<td style="text-align: left;">{html_options name=tpl_parent options=$create_tpl.PARENT_OPTIONS selected=$create_tpl.PARENT_SELECTED}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align: right;">{'locfiledit_model'|@translate}</td>
|
||||
<td style="text-align: left;">{html_options name=tpl_model options=$create_tpl.MODEL_OPTIONS selected=$create_tpl.MODEL_SELECTED}</td>
|
||||
</tr>
|
||||
</table>
|
||||
<br><br>
|
||||
<input class="submit" type="submit" value="{'Submit'|@translate}" name="create_tpl" />
|
||||
{/if}
|
||||
|
||||
{if isset ($css_lang_tpl)}
|
||||
{html_options name=file_to_edit options=$css_lang_tpl.OPTIONS selected=$css_lang_tpl.SELECTED}
|
||||
<input class="submit" type="submit" value="{'locfiledit_edit'|@translate}" name="edit" />
|
||||
<br>
|
||||
<br>
|
||||
<br><br>
|
||||
{if isset ($css_lang_tpl.NEW_FILE_URL)}
|
||||
<span class="{$css_lang_tpl.NEW_FILE_CLASS}">
|
||||
<a href="{$css_lang_tpl.NEW_FILE_URL}">{'locfiledit_new_tpl'|@translate}</a>
|
||||
</span>
|
||||
{/if}
|
||||
{/if}
|
||||
|
||||
{foreach from=$show_default item=file}
|
||||
{foreach from=$show_default item=file name=default_loop}
|
||||
<span class="top_right">
|
||||
<a href="{$file.SHOW_DEFAULT}" onclick="window.open( this.href, 'local_file', 'location=no,toolbar=no,menubar=no,status=no,resizable=yes,scrollbars=yes,width=800,height=600' ); return false;">{'locfiledit_show_default'|@translate} "{$file.FILE}"</a>
|
||||
<br>
|
||||
</span>
|
||||
{if !($smarty.foreach.default_loop.last)}<br>{/if}
|
||||
{/foreach}
|
||||
|
||||
{if isset ($zone_edit)}
|
||||
<br>
|
||||
<input type="text" style="display:none;" value="{$zone_edit.EDITED_FILE}" name="edited_file"/>
|
||||
<b>{$zone_edit.FILE_NAME}</b>
|
||||
|
||||
<textarea rows="30" cols="90" name="text" id="text">{$zone_edit.CONTENT_FILE}</textarea>
|
||||
<div id="editarea_buttons">
|
||||
<a href="javascript:loadEditarea();" id="showedit">[{'locfiledit_enable_editarea'|@translate}]</a>
|
||||
<a href="javascript:unloadEditarea();" id="hideedit">[{'locfiledit_disable_editarea'|@translate}]</a>
|
||||
</div>
|
||||
|
||||
<br>
|
||||
<textarea rows="30" name="text" id="text" style="width:90%;">{$zone_edit.CONTENT_FILE}</textarea>
|
||||
<br>{'locfiledit_save_bak'|@translate}
|
||||
<br><br>
|
||||
|
||||
<input class="submit" type="submit" value="{'locfiledit_save_file'|@translate}" name="submit" {$TAG_INPUT_ENABLED}/>
|
||||
{if isset ($restore)}
|
||||
<input class="submit" type="submit" value="{'locfiledit_restore'|@translate}" name="restore" onclick="return confirm('{'locfiledit_restore_confirm'|@translate|escape:'javascript'}');" {$TAG_INPUT_ENABLED}/>
|
||||
{/if}
|
||||
|
||||
{if isset ($restore_infos)}
|
||||
<br><br>
|
||||
{'locfiledit_save_bak'|@translate}
|
||||
{/if}
|
||||
|
||||
<br>
|
||||
{/if}
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery("#editarea_buttons").show();
|
||||
if ((editarea == "on") && (document.getElementById("text") != null)) loadEditarea();
|
||||
</script>
|
||||
|
|
File diff suppressed because one or more lines are too long
BIN
plugins/LocalFilesEditor/editarea/images/autocompletion.gif
Normal file
BIN
plugins/LocalFilesEditor/editarea/images/autocompletion.gif
Normal file
Binary file not shown.
After Width: | Height: | Size: 359 B |
|
@ -57,5 +57,9 @@ syntax_pas: "Pascal",
|
|||
syntax_brainfuck: "Brainfuck",
|
||||
syntax_sql: "SQL",
|
||||
syntax_ruby: "Ruby",
|
||||
syntax_robotstxt: "Robots txt",
|
||||
syntax_tsql: "T-SQL",
|
||||
syntax_perl: "Perl",
|
||||
syntax_coldfusion: "Coldfusion",
|
||||
close_tab: "Close file"
|
||||
};
|
||||
|
|
|
@ -57,5 +57,9 @@ syntax_pas: "Pascal",
|
|||
syntax_brainfuck: "Brainfuck",
|
||||
syntax_sql: "SQL",
|
||||
syntax_ruby: "Ruby",
|
||||
syntax_robotstxt: "Robots txt",
|
||||
syntax_tsql: "T-SQL",
|
||||
syntax_perl: "Perl",
|
||||
syntax_coldfusion: "Coldfusion",
|
||||
close_tab: "Close file"
|
||||
};
|
||||
|
|
|
@ -57,5 +57,9 @@ syntax_pas: "Pascal",
|
|||
syntax_brainfuck: "Brainfuck",
|
||||
syntax_sql: "SQL",
|
||||
syntax_ruby: "Ruby",
|
||||
syntax_robotstxt: "Robots txt",
|
||||
syntax_tsql: "T-SQL",
|
||||
syntax_perl: "Perl",
|
||||
syntax_coldfusion: "Coldfusion",
|
||||
close_tab: "Close file"
|
||||
};
|
||||
|
|
|
@ -57,5 +57,9 @@ syntax_pas: "Pascal",
|
|||
syntax_brainfuck: "Brainfuck",
|
||||
syntax_sql: "SQL",
|
||||
syntax_ruby: "Ruby",
|
||||
syntax_robotstxt: "Robots txt",
|
||||
syntax_tsql: "T-SQL",
|
||||
syntax_perl: "Perl",
|
||||
syntax_coldfusion: "Coldfusion",
|
||||
close_tab: "Close file"
|
||||
};
|
||||
|
|
|
@ -57,5 +57,6 @@ syntax_pas: "Pascal",
|
|||
syntax_brainfuck: "Brainfuck",
|
||||
syntax_sql: "SQL",
|
||||
syntax_ruby: "Ruby",
|
||||
syntax_coldfusion: "Coldfusion",
|
||||
close_tab: "Close file"
|
||||
};
|
||||
|
|
|
@ -57,5 +57,9 @@ syntax_pas: "Pascal",
|
|||
syntax_brainfuck: "Brainfuck",
|
||||
syntax_sql: "SQL",
|
||||
syntax_ruby: "Ruby",
|
||||
syntax_robotstxt: "Robots txt",
|
||||
syntax_tsql: "T-SQL",
|
||||
syntax_perl: "Perl",
|
||||
syntax_coldfusion: "Coldfusion",
|
||||
close_tab: "Fermer le fichier"
|
||||
};
|
||||
|
|
|
@ -57,5 +57,9 @@ syntax_pas: "Pascal",
|
|||
syntax_brainfuck: "Brainfuck",
|
||||
syntax_sql: "SQL",
|
||||
syntax_ruby: "Ruby",
|
||||
syntax_robotstxt: "Robots txt",
|
||||
syntax_tsql: "T-SQL",
|
||||
syntax_perl: "Perl",
|
||||
syntax_coldfusion: "Coldfusion",
|
||||
close_tab: "Close file"
|
||||
};
|
||||
|
|
|
@ -57,5 +57,9 @@ syntax_pas: "Pascal",
|
|||
syntax_brainfuck: "Brainfuck",
|
||||
syntax_sql: "SQL",
|
||||
syntax_ruby: "Ruby",
|
||||
syntax_robotstxt: "Robots txt",
|
||||
syntax_tsql: "T-SQL",
|
||||
syntax_perl: "Perl",
|
||||
syntax_coldfusion: "Coldfusion",
|
||||
close_tab: "Close file"
|
||||
};
|
||||
|
|
|
@ -57,5 +57,9 @@ syntax_pas: "Pascal",
|
|||
syntax_brainfuck: "Brainfuck",
|
||||
syntax_sql: "SQL",
|
||||
syntax_ruby: "Ruby",
|
||||
syntax_robotstxt: "Robots txt",
|
||||
syntax_tsql: "T-SQL",
|
||||
syntax_perl: "Perl",
|
||||
syntax_coldfusion: "Coldfusion",
|
||||
close_tab: "Close file"
|
||||
};
|
||||
|
|
|
@ -57,5 +57,9 @@ syntax_pas: "Pascal",
|
|||
syntax_brainfuck: "Brainfuck",
|
||||
syntax_sql: "SQL",
|
||||
syntax_ruby: "Ruby",
|
||||
syntax_robotstxt: "Robots txt",
|
||||
syntax_tsql: "T-SQL",
|
||||
syntax_perl: "Perl",
|
||||
syntax_coldfusion: "Coldfusion",
|
||||
close_tab: "Избери датотека"
|
||||
};
|
||||
|
|
|
@ -57,5 +57,9 @@ syntax_pas: "Pascal",
|
|||
syntax_brainfuck: "Brainfuck",
|
||||
syntax_sql: "SQL",
|
||||
syntax_ruby: "Ruby",
|
||||
syntax_robotstxt: "Robots txt",
|
||||
syntax_tsql: "T-SQL",
|
||||
syntax_perl: "Perl",
|
||||
syntax_coldfusion: "Coldfusion",
|
||||
close_tab: "Close file"
|
||||
};
|
||||
|
|
|
@ -57,5 +57,9 @@ syntax_pas: "Pascal",
|
|||
syntax_brainfuck: "Brainfuck",
|
||||
syntax_sql: "SQL",
|
||||
syntax_ruby: "Ruby",
|
||||
syntax_robotstxt: "Robots txt",
|
||||
syntax_tsql: "T-SQL",
|
||||
syntax_perl: "Perl",
|
||||
syntax_coldfusion: "Coldfusion",
|
||||
close_tab: "Close file"
|
||||
};
|
||||
|
|
|
@ -57,5 +57,9 @@ syntax_pas: "Pascal",
|
|||
syntax_brainfuck: "Brainfuck",
|
||||
syntax_sql: "SQL",
|
||||
syntax_ruby: "Ruby",
|
||||
syntax_robotstxt: "Robots txt",
|
||||
syntax_tsql: "T-SQL",
|
||||
syntax_perl: "Perl",
|
||||
syntax_coldfusion: "Coldfusion",
|
||||
close_tab: "Close file"
|
||||
};
|
||||
|
|
|
@ -57,5 +57,9 @@ syntax_pas: "Pascal",
|
|||
syntax_brainfuck: "Brainfuck",
|
||||
syntax_sql: "SQL",
|
||||
syntax_ruby: "Ruby",
|
||||
syntax_robotstxt: "Robots txt",
|
||||
syntax_tsql: "T-SQL",
|
||||
syntax_perl: "Perl",
|
||||
syntax_coldfusion: "Coldfusion",
|
||||
close_tab: "Закрыть файл"
|
||||
};
|
||||
|
|
|
@ -57,5 +57,9 @@ syntax_pas: "Pascal",
|
|||
syntax_brainfuck: "Brainfuck",
|
||||
syntax_sql: "SQL",
|
||||
syntax_ruby: "Ruby",
|
||||
syntax_robotstxt: "Robots txt",
|
||||
syntax_tsql: "T-SQL",
|
||||
syntax_perl: "Perl",
|
||||
syntax_coldfusion: "Coldfusion",
|
||||
close_tab: "Close file"
|
||||
};
|
||||
|
|
|
@ -4,7 +4,10 @@
|
|||
|
||||
editAreaLoader.load_syntax["html"] = {
|
||||
'COMMENT_SINGLE' : {}
|
||||
,'COMMENT_MULTI' : {'<!--' : '-->'}
|
||||
,'COMMENT_MULTI' : {
|
||||
'<!--' : '-->',
|
||||
'{*' : '*}'
|
||||
}
|
||||
,'QUOTEMARKS' : {1: "'", 2: '"'}
|
||||
,'KEYWORD_CASE_SENSITIVE' : false
|
||||
,'KEYWORDS' : {
|
||||
|
|
|
@ -1,60 +0,0 @@
|
|||
editAreaLoader.load_syntax["js"] = {
|
||||
'COMMENT_SINGLE' : {1 : '//'}
|
||||
,'COMMENT_MULTI' : {'/*' : '*/'}
|
||||
,'QUOTEMARKS' : {1: "'", 2: '"'}
|
||||
,'KEYWORD_CASE_SENSITIVE' : false
|
||||
,'KEYWORDS' : {
|
||||
'statements' : [
|
||||
'as', 'break', 'case', 'catch', 'continue', 'decodeURI', 'delete', 'do',
|
||||
'else', 'encodeURI', 'eval', 'finally', 'for', 'if', 'in', 'is', 'item',
|
||||
'instanceof', 'return', 'switch', 'this', 'throw', 'try', 'typeof', 'void',
|
||||
'while', 'write', 'with'
|
||||
]
|
||||
,'keywords' : [
|
||||
'class', 'const', 'default', 'debugger', 'export', 'extends', 'false',
|
||||
'function', 'import', 'namespace', 'new', 'null', 'package', 'private',
|
||||
'protected', 'public', 'super', 'true', 'use', 'var', 'window', 'document',
|
||||
// the list below must be sorted and checked (if it is a keywords or a function and if it is not present twice
|
||||
'Link ', 'outerHeight ', 'Anchor', 'FileUpload',
|
||||
'location', 'outerWidth', 'Select', 'Area', 'find', 'Location', 'Packages', 'self',
|
||||
'arguments', 'locationbar', 'pageXoffset', 'Form',
|
||||
'Math', 'pageYoffset', 'setTimeout', 'assign', 'Frame', 'menubar', 'parent', 'status',
|
||||
'blur', 'frames', 'MimeType', 'parseFloat', 'statusbar', 'Boolean', 'Function', 'moveBy',
|
||||
'parseInt', 'stop', 'Button', 'getClass', 'moveTo', 'Password', 'String', 'callee', 'Hidden',
|
||||
'name', 'personalbar', 'Submit', 'caller', 'history', 'NaN', 'Plugin', 'sun', 'captureEvents',
|
||||
'History', 'navigate', 'print', 'taint', 'Checkbox', 'home', 'navigator', 'prompt', 'Text',
|
||||
'Image', 'Navigator', 'prototype', 'Textarea', 'clearTimeout', 'Infinity',
|
||||
'netscape', 'Radio', 'toolbar', 'close', 'innerHeight', 'Number', 'ref', 'top', 'closed',
|
||||
'innerWidth', 'Object', 'RegExp', 'toString', 'confirm', 'isFinite', 'onBlur', 'releaseEvents',
|
||||
'unescape', 'constructor', 'isNan', 'onError', 'Reset', 'untaint', 'Date', 'java', 'onFocus',
|
||||
'resizeBy', 'unwatch', 'defaultStatus', 'JavaArray', 'onLoad', 'resizeTo', 'valueOf', 'document',
|
||||
'JavaClass', 'onUnload', 'routeEvent', 'watch', 'Document', 'JavaObject', 'open', 'scroll', 'window',
|
||||
'Element', 'JavaPackage', 'opener', 'scrollbars', 'Window', 'escape', 'length', 'Option', 'scrollBy'
|
||||
]
|
||||
,'functions' : [
|
||||
// common functions for Window object
|
||||
'alert', 'Array', 'back', 'blur', 'clearInterval', 'close', 'confirm', 'eval ', 'focus', 'forward', 'home',
|
||||
'name', 'navigate', 'onblur', 'onerror', 'onfocus', 'onload', 'onmove',
|
||||
'onresize', 'onunload', 'open', 'print', 'prompt', 'scroll', 'scrollTo', 'setInterval', 'status',
|
||||
'stop'
|
||||
]
|
||||
}
|
||||
,'OPERATORS' :[
|
||||
'+', '-', '/', '*', '=', '<', '>', '%', '!'
|
||||
]
|
||||
,'DELIMITERS' :[
|
||||
'(', ')', '[', ']', '{', '}'
|
||||
]
|
||||
,'STYLES' : {
|
||||
'COMMENTS': 'color: #AAAAAA;'
|
||||
,'QUOTESMARKS': 'color: #6381F8;'
|
||||
,'KEYWORDS' : {
|
||||
'statements' : 'color: #60CA00;'
|
||||
,'keywords' : 'color: #48BDDF;'
|
||||
,'functions' : 'color: #2B60FF;'
|
||||
}
|
||||
,'OPERATORS' : 'color: #FF00FF;'
|
||||
,'DELIMITERS' : 'color: #0038E1;'
|
||||
|
||||
}
|
||||
};
|
|
@ -11,7 +11,7 @@ editAreaLoader.load_syntax["php"] = {
|
|||
'return', 'break', 'continue'
|
||||
]
|
||||
,'reserved' : [
|
||||
'_GET', '_POST', '_SERVER', '_FILES', '_ENV', '_COOKIE', '_REQUEST',
|
||||
'_GET', '_POST', '_SESSION', '_SERVER', '_FILES', '_ENV', '_COOKIE', '_REQUEST',
|
||||
'null', '__LINE__', '__FILE__',
|
||||
'false', '<?php', '?>', '<?',
|
||||
'<script language', '</script>',
|
||||
|
@ -72,4 +72,85 @@ editAreaLoader.load_syntax["php"] = {
|
|||
'variables' : 'color: #E0BD54;'
|
||||
}
|
||||
}
|
||||
,'AUTO_COMPLETION' : {
|
||||
"default": { // the name of this definition group. It's posisble to have different rules inside the same definition file
|
||||
"REGEXP": { "before_word": "[^a-zA-Z0-9_]|^" // \\s|\\.|
|
||||
,"possible_words_letters": "[a-zA-Z0-9_\$]+"
|
||||
,"letter_after_word_must_match": "[^a-zA-Z0-9_]|$"
|
||||
,"prefix_separator": "\\-\\>|\\:\\:"
|
||||
}
|
||||
,"CASE_SENSITIVE": true
|
||||
,"MAX_TEXT_LENGTH": 100 // the maximum length of the text being analyzed before the cursor position
|
||||
,"KEYWORDS": {
|
||||
'': [ // the prefix of thoses items
|
||||
/**
|
||||
* 0 : the keyword the user is typing
|
||||
* 1 : (optionnal) the string inserted in code ("{@}" being the new position of the cursor, "§" beeing the equivalent to the value the typed string indicated if the previous )
|
||||
* If empty the keyword will be displayed
|
||||
* 2 : (optionnal) the text that appear in the suggestion box (if empty, the string to insert will be displayed)
|
||||
*/
|
||||
['$_POST']
|
||||
,['$_GET']
|
||||
,['$_SESSION']
|
||||
,['$_SERVER']
|
||||
,['$_FILES']
|
||||
,['$_ENV']
|
||||
,['$_COOKIE']
|
||||
,['$_REQUEST']
|
||||
// magic methods
|
||||
,['__construct', '§( {@} )']
|
||||
,['__destruct', '§( {@} )']
|
||||
,['__sleep', '§( {@} )']
|
||||
,['__wakeup', '§( {@} )']
|
||||
,['__toString', '§( {@} )']
|
||||
// include
|
||||
,['include', '§ "{@}";']
|
||||
,['include_once', '§ "{@}";']
|
||||
,['require', '§ "{@}";']
|
||||
,['require_once', '§ "{@}";']
|
||||
// statements
|
||||
,['for', '§( {@} )']
|
||||
,['foreach', '§( {@} )']
|
||||
,['if', '§( {@} )']
|
||||
,['elseif', '§( {@} )']
|
||||
,['while', '§( {@} )']
|
||||
,['switch', '§( {@} )']
|
||||
,['break']
|
||||
,['case']
|
||||
,['continue']
|
||||
,['do']
|
||||
,['else']
|
||||
,['endif']
|
||||
,['endswitch']
|
||||
,['endwhile']
|
||||
,['return']
|
||||
// function
|
||||
,['unset', '§( {@} )']
|
||||
]
|
||||
}
|
||||
}
|
||||
,"live": {
|
||||
|
||||
// class NAME: /class\W+([a-z]+)\W+/gi
|
||||
// method: /^(public|private|protected)?\s*function\s+([a-z][a-z0-9\_]*)\s*(\([^\{]*\))/gmi
|
||||
// static: /^(public|private|protected)?\s+static\s+(public|private|protected)?\s*function\s+([a-z][a-z0-9\_]*)\s*(\([^\{]*\))/gmi
|
||||
// attributes: /(\$this\-\>|(?:var|public|protected|private)\W+\$)([a-z0-9\_]+)(?!\()\b/gi
|
||||
// v1 : /(\$this\-\>|var\W+|public\W+|protected\W+|private\W+)([a-z0-9\_]+)\W*(=|;)/gi
|
||||
// var type: /(\$(this\-\>)?[a-z0-9\_]+)\s*\=\s*new\s+([a-z0-9\_])+/gi
|
||||
|
||||
|
||||
"REGEXP": { "before_word": "[^a-zA-Z0-9_]|^" // \\s|\\.|
|
||||
,"possible_words_letters": "[a-zA-Z0-9_\$]+"
|
||||
,"letter_after_word_must_match": "[^a-zA-Z0-9_]|$"
|
||||
,"prefix_separator": "\\-\\>"
|
||||
}
|
||||
,"CASE_SENSITIVE": true
|
||||
,"MAX_TEXT_LENGTH": 100 // the maximum length of the text being analyzed before the cursor position
|
||||
,"KEYWORDS": {
|
||||
'$this': [ // the prefix of thoses items
|
||||
['test']
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
@ -1,55 +0,0 @@
|
|||
editAreaLoader.load_syntax["sql"] = {
|
||||
'COMMENT_SINGLE' : {1 : '--'}
|
||||
,'COMMENT_MULTI' : {'/*' : '*/'}
|
||||
,'QUOTEMARKS' : {1: "'", 2: '"', 3: '`'}
|
||||
,'KEYWORD_CASE_SENSITIVE' : false
|
||||
,'KEYWORDS' : {
|
||||
'statements' : [
|
||||
'select', 'SELECT', 'where', 'order', 'by',
|
||||
'insert', 'from', 'update', 'grant', 'left join', 'right join',
|
||||
'union', 'group', 'having', 'limit', 'alter', 'LIKE','IN','CASE'
|
||||
]
|
||||
,'reserved' : [
|
||||
'null', 'enum', 'int', 'boolean', 'add', 'varchar'
|
||||
|
||||
]
|
||||
,'functions' : [
|
||||
'ABS','ACOS','ADDDATE','ADDTIME','AES_DECRYPT','AES_ENCRYPT','ASCII','ASIN','ATAN2 ATAN','ATAN','AVG','BENCHMARK','DISTINCT','BIN','BIT_AND','BIT_COUNT','BIT_LENGTH','BIT_OR','BIT_XOR','CAST','CEILING CEIL','CHAR_LENGTH','CHAR',
|
||||
'CHARACTER_LENGTH','CHARSET','COALESCE','COERCIBILITY','COLLATION','COMPRESS','CONCAT_WS','CONCAT','CONNECTION_ID','CONV','CONVERT_TZ','COS','COT','COUNT','CRC32','CURDATE','CURRENT_DATE','CURRENT_TIME','CURRENT_TIMESTAMP','CURRENT_USER','CURTIME','DATABASE','DATE_ADD','DATE_FORMAT','DATE_SUB','DATE','DATEDIFF','DAY','DAYNAME','DAYOFMONTH',
|
||||
'DAYOFWEEK','DAYOFYEAR','DECODE','DEFAULT','DEGREES','DES_DECRYPT','DES_ENCRYPT','ELT','ENCODE','ENCRYPT','EXP','EXPORT_SET','EXTRACT','FIELD','FIND_IN_SET','FLOOR','FORMAT','FOUND_ROWS','FROM_DAYS','FROM_UNIXTIME','GET_FORMAT','GET_LOCK','GREATEST','GROUP_CONCAT','HEX','HOUR','IF','IFNULL','INET_ATON','INET_NTOA',
|
||||
'INSERT','INSTR','INTERVAL','IS_FREE_LOCK','IS_USED_LOCK','ISNULL','LAST_DAY','LAST_INSERT_ID','LCASE','LEAST','LEFT','LENGTH','LN','LOAD_FILE','LOCALTIME','LOCALTIMESTAMP','LOCATE','LOG10','LOG2','LOG','LOWER','LPAD','LTRIM','MAKE_SET','MAKEDATE','MAKETIME','MASTER_POS_WAIT','MAX','MD5','MICROSECOND',
|
||||
'MID','MIN','MINUTE','MOD','MONTH','MONTHNAME','NOW','NULLIF','OCT','OCTET_LENGTH','OLD_PASSWORD','ORD','PASSWORD','PERIOD_ADD','PERIOD_DIFF','PI','POSITION','POW','POWER','PROCEDURE ANALYSE','QUARTER','QUOTE','RADIANS','RAND','RELEASE_LOCK','REPEAT','REPLACE','REVERSE','RIGHT','ROUND',
|
||||
'RPAD','RTRIM','SEC_TO_TIME','SECOND','SESSION_USER','SHA1','SHA','SIGN','SIN','SOUNDEX','SOUNDS LIKE','SPACE','SQRT','STD','STDDEV','STR_TO_DATE','STRCMP','SUBDATE','SUBSTRING_INDEX','SUBSTRING','SUBSTR','SUBTIME','SUM','SYSDATE','SYSTEM_USER','TAN','TIME_FORMAT','TIME_TO_SEC','TIME','TIMEDIFF',
|
||||
'TIMESTAMP','TO_DAYS','TRIM','TRUNCATE','UCASE','UNCOMPRESS','UNCOMPRESSED_LENGTH','UNHEX','UNIX_TIMESTAMP','UPPER','USER','UTC_DATE','UTC_TIME','UTC_TIMESTAMP','UUID','VALUES','VARIANCE','WEEK','WEEKDAY','WEEKOFYEAR','YEAR','YEARWEEK'
|
||||
]
|
||||
}
|
||||
,'OPERATORS' :[
|
||||
'AND','&&','BETWEEN','BINARY','&','|','^','/','DIV','<=>','=','>=','>','<<','>>','IS','NULL','<=','<','-','%','!=','<>','!','||','OR','+','REGEXP','RLIKE','XOR','~','*'
|
||||
]
|
||||
,'DELIMITERS' :[
|
||||
'(', ')', '[', ']', '{', '}'
|
||||
]
|
||||
,'REGEXPS' : {
|
||||
// highlight all variables (@...)
|
||||
'variables' : {
|
||||
'search' : '()(\\@\\w+)()'
|
||||
,'class' : 'variables'
|
||||
,'modifiers' : 'g'
|
||||
,'execute' : 'before' // before or after
|
||||
}
|
||||
}
|
||||
,'STYLES' : {
|
||||
'COMMENTS': 'color: #AAAAAA;'
|
||||
,'QUOTESMARKS': 'color: #879EFA;'
|
||||
,'KEYWORDS' : {
|
||||
'reserved' : 'color: #48BDDF;'
|
||||
,'functions' : 'color: #0040FD;'
|
||||
,'statements' : 'color: #60CA00;'
|
||||
}
|
||||
,'OPERATORS' : 'color: #FF00FF;'
|
||||
,'DELIMITERS' : 'color: #2B60FF;'
|
||||
,'REGEXPS' : {
|
||||
'variables' : 'color: #E0BD54;'
|
||||
}
|
||||
}
|
||||
};
|
|
@ -1,56 +0,0 @@
|
|||
/*
|
||||
* last update: 2006-08-24
|
||||
*/
|
||||
|
||||
editAreaLoader.load_syntax["xml"] = {
|
||||
'COMMENT_SINGLE' : {}
|
||||
,'COMMENT_MULTI' : {'<!--' : '-->'}
|
||||
,'QUOTEMARKS' : {1: "'", 2: '"'}
|
||||
,'KEYWORD_CASE_SENSITIVE' : false
|
||||
,'KEYWORDS' : {
|
||||
}
|
||||
,'OPERATORS' :[
|
||||
]
|
||||
,'DELIMITERS' :[
|
||||
]
|
||||
,'REGEXPS' : {
|
||||
'xml' : {
|
||||
'search' : '()(<\\?[^>]*?\\?>)()'
|
||||
,'class' : 'xml'
|
||||
,'modifiers' : 'g'
|
||||
,'execute' : 'before' // before or after
|
||||
}
|
||||
,'cdatas' : {
|
||||
'search' : '()(<!\\[CDATA\\[.*?\\]\\]>)()'
|
||||
,'class' : 'cdata'
|
||||
,'modifiers' : 'g'
|
||||
,'execute' : 'before' // before or after
|
||||
}
|
||||
,'tags' : {
|
||||
'search' : '(<)(/?[a-z][^ \r\n\t>]*)([^>]*>)'
|
||||
,'class' : 'tags'
|
||||
,'modifiers' : 'gi'
|
||||
,'execute' : 'before' // before or after
|
||||
}
|
||||
,'attributes' : {
|
||||
'search' : '( |\n|\r|\t)([^ \r\n\t=]+)(=)'
|
||||
,'class' : 'attributes'
|
||||
,'modifiers' : 'g'
|
||||
,'execute' : 'before' // before or after
|
||||
}
|
||||
}
|
||||
,'STYLES' : {
|
||||
'COMMENTS': 'color: #AAAAAA;'
|
||||
,'QUOTESMARKS': 'color: #6381F8;'
|
||||
,'KEYWORDS' : {
|
||||
}
|
||||
,'OPERATORS' : 'color: #E775F0;'
|
||||
,'DELIMITERS' : ''
|
||||
,'REGEXPS' : {
|
||||
'attributes': 'color: #B1AC41;'
|
||||
,'tags': 'color: #E62253;'
|
||||
,'xml': 'color: #8DCFB5;'
|
||||
,'cdata': 'color: #50B020;'
|
||||
}
|
||||
}
|
||||
};
|
|
@ -29,22 +29,25 @@
|
|||
*/
|
||||
function eval_syntax($code)
|
||||
{
|
||||
$code = str_replace(array('<?php', '?>'), '', $code);
|
||||
$code = str_replace(array('<?php', '?>'), '', $code);
|
||||
if (function_exists('token_get_all'))
|
||||
{
|
||||
$b = 0;
|
||||
foreach (token_get_all($code) as $token)
|
||||
{
|
||||
if ('{' == $token) ++$b;
|
||||
else if ('}' == $token) --$b;
|
||||
{
|
||||
if ('{' == $token) ++$b;
|
||||
else if ('}' == $token) --$b;
|
||||
}
|
||||
if ($b) return false;
|
||||
else
|
||||
{
|
||||
ob_start();
|
||||
$eval = eval('if(0){' . $code . '}');
|
||||
ob_end_clean();
|
||||
if ($eval === false) return false;
|
||||
else return '<?php' . $code . '?>';
|
||||
{
|
||||
ob_start();
|
||||
$eval = eval('if(0){' . $code . '}');
|
||||
ob_end_clean();
|
||||
if ($eval === false) return false;
|
||||
}
|
||||
}
|
||||
return '<?php' . $code . '?>';
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -67,4 +70,45 @@ function editarea_quote($value)
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* returns bak file for restore
|
||||
* @param string
|
||||
*/
|
||||
function get_bak_file($file)
|
||||
{
|
||||
if (get_extension($file) == 'php')
|
||||
{
|
||||
return substr_replace($file, '.bak', strrpos($file , '.'), 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
return $file . '.bak';
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* returns dirs and subdirs
|
||||
* retun array
|
||||
* @param string
|
||||
*/
|
||||
function get_rec_dirs($path='')
|
||||
{
|
||||
$options = array();
|
||||
if (is_dir($path))
|
||||
{
|
||||
$fh = opendir($path);
|
||||
while ($file = readdir($fh))
|
||||
{
|
||||
$pathfile = $path . '/' . $file;
|
||||
if ($file != '.' and $file != '..' and $file != '.svn' and is_dir($pathfile))
|
||||
{
|
||||
$options[$pathfile] = str_replace(array('./', '/'), array('', ' / '), $pathfile);
|
||||
$options = array_merge($options, get_rec_dirs($pathfile));
|
||||
}
|
||||
}
|
||||
closedir($fh);
|
||||
}
|
||||
return $options;
|
||||
}
|
||||
|
||||
?>
|
|
@ -27,7 +27,7 @@ $lang['locfiledit_onglet_tpl'] = 'Templates';
|
|||
$lang['locfiledit_onglet_lang'] = 'Languages';
|
||||
$lang['locfiledit_onglet_plug'] = 'Personal Plugin';
|
||||
$lang['locfiledit_cant_save'] = 'Current file isn\'t writeable. Check if a directory "include/" is writeable (chmod).';
|
||||
$lang['locfiledit_newfile'] = "/* File is not existing and will be created by LocalFiles Editor. */";
|
||||
$lang['locfiledit_newfile'] = 'File is not existing and will be created by LocalFiles Editor';
|
||||
$lang['locfiledit_save_config'] = 'File written successfully.';
|
||||
$lang['locfiledit_show_default'] = 'Display reference file: ';
|
||||
$lang['locfiledit_save_bak'] = 'Backup copy will be created on save.';
|
||||
|
@ -41,5 +41,15 @@ Restore won\'t be effective till next save.';
|
|||
$lang['locfiledit_bak_loaded1'] = 'Backup file loaded.';
|
||||
$lang['locfiledit_bak_loaded2'] = 'You must save file to restore it.';
|
||||
$lang['locfiledit_syntax_error'] = 'Syntax error! File can\'t be saved.';
|
||||
$lang['locfiledit_enable_editarea'] = 'Enable Editarea';
|
||||
$lang['locfiledit_disable_editarea'] = 'Disable Editarea';
|
||||
$lang['locfiledit_new_tpl'] = 'Create new file';
|
||||
$lang['locfiledit_new_filename'] = 'File name';
|
||||
$lang['locfiledit_model'] = 'Model';
|
||||
$lang['locfiledit_empty_page'] = 'Empty page';
|
||||
$lang['locfiledit_parent_directory'] = 'Parent directory';
|
||||
$lang['locfiledit_filename_error'] = 'Forbidden caraters in file name.';
|
||||
$lang['locfiledit_file_already_exists'] = 'File already exists.';
|
||||
$lang['locfiledit_model_error'] = 'You must choose a model.';
|
||||
|
||||
?>
|
|
@ -27,7 +27,7 @@ $lang['locfiledit_onglet_tpl'] = 'Templates';
|
|||
$lang['locfiledit_onglet_lang'] = 'Idiomas';
|
||||
$lang['locfiledit_onglet_plug'] = 'Plugin personal';
|
||||
$lang['locfiledit_cant_save'] = 'Imposible escribir el fichero. Verifique los permisos (chmod) del expediente "include/".';
|
||||
$lang['locfiledit_newfile'] = "/* El fichero no existe y será creado en el momento del registro por LocalFiles Editor. */";
|
||||
$lang['locfiledit_newfile'] = 'El fichero no existe y será creado en el momento del registro por LocalFiles Editor';
|
||||
$lang['locfiledit_save_config'] = 'El fichero ha sido registrado.';
|
||||
$lang['locfiledit_show_default'] = 'Fijar el fichero ';
|
||||
$lang['locfiledit_save_bak'] = 'Una copia de salvaguardia del fichero será creada en el momento del registro';
|
||||
|
@ -41,5 +41,15 @@ Usted deberá luego hacer clic Registrar para restaurarlo.';
|
|||
$lang['locfiledit_bak_loaded1'] = 'Fichero cargado de salvaguardia';
|
||||
$lang['locfiledit_bak_loaded2'] = 'Usted debe registrarlo para salvaguardarlo.';
|
||||
$lang['locfiledit_syntax_error'] = '¡ Error de sintaxis! Imposible registrar el fichero.';
|
||||
/* TODO */ $lang['locfiledit_enable_editarea'] = 'Enable Editarea';
|
||||
/* TODO */ $lang['locfiledit_disable_editarea'] = 'Disable Editarea';
|
||||
/* TODO */$lang['locfiledit_new_tpl'] = 'Créer un nouveau fichier';
|
||||
/* TODO */$lang['locfiledit_new_filename'] = 'Nom du fichier';
|
||||
/* TODO */$lang['locfiledit_model'] = 'Modèle';
|
||||
/* TODO */$lang['locfiledit_empty_page'] = 'Page vierge';
|
||||
/* TODO */$lang['locfiledit_parent_directory'] = 'Dossier parent';
|
||||
/* TODO */$lang['locfiledit_filename_error'] = 'Caractères interdits dans le nom du fichier.';
|
||||
/* TODO */$lang['locfiledit_file_already_exists'] = 'Le fichier existe déjà.';
|
||||
/* TODO */$lang['locfiledit_model_error'] = 'Veuillez sélectionner un modèle.';
|
||||
|
||||
?>
|
|
@ -27,7 +27,7 @@ $lang['locfiledit_onglet_tpl'] = 'Templates';
|
|||
$lang['locfiledit_onglet_lang'] = 'Langues';
|
||||
$lang['locfiledit_onglet_plug'] = 'Plugin Personnel';
|
||||
$lang['locfiledit_cant_save'] = 'Impossible d\'écrire le fichier. Vérifiez les permissions (chmod) du dossier "include/".';
|
||||
$lang['locfiledit_newfile'] = "/* Le fichier n'existe pas et sera créé lors de l'enregistrement par LocalFiles Editor. */";
|
||||
$lang['locfiledit_newfile'] = 'Le fichier n\'existe pas et sera créé lors de l\'enregistrement par LocalFiles Editor';
|
||||
$lang['locfiledit_save_config'] = 'Le fichier a été enregistré.';
|
||||
$lang['locfiledit_show_default'] = 'Afficher le fichier ';
|
||||
$lang['locfiledit_save_bak'] = 'Une copie de sauvegarde du fichier sera créée lors de l\'enregistrement';
|
||||
|
@ -41,5 +41,15 @@ Vous devrez ensuite cliquer sur Enregistrer pour le restaurer.';
|
|||
$lang['locfiledit_bak_loaded1'] = 'Fichier de sauvegarde chargé';
|
||||
$lang['locfiledit_bak_loaded2'] = 'Vous devez l\'enregistrer pour le sauvegarder.';
|
||||
$lang['locfiledit_syntax_error'] = 'Erreur de syntaxe! Impossible d\'enregistrer le fichier.';
|
||||
$lang['locfiledit_enable_editarea'] = 'Activer Editarea';
|
||||
$lang['locfiledit_disable_editarea'] = 'Désactiver Editarea';
|
||||
$lang['locfiledit_new_tpl'] = 'Créer un nouveau fichier';
|
||||
$lang['locfiledit_new_filename'] = 'Nom du fichier';
|
||||
$lang['locfiledit_model'] = 'Modèle';
|
||||
$lang['locfiledit_empty_page'] = 'Page vierge';
|
||||
$lang['locfiledit_parent_directory'] = 'Dossier parent';
|
||||
$lang['locfiledit_filename_error'] = 'Caractères interdits dans le nom du fichier.';
|
||||
$lang['locfiledit_file_already_exists'] = 'Le fichier existe déjà.';
|
||||
$lang['locfiledit_model_error'] = 'Veuillez sélectionner un modèle.';
|
||||
|
||||
?>
|
|
@ -27,7 +27,7 @@ $lang['locfiledit_onglet_tpl'] = 'Templates';
|
|||
$lang['locfiledit_onglet_lang'] = 'Lingue';
|
||||
$lang['locfiledit_onglet_plug'] = 'Plugin Personale';
|
||||
$lang['locfiledit_cant_save'] = 'Impossibile di scrivere il file. Verificare i permessi (chmod) della directory.';
|
||||
$lang['locfiledit_newfile'] = "/* Il file non esiste e sarà creato durante la fase di registrazione con LocalFiles Editor. */";
|
||||
$lang['locfiledit_newfile'] = 'Il file non esiste e sarà creato durante la fase di registrazione con LocalFiles Editor';
|
||||
$lang['locfiledit_save_config'] = 'Il file è stato salvato.';
|
||||
$lang['locfiledit_show_default'] = 'Visualizzare il file ';
|
||||
$lang['locfiledit_save_bak'] = 'Una copia di backup del file sarà creata durante la fase di registrazione';
|
||||
|
@ -40,5 +40,15 @@ $lang['locfiledit_restore_confirm'] = 'Volete caricare il file di backup? Dovret
|
|||
$lang['locfiledit_bak_loaded1'] = 'Copia di backup caricata';
|
||||
$lang['locfiledit_bak_loaded2'] = 'Dovete registrarlo per salvarlo.';
|
||||
$lang['locfiledit_syntax_error'] = 'Errore di sintassi! Impossible di registrare il file.';
|
||||
/* TODO */ $lang['locfiledit_enable_editarea'] = 'Enable Editarea';
|
||||
/* TODO */ $lang['locfiledit_disable_editarea'] = 'Disable Editarea';
|
||||
/* TODO */$lang['locfiledit_new_tpl'] = 'Créer un nouveau fichier';
|
||||
/* TODO */$lang['locfiledit_new_filename'] = 'Nom du fichier';
|
||||
/* TODO */$lang['locfiledit_model'] = 'Modèle';
|
||||
/* TODO */$lang['locfiledit_empty_page'] = 'Page vierge';
|
||||
/* TODO */$lang['locfiledit_parent_directory'] = 'Dossier parent';
|
||||
/* TODO */$lang['locfiledit_filename_error'] = 'Caractères interdits dans le nom du fichier.';
|
||||
/* TODO */$lang['locfiledit_file_already_exists'] = 'Le fichier existe déjà.';
|
||||
/* TODO */$lang['locfiledit_model_error'] = 'Veuillez sélectionner un modèle.';
|
||||
|
||||
?>
|
34
plugins/LocalFilesEditor/locfiledit.css
Normal file
34
plugins/LocalFilesEditor/locfiledit.css
Normal file
|
@ -0,0 +1,34 @@
|
|||
#LocalFilesEditor {
|
||||
text-align: center;
|
||||
margin: 0 2em;
|
||||
}
|
||||
|
||||
#LocalFilesEditor .top_right {
|
||||
float: right;
|
||||
margin-right: 1%;
|
||||
}
|
||||
|
||||
#LocalFilesEditor B {
|
||||
float: left;
|
||||
}
|
||||
|
||||
#LocalFilesEditor TEXTAREA {
|
||||
margin: 0.5em 0;
|
||||
width: 99.5%;
|
||||
float: left;
|
||||
}
|
||||
|
||||
#LocalFilesEditor #editarea_buttons {
|
||||
width: 100%;
|
||||
float: left;
|
||||
text-align: left;
|
||||
display: none;
|
||||
}
|
||||
|
||||
#LocalFilesEditor #hideedit {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#LocalFilesEditor TD {
|
||||
padding: 0.5em;
|
||||
}
|
|
@ -23,7 +23,7 @@
|
|||
|
||||
/*
|
||||
Plugin Name: LocalFiles Editor
|
||||
Version: 1.8
|
||||
Version: 2.0
|
||||
Description: Edit local files from administration panel / Editeur de fichiers locaux
|
||||
Plugin URI: http://phpwebgallery.net/ext/extension_view.php?eid=144
|
||||
Author: Piwigo team
|
||||
|
@ -35,10 +35,10 @@ define('LOCALEDIT_PATH' , PHPWG_PLUGINS_PATH . basename(dirname(__FILE__)) . '/'
|
|||
|
||||
function localfiles_admin_menu($menu)
|
||||
{
|
||||
array_push($menu, array(
|
||||
'NAME' => 'LocalFiles Editor',
|
||||
'URL' => get_admin_plugin_menu_link(LOCALEDIT_PATH . 'admin.php')));
|
||||
return $menu;
|
||||
array_push($menu, array(
|
||||
'NAME' => 'LocalFiles Editor',
|
||||
'URL' => get_admin_plugin_menu_link(LOCALEDIT_PATH . 'admin.php')));
|
||||
return $menu;
|
||||
}
|
||||
|
||||
add_event_handler('get_admin_plugin_menu_links', 'localfiles_admin_menu');
|
||||
|
|
43
plugins/LocalFilesEditor/maintain.inc.php
Normal file
43
plugins/LocalFilesEditor/maintain.inc.php
Normal file
|
@ -0,0 +1,43 @@
|
|||
<?php
|
||||
// +-----------------------------------------------------------------------+
|
||||
// | Piwigo - a PHP based picture gallery |
|
||||
// +-----------------------------------------------------------------------+
|
||||
// | Copyright(C) 2008 Piwigo Team http://piwigo.org |
|
||||
// | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net |
|
||||
// | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick |
|
||||
// +-----------------------------------------------------------------------+
|
||||
// | This program is free software; you can redistribute it and/or modify |
|
||||
// | it under the terms of the GNU General Public License as published by |
|
||||
// | the Free Software Foundation |
|
||||
// | |
|
||||
// | This program is distributed in the hope that it will be useful, but |
|
||||
// | WITHOUT ANY WARRANTY; without even the implied warranty of |
|
||||
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|
||||
// | General Public License for more details. |
|
||||
// | |
|
||||
// | You should have received a copy of the GNU General Public License |
|
||||
// | along with this program; if not, write to the Free Software |
|
||||
// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
|
||||
// | USA. |
|
||||
// +-----------------------------------------------------------------------+
|
||||
|
||||
function plugin_install()
|
||||
{
|
||||
global $prefixeTable;
|
||||
|
||||
$query = '
|
||||
INSERT INTO ' . CONFIG_TABLE . ' (param,value,comment)
|
||||
VALUES ("LocalFilesEditor" , "off" , "LocalFiles Editor plugin parameters");';
|
||||
|
||||
pwg_query($query);
|
||||
}
|
||||
|
||||
function plugin_uninstall()
|
||||
{
|
||||
global $prefixeTable;
|
||||
|
||||
$query = 'DELETE FROM ' . CONFIG_TABLE . ' WHERE param="LocalFilesEditor" LIMIT 1;';
|
||||
pwg_query($query);
|
||||
}
|
||||
|
||||
?>
|
|
@ -24,6 +24,7 @@
|
|||
define('PHPWG_ROOT_PATH', '../../');
|
||||
include_once(PHPWG_ROOT_PATH . 'include/common.inc.php');
|
||||
include_once(LOCALEDIT_PATH.'functions.inc.php');
|
||||
load_language('plugin.lang', LOCALEDIT_PATH);
|
||||
check_status(ACCESS_ADMINISTRATOR);
|
||||
|
||||
if (isset($_GET['file']))
|
||||
|
@ -37,22 +38,20 @@ if (isset($_GET['file']))
|
|||
$template->set_filename('show_default', dirname(__FILE__) . '/show_default.tpl');
|
||||
|
||||
// Editarea
|
||||
if (!isset($conf['editarea_options']) or $conf['editarea_options'] !== false)
|
||||
{
|
||||
$editarea = array(
|
||||
'syntax' => 'php',
|
||||
'start_highlight' => true,
|
||||
'is_editable' => false,
|
||||
'language' => substr($user['language'], 0, 2));
|
||||
|
||||
$template->assign('editarea', array(
|
||||
'URL' => LOCALEDIT_PATH . 'editarea/edit_area_full.js',
|
||||
'OPTIONS' => $editarea));
|
||||
}
|
||||
$editarea_options = array(
|
||||
'syntax' => 'php',
|
||||
'start_highlight' => true,
|
||||
'allow_toggle' => false,
|
||||
'is_editable' => false,
|
||||
'language' => substr($user['language'], 0, 2));
|
||||
|
||||
$file = file_get_contents(PHPWG_ROOT_PATH . $path);
|
||||
|
||||
$template->assign(array('DEFAULT_CONTENT' => $file));
|
||||
|
||||
$template->assign(array(
|
||||
'DEFAULT_CONTENT' => $file,
|
||||
'LOCALEDIT_PATH' => LOCALEDIT_PATH,
|
||||
'LOAD_EDITAREA' => isset($conf['LocalFilesEditor']) ? $conf['LocalFilesEditor'] : 'on',
|
||||
'EDITAREA_OPTIONS' => $editarea_options));
|
||||
|
||||
$title = $path;
|
||||
$page['page_banner'] = '<h1>'.str_replace('/', ' / ', $path).'</h1>';
|
||||
|
|
|
@ -1,13 +1,40 @@
|
|||
{if isset($editarea)}
|
||||
<script type="text/javascript" src="{$editarea.URL}"></script>
|
||||
{* $Id$ *}
|
||||
{html_head}<link rel="stylesheet" type="text/css" href="{$LOCALEDIT_PATH}locfiledit.css">{/html_head}
|
||||
{known_script id="jquery" src=$ROOT_URL|@cat:"template-common/lib/jquery.packed.js"}
|
||||
{known_script id="editarea" src=$LOCALEDIT_PATH|@cat:"editarea/edit_area_full.js"}
|
||||
<script type="text/javascript">
|
||||
editAreaLoader.init({ldelim}
|
||||
id: "text"
|
||||
{foreach from=$editarea.OPTIONS key=option item=value}
|
||||
, {$option}: {$value|editarea_quote}
|
||||
{/foreach}
|
||||
{rdelim});
|
||||
</script>
|
||||
{/if}
|
||||
var editarea = "{$LOAD_EDITAREA}";
|
||||
|
||||
<textarea rows="30" id="text" cols="90">{$DEFAULT_CONTENT}</textarea>
|
||||
function loadEditarea() {ldelim}
|
||||
editAreaLoader.init({ldelim}
|
||||
id: "text"
|
||||
{foreach from=$EDITAREA_OPTIONS key=option item=value}
|
||||
, {$option}: {$value|editarea_quote}
|
||||
{/foreach}
|
||||
});
|
||||
jQuery("#showedit").hide();
|
||||
jQuery("#hideedit").show();
|
||||
}
|
||||
|
||||
function unloadEditarea() {ldelim}
|
||||
editAreaLoader.delete_instance("text");
|
||||
jQuery("#hideedit").hide();
|
||||
jQuery("#showedit").show();
|
||||
}
|
||||
</script>
|
||||
|
||||
<div id="LocalFilesEditor">
|
||||
|
||||
<textarea id="text" rows="30" cols="90">{$DEFAULT_CONTENT}</textarea>
|
||||
|
||||
<div id="editarea_buttons">
|
||||
<a href="javascript:loadEditarea();" id="showedit">[{'locfiledit_enable_editarea'|@translate}]</a>
|
||||
<a href="javascript:unloadEditarea();" id="hideedit">[{'locfiledit_disable_editarea'|@translate}]</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery("#editarea_buttons").show();
|
||||
if (editarea == "on") loadEditarea();
|
||||
</script>
|
||||
|
|
46
plugins/LocalFilesEditor/update_config.php
Normal file
46
plugins/LocalFilesEditor/update_config.php
Normal file
|
@ -0,0 +1,46 @@
|
|||
<?php
|
||||
// +-----------------------------------------------------------------------+
|
||||
// | Piwigo - a PHP based picture gallery |
|
||||
// +-----------------------------------------------------------------------+
|
||||
// | Copyright(C) 2008 Piwigo Team http://piwigo.org |
|
||||
// | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net |
|
||||
// | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick |
|
||||
// +-----------------------------------------------------------------------+
|
||||
// | This program is free software; you can redistribute it and/or modify |
|
||||
// | it under the terms of the GNU General Public License as published by |
|
||||
// | the Free Software Foundation |
|
||||
// | |
|
||||
// | This program is distributed in the hope that it will be useful, but |
|
||||
// | WITHOUT ANY WARRANTY; without even the implied warranty of |
|
||||
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|
||||
// | General Public License for more details. |
|
||||
// | |
|
||||
// | You should have received a copy of the GNU General Public License |
|
||||
// | along with this program; if not, write to the Free Software |
|
||||
// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
|
||||
// | USA. |
|
||||
// +-----------------------------------------------------------------------+
|
||||
|
||||
define('PHPWG_ROOT_PATH', '../../');
|
||||
include_once(PHPWG_ROOT_PATH . 'include/common.inc.php');
|
||||
include_once(LOCALEDIT_PATH.'functions.inc.php');
|
||||
check_status(ACCESS_ADMINISTRATOR);
|
||||
|
||||
$possible_values = array('on', 'off');
|
||||
|
||||
if (isset($_POST['editarea']) and in_array($_POST['editarea'], $possible_values))
|
||||
{
|
||||
if (!isset($conf['LocalFilesEditor']))
|
||||
{
|
||||
include_once(LOCALEDIT_PATH.'maintain.inc.php');
|
||||
plugin_install();
|
||||
}
|
||||
$query = '
|
||||
UPDATE ' . CONFIG_TABLE . '
|
||||
SET value = "' . $_POST['editarea'] . '"
|
||||
WHERE param="LocalFilesEditor"
|
||||
LIMIT 1';
|
||||
pwg_query($query);
|
||||
}
|
||||
|
||||
?>
|
|
@ -23,7 +23,7 @@
|
|||
|
||||
/*
|
||||
Plugin Name: Swift Theme Creator
|
||||
Version: 1.8
|
||||
Version: 2.0
|
||||
Description: Create new theme elements which can be manually updated later.
|
||||
Plugin URI: http://piwigo.org
|
||||
Author: Piwigo team
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
|
||||
/*
|
||||
Plugin Name: Add Index
|
||||
Version: 1.8
|
||||
Version: 2.0
|
||||
Description: Add file index.php file on all sub-directories of local galleries pictures. / Ajoute le fichier index.php sur les sous-répertoires de galeries d'images locales.
|
||||
Plugin URI: http://piwigo.org
|
||||
Author: Piwigo team
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
|
||||
/*
|
||||
Plugin Name: Admin Advices
|
||||
Version: 1.8
|
||||
Version: 2.0
|
||||
Description: Give you an advice on the administration page.
|
||||
Plugin URI: http://piwigo.org
|
||||
Author: Piwigo team
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
|
||||
/*
|
||||
Plugin Name: Multi view
|
||||
Version: 1.8
|
||||
Version: 2.0
|
||||
Description: Allows administrators to view gallery as guests and/or change the language and/or theme on the fly. Practical to debug changes ...
|
||||
Plugin URI: http://piwigo.org
|
||||
Author: Piwigo team
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
|
||||
/*
|
||||
Plugin Name: Check upgrades
|
||||
Version: 1.8
|
||||
Version: 2.0
|
||||
Description: Check integrity of upgrades / Contrôle d'intégrité des mises à jour
|
||||
Plugin URI: http://piwigo.org
|
||||
Author: Piwigo team
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
|
||||
/*
|
||||
Plugin Name: Event tracer
|
||||
Version: 1.8.a
|
||||
Version: 2.0
|
||||
Description: For developers. Shows all calls to trigger_event.
|
||||
Plugin URI: http://piwigo.org
|
||||
Author: Piwigo team
|
||||
|
|
|
@ -1,9 +1,11 @@
|
|||
<?php
|
||||
/*
|
||||
Plugin Name: Grum Plugins Classes.2
|
||||
Version: 2.0.0
|
||||
Version: 2.0
|
||||
Description: Collection de classes partagées entre mes plugins (existants, ou à venir) / Partaged classes between my plugins (actuals or futures)
|
||||
Plugin URI: http://phpwebgallery.net/ext/extension_view.php?eid=199
|
||||
Plugin URI: http://piwigo.org
|
||||
Author: Piwigo team
|
||||
Author URI: http://piwigo.org
|
||||
*/
|
||||
|
||||
/*
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
|
||||
/*
|
||||
Plugin Name: Language Switch
|
||||
Version: 1.8
|
||||
Version: 2.0
|
||||
Description: Switch to another language from flags on your gallery home page.
|
||||
Plugin URI: http://phpwebgallery.net/ext/extension_view.php?eid=123
|
||||
Author: Piwigo team
|
||||
|
|
Loading…
Add table
Reference in a new issue