linklist bugfix update

This commit is contained in:
Ian 2015-06-02 19:03:36 +02:00
parent 82cf98b3ba
commit 8be5a8a643
7 changed files with 495 additions and 462 deletions

View file

@ -1 +1,11 @@
2.00
- silence cache lite non static PEAR errors on $obj->remove()
- minor preparations for the Serendipity 2.0 backend
- fix multiple dtree includements using a unique name
- add css seperators
1.99.1 - use serendipity_specialchars
1.99 - compat fixes
1.98 - remove short tag occurences

View file

@ -1,5 +1,5 @@
function hide_unhide(thing, path, lines, icons, bottom){
nav=document.getElementById(thing).style
nav=document.getElementById(thing).style;
if (lines) {
if (bottom) {
plus = path + '/img/plus.gif';

View file

@ -33,3 +33,6 @@
.dtree .clip {
overflow: hidden;
}
/* linklist dtree end */

View file

@ -1,3 +1,5 @@
/* serendipity_event_linklist.css start */
div.linklist span.menu_title {
}
@ -26,7 +28,6 @@ div.linklist li {
white-space: nowrap;
}
div.linklist img {
border: 0px;
vertical-align: middle;
@ -40,3 +41,6 @@ div.linklist a.link {
div.linklist a:hover {
color: #333;
}
/* serendipity_event_linklist.css end */

View file

@ -1,5 +1,4 @@
<?php #
<?php
if (IN_serendipity !== true) {
die ("Don't hack!");
@ -24,13 +23,14 @@ class serendipity_event_linklist extends serendipity_event {
$propbag->add('description', PLUGIN_LINKLIST_DESC);
$propbag->add('event_hooks', array('backend_sidebar_entries_event_display_linklist' => true,
'backend_sidebar_entries' => true,
'backend_sidebar_admin_appearance' => true,
'plugins_linklist_input' => true,
'css' => true,
'plugins_linklist_conf' => true,
'external_plugin' => true
));
$propbag->add('author', 'Matthew Groeninger, Omid Mottaghi Rad');
$propbag->add('version', '1.99.1');
$propbag->add('version', '2.00');
$propbag->add('requirements', array(
'serendipity' => '0.8',
'smarty' => '2.6.7',
@ -128,34 +128,41 @@ class serendipity_event_linklist extends serendipity_event {
break;
case 'backend_sidebar_entries':
if ($this->get_config('active')=='true') {
echo '<li class="serendipitySideBarMenuLink serendipitySideBarMenuEntryLinks"><a href="?serendipity[adminModule]=event_display&amp;serendipity[adminAction]=linklist">'.PLUGIN_LINKLIST_ADMINLINK.'</a></li>';
if ($this->get_config('active')=='true' && $serendipity['version'][0] < 2) {
echo "\n".'<li class="serendipitySideBarMenuLink serendipitySideBarMenuEntryLinks"><a href="?serendipity[adminModule]=event_display&amp;serendipity[adminAction]=linklist">' . PLUGIN_LINKLIST_ADMINLINK . '</a></li>';
}
return true;
break;
case 'backend_sidebar_admin_appearance':
if ($this->get_config('active')=='true' && $serendipity['version'][0] > 1) {
echo "\n".'<li><a href="?serendipity[adminModule]=event_display&amp;serendipity[adminAction]=linklist">' . PLUGIN_LINKLIST_ADMINLINK . '</a></li>';
}
return true;
break;
case 'css':
if ($this->get_config('style') == "dtree") {
if ($this->get_config('style') == 'dtree') {
$searchstr = '.dtree';
$filename = "serendipity_event_dtree.css";
$filename = 'serendipity_event_dtree.css';
} else {
$searchstr = '.linklist';
$filename = "serendipity_event_linklist.css";
$filename = 'serendipity_event_linklist.css';
}
if (stristr($eventData, $searchstr)) {
// class exists in CSS, so a user has customized it and we don't need default
if (strpos($eventData, $searchstr)) {
// class exists in CSS by another Plugin, or a user has customized it and we don't need default
return true;
break;
}
$out = serendipity_getTemplateFile($filename, 'serendipityPath');
if ($out && $out != $filename) {
$eventData .= file_get_contents($out);
} else {
$eventData .= file_get_contents(dirname(__FILE__) . '/'.$filename);
$tfile = serendipity_getTemplateFile($filename, 'serendipityPath');
if (!$tfile || $tfile == $filename) {
$tfile = dirname(__FILE__) . '/' . $filename;
}
echo file_get_contents($tfile);
return true;
break;
@ -164,7 +171,7 @@ class serendipity_event_linklist extends serendipity_event {
$parts = explode('&', $uri_parts[0]);
$uri_part = $parts[0];
switch($uri_part) {
case 'dtree.js':
case 'lldtree.js': // name unique!
header('Content-Type: text/javascript');
echo file_get_contents(dirname(__FILE__).'/dtree.js');
break;
@ -178,6 +185,7 @@ class serendipity_event_linklist extends serendipity_event {
case 'plugins_linklist_input':
$eventData['links'] = $this->generate_output(false);
return true;
break;
@ -239,13 +247,14 @@ class serendipity_event_linklist extends serendipity_event {
$eventData['links'] = $this->generate_output(true);
if (@include_once("Cache/Lite.php")) {
$cache_obj = new Cache_Lite(array('cacheDir' => $serendipity['serendipityPath'].'templates_c/','automaticSerialization' => true));
$cache_obj->remove('linklist_cache');
@$cache_obj->remove('linklist_cache');
} else {
$this->set_config('cached_output','');
}
$eventData['changed'] = 'true';
}
}
return true;
break;
@ -577,7 +586,7 @@ class serendipity_event_linklist extends serendipity_event {
$q = $this->set_query($display);
$categories = $this->build_categories();
echo '<h3>'.PLUGIN_LINKLIST_ADMINLINK.'</h3>';
echo '<h3>'.PLUGIN_LINKLIST_ADMINLINK.'</h3>'."\n\n";
?>
<form action="?serendipity[adminModule]=event_display&amp;serendipity[adminAction]=linklist" method="post">
<table border="0" cellpadding="5" cellspacing="0" width="100%">
@ -632,14 +641,14 @@ class serendipity_event_linklist extends serendipity_event {
<?php
$sort_idx++;
}
echo '<br />';
echo '</table>';
echo '<div>';
echo '<input type="submit" name="REMOVE" title="'.REMOVE.'" value="'.DELETE.'" class="serendipityPrettyButton input_button" />';
echo '&nbsp;';
echo '<input type="submit" name="SAVE" title="'.SAVE.'" value="'.SAVE.'" class="serendipityPrettyButton input_button" />';
echo '</div>';
echo '</form>';
echo '
</table>
<div>
<input type="submit" name="REMOVE" title="'.REMOVE.'" value="'.DELETE.'" class="serendipityPrettyButton input_button state_cancel" />
<span>&nbsp;</span>
<input type="submit" name="SAVE" title="'.SAVE.'" value="'.SAVE.'" class="serendipityPrettyButton input_button" />
</div>
</form>';
}
}
@ -687,11 +696,12 @@ class serendipity_event_linklist extends serendipity_event {
<tr><td valign="top"><?php echo PLUGIN_LINKLIST_LINKDESC; ?></td><td><textarea style="width: 100%" name="serendipity[add_link][desc]" id="serendipity[add_link][desc]" cols="80" rows="3"><?php echo $desc; ?></textarea></td></tr>
<?php
echo '</table>';
echo '<div>';
echo $button;
echo '</div>';
echo '</form>';
echo '
</table>
<div>
' . $button . '
</div>
</form>';
}
function output_categoryadmin() {
@ -706,18 +716,24 @@ class serendipity_event_linklist extends serendipity_event {
<form action="?serendipity[adminModule]=event_display&amp;serendipity[adminAction]=linklist&amp;serendipity[manage_category]=1" method="post">
<input type="hidden" name="serendipity[add_link][id]" value="<?php echo $id; ?>">
<table border="0" cellpadding="5" cellspacing="0" width="100%">
<tr><td><?php echo PLUGIN_LINKLIST_CAT_NAME; ?></td><td><input class="input_textbox" type="text" name="serendipity[add_category][title]" size="30" /></td></tr>
<tr><td><?php echo PLUGIN_LINKLIST_PARENT_CATEGORY; ?></td><td><?php echo $this->category_box('cat',$categories,$cat); ?></td></tr>
<tr>
<td><?php echo PLUGIN_LINKLIST_CAT_NAME; ?></td>
<td><input class="input_textbox" type="text" name="serendipity[add_category][title]" size="30" /></td>
</tr>
<tr>
<td><?php echo PLUGIN_LINKLIST_PARENT_CATEGORY; ?></td>
<td><?php echo $this->category_box('cat',$categories,$cat); ?></td>
</tr>
<?php
echo '</table>';
echo '<div>';
echo $button;
echo '</div>';
echo '</form>';
echo '
</table>
<div>
' . $button . '
</div>
</form>
echo '<h3>'.PLUGIN_LINKLIST_ADMINCAT.'</h3>';
echo '<a href="?serendipity[adminModule]=event_display&amp;serendipity[adminAction]=linklist">'.PLUGIN_LINKLIST_ADMINLINK.'</a>';
<h3>' . PLUGIN_LINKLIST_ADMINCAT . '</h3>
<a href="?serendipity[adminModule]=event_display&amp;serendipity[adminAction]=linklist">' . PLUGIN_LINKLIST_ADMINLINK . '</a>';
?>
<form action="?serendipity[adminModule]=event_display&amp;serendipity[adminAction]=linklist&amp;serendipity[manage_category]=1" method="post">
@ -739,17 +755,19 @@ class serendipity_event_linklist extends serendipity_event {
<td width="16">
<input class="input_checkbox" type="checkbox" name="serendipity[category_to_remove][]" value="<?php echo $category['categoryid']; ?>" />
</td>
<td width="300" style="padding-left: <?php echo ($category['depth']*15)+20 ?>px"><img src="<?php echo serendipity_getTemplateFile('admin/img/folder.png') ?>" style="vertical-align: bottom;"> <?php echo (function_exists('serendipity_specialchars') ? serendipity_specialchars($category['category_name']) : htmlspecialchars($category['category_name'], ENT_COMPAT, LANG_CHARSET)) ?></td>
<td width="300" style="padding-left: <?php echo ($category['depth']*15)+20 ?>px">
<img src="<?php echo serendipity_getTemplateFile('admin/img/folder.png') ?>" style="vertical-align: bottom;"> <?php echo (function_exists('serendipity_specialchars') ? serendipity_specialchars($category['category_name']) : htmlspecialchars($category['category_name'], ENT_COMPAT, LANG_CHARSET)) ?>
</td>
</tr>
<?php
}
echo '<br />';
echo '</table>';
echo '<div>';
echo '<input type="submit" name="REMOVE" title="'.REMOVE.'" value="'.DELETE.'" class="serendipityPrettyButton input_button" />';
echo '</div>';
echo '<div style="font-size: smaller;">'.PLUGIN_LINKLIST_DELETE_WARN.'</div>';
echo '</form>';
echo '
</table>
<div>
<input type="submit" name="REMOVE" title="' . REMOVE . '" value="' . DELETE . '" class="serendipityPrettyButton input_button state_cancel" />
</div>
<div style="font-size: smaller;">' . PLUGIN_LINKLIST_DELETE_WARN . '</div>
</form>';
}

View file

@ -1,5 +1,4 @@
<?php #
<?php
if (IN_serendipity !== true) {
die ("Don't hack!");
@ -25,7 +24,7 @@ class serendipity_plugin_linklist extends serendipity_plugin
$propbag->add('description', PLUGIN_LINKS_BLAHBLAH);
$propbag->add('stackable', true);
$propbag->add('author', 'Matthew Groeninger, Omid Mottaghi Rad');
$propbag->add('version', '1.20');
$propbag->add('version', '1.21');
$propbag->add('stackable', false);
$propbag->add('configuration', array(
'title',
@ -375,8 +374,7 @@ class serendipity_plugin_linklist extends serendipity_plugin
$str = $this->get_config('prepend_text');
$str .= "\n\n";
if ($style == "dtree") {
$str.='<script src="'.$serendipity['baseURL'] . ($serendipity['rewrite'] == 'none' ? $serendipity['indexFile'] . '?/' : '').'plugin/dtree.js" type="text/javascript"></script>';
$str .= "\n".'<script src="' . $serendipity['baseURL'] . ($serendipity['rewrite'] == 'none' ? $serendipity['indexFile'] . '?/' : '') . 'plugin/lldtree.js" type="text/javascript"></script>'."\n";
if ($this->get_config('showOpenAndCloseLinks')=='true' && $this->get_config('locationOfOpenAndClose')=='top'){
$str .= '<p><a href="javascript: d.openAll();">'.$this->get_config('openAllText').'</a> | <a href="javascript: d.closeAll();">'.$this->get_config('closeAllText').'</a></p>';
@ -528,8 +526,8 @@ class serendipity_plugin_linklist extends serendipity_plugin
if ($this->get_config('cache') == 'no') {
if (@include_once("Cache/Lite.php")) {
$cache_obj = new Cache_Lite( array('cacheDir' => $serendipity['serendipityPath'].'templates_c/','automaticSerialization' => true));
$cache_obj->remove('linklist_html');
$cache_obj->remove('linklist_xmlhash');
@$cache_obj->remove('linklist_html');
@$cache_obj->remove('linklist_xmlhash');
}
}
$setdata = array('display' => $this->get_config('display'),