A new 2.x backend for serendipity_event_todolist

- Use proper backend markup
- Close the project list table properly
- Fix table headings
- Proper up/down buttons
- Add backend stylesheet
- Fix missing type attributes
- Increment version requirement
- Add author

References s9y/Serendipity#426
This commit is contained in:
Matthias Mees 2016-10-12 17:01:55 +02:00
parent fe97efc388
commit 73900dd6ff
5 changed files with 255 additions and 186 deletions

View file

@ -40,7 +40,7 @@
@define('PLUGIN_EVENT_TODOLIST_CATEGORY_NAME_CUSTOM','Besondere Formatierung');
@define('PLUGIN_EVENT_TODOLIST_CATEGORY_NAME_DEFAULT','Standard-Formatierung');
@define('PLUGIN_EVENT_TODOLIST_CATDB_WARNING','Die besondere Kategorisierung wurde aktiviert, aber die Kategoriedatenbank besteht nicht. Bitte hier klicken um die Datenbank anzulegen.');
@define('PLUGIN_EVENT_TODOLIST_ADD_CAT','Kategorien verwalten');
@define('PLUGIN_EVENT_TODOLIST_ADD_CAT','Kategorie anlegen');
@define('PLUGIN_EVENT_TODOLIST_CAT_NAME','Name der Kategorie');
@define('PLUGIN_EVENT_TODOLIST_PARENT_CATEGORY','Übergeordnete Kategorie');
@define('PLUGIN_EVENT_TODOLIST_ADMINCAT','Kategorien verwalten');

View file

@ -40,7 +40,7 @@
@define('PLUGIN_EVENT_TODOLIST_CATEGORY_NAME_CUSTOM','Besondere Formatierung');
@define('PLUGIN_EVENT_TODOLIST_CATEGORY_NAME_DEFAULT','Standard-Formatierung');
@define('PLUGIN_EVENT_TODOLIST_CATDB_WARNING','Die besondere Kategorisierung wurde aktiviert, aber die Kategoriedatenbank besteht nicht. Bitte hier klicken um die Datenbank anzulegen.');
@define('PLUGIN_EVENT_TODOLIST_ADD_CAT','Kategorien verwalten');
@define('PLUGIN_EVENT_TODOLIST_ADD_CAT','Kategorie anlegen');
@define('PLUGIN_EVENT_TODOLIST_CAT_NAME','Name der Kategorie');
@define('PLUGIN_EVENT_TODOLIST_PARENT_CATEGORY','Übergeordnete Kategorie');
@define('PLUGIN_EVENT_TODOLIST_ADMINCAT','Kategorien verwalten');

View file

@ -1,7 +1,7 @@
<?php #
<?php #
/**
* @version
* @version
* @author Translator Name <yourmail@example.com>
* EN-Revision: Revision of lang_en.inc.php
*/
@ -63,7 +63,7 @@
@define('PLUGIN_EVENT_TODOLIST_CATEGORY_NAME_CUSTOM','Custom');
@define('PLUGIN_EVENT_TODOLIST_CATEGORY_NAME_DEFAULT','Default');
@define('PLUGIN_EVENT_TODOLIST_CATDB_WARNING','You are configured to use custom categories, but the category database does not exist. Please click here to create the database.');
@define('PLUGIN_EVENT_TODOLIST_ADD_CAT','Manage categories');
@define('PLUGIN_EVENT_TODOLIST_ADD_CAT','Add category');
@define('PLUGIN_EVENT_TODOLIST_ADD_COLOR','Add a Color');
@define('PLUGIN_EVENT_TODOLIST_MANAGE_COLORS','Manage Colors');
@define('PLUGIN_EVENT_TODOLIST_CAT_NAME','Category Name');

View file

@ -37,12 +37,13 @@ class serendipity_event_todolist extends serendipity_event {
$propbag->add('description', PLUGIN_EVENT_TODOLIST_DESC);
$propbag->add('event_hooks', array('backend_sidebar_entries_event_display_percentagedone' => true,
'external_plugin' => true,
'backend_sidebar_entries' => true
'backend_sidebar_entries' => true,
'css_backend' => true
));
$propbag->add('author', 'Steven Tonnesen');
$propbag->add('version', '1.24.1');
$propbag->add('author', 'Steven Tonnesen, Matthias Mees');
$propbag->add('version', '1.25.0');
$propbag->add('requirements', array(
'serendipity' => '0.8',
'serendipity' => '2.0',
'smarty' => '2.6.7',
'php' => '4.1.0'
));
@ -377,10 +378,15 @@ class serendipity_event_todolist extends serendipity_event {
break;
case 'backend_sidebar_entries':
echo '<li class="serendipitySideBarMenuLink serendipitySideBarMenuEntryLinks"><a href="?serendipity[adminModule]=event_display&amp;serendipity[adminAction]=percentagedone">' . PLUGIN_EVENT_TODOLIST_ADMINPROJECT . '</a></li>';
echo '<li><a href="?serendipity[adminModule]=event_display&amp;serendipity[adminAction]=percentagedone">' . PLUGIN_EVENT_TODOLIST_ADMINPROJECT . '</a></li>';
return true;
break;
case 'css_backend':
echo file_get_contents(dirname(__FILE__) . '/todolist_backend.css');
break;
case 'external_plugin':
$parts = explode('_', $eventData);
if (!empty($parts[1])) {
@ -1496,17 +1502,21 @@ class serendipity_event_todolist extends serendipity_event {
echo '<h3>'.PLUGIN_EVENT_TODOLIST_ADMINPROJECT.'</h3>';
?>
<form action="?serendipity[adminModule]=event_display&amp;serendipity[adminAction]=percentagedone" method="post">
<table border="0" cellpadding="5" cellspacing="0" width="100%">
<tr>
<td>&nbsp;</td>
<td><strong><?php echo PLUGIN_EVENT_TODOLIST_PROJECT; ?></strong></td>
<td><strong><?php echo PLUGIN_EVENT_TODOLIST_PERCENTDONE; ?></strong></td>
<td><strong><?php echo PLUGIN_EVENT_TODOLIST_HIDDEN; ?></strong></td>
<td><strong><?php echo CATEGORY; ?></strong></td>
<td><strong><?php echo PLUGIN_EVENT_TODOLIST_BLOGENTRY; ?></strong></td>
<td><strong><?php echo PLUGIN_EVENT_TODOLIST_COLOR; ?></strong></td>
<?php echo $this->tdoutput; ?>
</tr>
<div class="serendipity_todolist_wrap">
<table>
<thead>
<tr>
<th>&nbsp;</th>
<th><?php echo PLUGIN_EVENT_TODOLIST_PROJECT; ?></th>
<th id="todo_done"><?php echo PLUGIN_EVENT_TODOLIST_PERCENTDONE; ?></th>
<th id="todo_hide"><?php echo PLUGIN_EVENT_TODOLIST_HIDDEN; ?></th>
<th><?php echo CATEGORY; ?></th>
<th id="todo_assign"><?php echo PLUGIN_EVENT_TODOLIST_BLOGENTRY; ?></th>
<th id="todo_color"><?php echo PLUGIN_EVENT_TODOLIST_COLOR; ?></th>
<?php echo $this->tdoutput; ?>
</tr>
</thead>
<tbody>
<?php
$sql = serendipity_db_query($q);
if ($sql && is_array($sql)) {
@ -1522,14 +1532,14 @@ class serendipity_event_todolist extends serendipity_event {
$id = $row['id'];
if ($display == 'order_num') {
if ($sort_idx == 0) {
$moveup = '<td style="border-bottom: 1px solid #000000">&nbsp;</td>';
$moveup = '<td>&nbsp;</td>';
} else {
$moveup = '<td style="border-bottom: 1px solid #000000"><a href="?serendipity[adminModule]=event_display&amp;serendipity[adminAction]=percentagedone&amp;submit=move+up&amp;serendipity[project_to_move]=' . $id . '" style="border: 0"><img src="' . serendipity_getTemplateFile('admin/img/uparrow.png') .'" border="0" alt="' . UP . '" /></a></td>';
$moveup = '<td><a class="button_link" href="?serendipity[adminModule]=event_display&amp;serendipity[adminAction]=percentagedone&amp;submit=move+up&amp;serendipity[project_to_move]=' . $id . '"><span class="icon-up-dir"></span><span class="visuallyhidden">' . UP . '</span></a></td>';
}
if ($sort_idx == (count($sql)-1)) {
$movedown = '<td style="border-bottom: 1px solid #000000">&nbsp;</td>';
$movedown = '<td>&nbsp;</td>';
} else {
$movedown = '<td style="border-bottom: 1px solid #000000">'.($moveup != '' ? '&nbsp;' : '') . '<a href="?serendipity[adminModule]=event_display&amp;serendipity[adminAction]=percentagedone&amp;submit=move+down&serendipity[project_to_move]=' . $id . '" style="border: 0"><img src="' . serendipity_getTemplateFile('admin/img/downarrow.png') . '" alt="'. DOWN .'" border="0" /></a></td>';
$movedown = '<td><a class="button_link" href="?serendipity[adminModule]=event_display&amp;serendipity[adminAction]=percentagedone&amp;submit=move+down&serendipity[project_to_move]=' . $id . '"><span class="icon-down-dir"></span><span class="visuallyhidden">'. DOWN .'</span></a></td>';
}
}
@ -1558,52 +1568,38 @@ class serendipity_event_todolist extends serendipity_event {
}
?>
<tr>
<td style="border-bottom: 1px solid #000000" align="right">
<div>
<input class="input_checkbox" type="checkbox" name="serendipity[project_to_remove][]" value="<?php echo $id; ?>" />
</div>
</td>
<td style="border-bottom: 1px solid #000000"><strong><a href="?serendipity[adminModule]=event_display&amp;serendipity[adminAction]=percentagedone&amp;serendipity[edit_project]=<?php echo $id; ?>"><?php echo $project; ?></a></strong></td>
<td style="border-bottom: 1px solid #000000" nowrap="nowrap" align="center">
<div><input class="input_textbox" name="serendipity[project_to_repercent][<?php echo $id?>]" value="<?php echo $percentagecomplete?>" size="3" />%</div>
</td>
<td style="border-bottom: 1px solid #000000" align="center">
<input class="input_checkbox" type="checkbox" name="serendipity[project_to_hide][<?php echo $id?>]" value="1" <?php echo $hiddenchecked?> />
</td>
<td style="border-bottom: 1px solid #000000">
<?php echo $this->category_box($id, $categories, $current_category); ?>
</td>
<td style="border-bottom: 1px solid #000000">
<select name="serendipity[project_to_reassign][<?php echo $id?>]"><?php echo $entrytext?></select>
</td>
<td style="border-bottom: 1px solid #000000">
<select name="serendipity[project_to_recolor][<?php echo $id?>]"><?php echo $colortext?></select>
</td>
<td class="form_check"><input type="checkbox" name="serendipity[project_to_remove][]" value="<?php echo $id; ?>"></td>
<td><a href="?serendipity[adminModule]=event_display&amp;serendipity[adminAction]=percentagedone&amp;serendipity[edit_project]=<?php echo $id; ?>"><?php echo $project; ?></a></td>
<td class="form_field"><input type="text" aria-labelledby="todoproj_done" name="serendipity[project_to_repercent][<?php echo $id?>]" value="<?php echo $percentagecomplete?>" size="3"></td>
<td class="form_check"><input aria-labelledby="todo_hide" type="checkbox" name="serendipity[project_to_hide][<?php echo $id?>]" value="1" <?php echo $hiddenchecked?>></td>
<td class="form_select"><?php echo $this->category_box($id, $categories, $current_category); ?></td>
<td class="form_select"><select aria-labelledby="todo_assign" name="serendipity[project_to_reassign][<?php echo $id?>]"><?php echo $entrytext?></select></td>
<td class="form_select"><select aria-labelledby="todo_color" name="serendipity[project_to_recolor][<?php echo $id?>]"><?php echo $colortext?></select></td>
<?php echo $moveup ?>
<?php echo $movedown ?>
</tr>
<?php
$sort_idx++;
}
echo '<br />';
if ($this->get_config('category') == 'custom') {
$catproject = '<a href="?serendipity[adminModule]=event_display&amp;serendipity[adminAction]=percentagedone&amp;serendipity[manage_category]=1">'.PLUGIN_EVENT_TODOLIST_ADD_CAT.'</a>';
}
$colorproject = '<a href="?serendipity[adminModule]=event_display&amp;serendipity[adminAction]=percentagedone&amp;serendipity[manage_colors]=1">'.PLUGIN_EVENT_TODOLIST_MANAGE_COLORS.'</a>';
echo "<tr><td colspan=4>&nbsp;</td><td>$catproject</td><td>&nbsp;</td><td>$colorproject</td></tr>";
echo '</table>';
echo '<div>';
echo '<input type="submit" name="SAVE" title="' . SAVE . '" value="' . SAVE . '" class="serendipityPrettyButton input_button" />';
echo '&nbsp;';
echo '<input type="submit" name="REMOVE" title="' . REMOVE . '" value="' . DELETE . '" class="serendipityPrettyButton input_button" />';
echo '</div>';
echo '</form>';
}
echo '</tbody>';
echo '</table>';
echo '</div>';
if ($this->get_config('category') == 'custom') {
$catproject = ' <a class="button_link" href="?serendipity[adminModule]=event_display&amp;serendipity[adminAction]=percentagedone&amp;serendipity[manage_category]=1">'.PLUGIN_EVENT_TODOLIST_ADD_CAT.'</a>';
}
$colorproject = ' <a class="button_link" href="?serendipity[adminModule]=event_display&amp;serendipity[adminAction]=percentagedone&amp;serendipity[manage_colors]=1">'.PLUGIN_EVENT_TODOLIST_MANAGE_COLORS.'</a>';
echo '<div class="form_buttons">';
echo ' <input type="submit" name="SAVE" title="' . SAVE . '" value="' . SAVE . '">' . "\n";
echo ' <input class="state_cancel" type="submit" name="REMOVE" title="' . REMOVE . '" value="' . DELETE . '">';
echo $catproject;
echo $colorproject;
echo '</div>';
echo '</form>';
}
function category_box($id,$categories,$current_category = 0) {
$x = "\n<select name=\"serendipity[project_to_recat][".$id."]\">\n";
$x = "\n<select id=\"serendipity_project_to_recat\" name=\"serendipity[project_to_recat][".$id."]\">\n";
foreach ($categories as $k => $v) {
$x .= " <option value=\"$k\"" . ($k == $current_category ? ' selected="selected"' : '') . ">$v</option>\n";
}
@ -1631,24 +1627,24 @@ class serendipity_event_todolist extends serendipity_event {
$entry = $res['entry'];
$hidden = $res['hidden'];
}
$button = '<input type="submit" name="EDIT" title="' . EDIT . '" value="' . EDIT . '" class="serendipityPrettyButton input_button" />';
$button = '<input type="submit" name="EDIT" title="' . EDIT . '" value="' . EDIT . '">';
} else {
$maintitle = PLUGIN_EVENT_TODOLIST_ADDPROJECT;
$button = '<input type="submit" name="ADD" title="' . GO . '" value="' . GO . '" class="serendipityPrettyButton input_button" />';
$button = '<input type="submit" name="ADD" title="' . GO . '" value="' . GO . '">';
}
if ($this->get_config('category') == 'custom') {
$catproject = '(<a href="?serendipity[adminModule]=event_display&amp;serendipity[adminAction]=percentagedone&amp;serendipity[manage_category]=1">'.PLUGIN_EVENT_TODOLIST_ADD_CAT.'</a>)';
$catproject = '<a class="button_link" href="?serendipity[adminModule]=event_display&amp;serendipity[adminAction]=percentagedone&amp;serendipity[manage_category]=1">'.PLUGIN_EVENT_TODOLIST_ADD_CAT.'</a>';
}
$colorproject = '(<a href="?serendipity[adminModule]=event_display&amp;serendipity[adminAction]=percentagedone&amp;serendipity[manage_colors]=1">'.PLUGIN_EVENT_TODOLIST_MANAGE_COLORS.'</a>)';
echo '<h3>' . $maintitle . '</h3>';
$colorproject = '<a class="button_link" href="?serendipity[adminModule]=event_display&amp;serendipity[adminAction]=percentagedone&amp;serendipity[manage_colors]=1">'.PLUGIN_EVENT_TODOLIST_MANAGE_COLORS.'</a>';
echo '<h2>' . $maintitle . '</h2>';
$entrytext = $this->getEntrytext($projectentry);
if ($this->check_gd()) {
$nogdwarning = '';
} else {
$nogdwarning = "<br />" . PLUGIN_EVENT_TODOLIST_NOGDLIB;
$nogdwarning = ' ' . PLUGIN_EVENT_TODOLIST_NOGDLIB;
}
$q = "SELECT *
@ -1666,40 +1662,48 @@ class serendipity_event_todolist extends serendipity_event {
}
}
?>
<form action="?serendipity[adminModule]=event_display&amp;serendipity[adminAction]=percentagedone" method="post">
<input type="hidden" name="serendipity[add_project][id]" value="<?php echo $id; ?>" />
<table border="0" cellpadding="5" cellspacing="0" width="100%">
<tr>
<td><?php echo PLUGIN_EVENT_TODOLIST_PROJECT; ?></td>
<td><input class="input_textbox" type="text" name="serendipity[add_project][project]" value="<?php echo $project; ?>" size="30" /></td>
</tr>
<form class="serendipity_todolist_form" action="?serendipity[adminModule]=event_display&amp;serendipity[adminAction]=percentagedone" method="post">
<input type="hidden" name="serendipity[add_project][id]" value="<?php echo $id; ?>">
<tr>
<td><?php echo CATEGORY; ?> <?php echo $catproject;?></td>
<td><?php echo $this->category_box('cat',$categories,$cat); ?></td>
</tr>
<div class="form_field">
<label for="serendipity_addproject_project"><?php echo PLUGIN_EVENT_TODOLIST_PROJECT; ?></label>
<input id="serendipity_addproject_project" type="text" name="serendipity[add_project][project]" value="<?php echo $project; ?>" size="30">
</div>
<tr>
<td><?php echo PLUGIN_EVENT_TODOLIST_COLOR; ?> <?php echo $colorproject;?></td>
<td><select name="serendipity[add_project][colorid]"><?php echo $colortext?></select></td>
</tr>
<div class="form_select">
<label for="serendipity_project_to_recat"><?php echo CATEGORY; ?></label>
<?php echo $this->category_box('cat',$categories,$cat); ?>
<?php echo $catproject;?>
</div>
<tr>
<td><?php echo PLUGIN_EVENT_TODOLIST_PERCENTAGECOMPLETE; ?></td>
<td><input class="input_textbox" type="text" name="serendipity[add_project][percentagecomplete]" value="<?php echo $percentagecomplete; ?>" size="5" />%<?php echo $nogdwarning; ?></td>
</tr>
<div class="form_select">
<label for="serendipity_addproject_colorid"><?php echo PLUGIN_EVENT_TODOLIST_COLOR; ?></label>
<select id="serendipity_addproject_colorid" name="serendipity[add_project][colorid]">
<?php echo $colortext?>
</select>
<?php echo $colorproject;?>
</div>
<tr>
<td><?php echo PLUGIN_EVENT_TODOLIST_BLOGENTRY; ?></td>
<td><select name="serendipity[add_project][entry]"><?php echo $entrytext?></select></td>
</tr>
<div class="form_field">
<label for="serendipity_addproject_percentagecomplete"><?php echo PLUGIN_EVENT_TODOLIST_PERCENTAGECOMPLETE; ?></label>
<input id="serendipity_addproject_percentagecomplete" type="text" name="serendipity[add_project][percentagecomplete]" value="<?php echo $percentagecomplete; ?>" size="3"><?php echo $nogdwarning; ?>
</div>
<tr>
<td><?php echo PLUGIN_EVENT_TODOLIST_PROJECTDESC; ?></td>
<td><textarea style="width: 100%" name="serendipity[add_project][desc]" id="serendipity[add_project][desc]" cols="80" rows="3"><?php echo $desc; ?></textarea></td>
</tr>
</table>
<div><?php echo $button; ?></div>
<div class="form_select">
<label for="serendipity_addproject_entry"><?php echo PLUGIN_EVENT_TODOLIST_BLOGENTRY; ?></label>
<select id="serendipity_addproject_entry" name="serendipity[add_project][entry]">
<?php echo $entrytext?>
</select>
</div>
<div class="form_area">
<label for="serendipity[add_project][desc]"><?php echo PLUGIN_EVENT_TODOLIST_PROJECTDESC; ?></label>
<textarea name="serendipity[add_project][desc]" id="serendipity[add_project][desc]" rows="3"><?php echo $desc; ?></textarea>
</div>
<div class="form_buttons">
<?php echo $button; ?>
</div>
</form>
<?php
}
@ -1709,42 +1713,48 @@ class serendipity_event_todolist extends serendipity_event {
$display = $this->get_config('display');
$categories = $this->build_categories();
$maintitle = PLUGIN_EVENT_TODOLIST_ADD_COLOR;
$button = '<input type="submit" name="ADD" title="' . GO . '" value="' . GO . '" class="serendipityPrettyButton input_button" />';
echo '<h3>'.$maintitle.'</h3>';
$button = '<input type="submit" name="ADD" title="' . GO . '" value="' . GO . '">';
echo '<h2>'.$maintitle.'</h2>';
?>
<form action="?serendipity[adminModule]=event_display&amp;serendipity[adminAction]=percentagedone&amp;serendipity[manage_colors]=1" method="post">
<input type="hidden" name="serendipity[add_project][id]" value="<?php echo $id; ?>" />
<table border="0" cellpadding="5" cellspacing="0" width="100%">
<tr>
<td><?php echo PLUGIN_EVENT_TODOLIST_ADDCOLOR_NAME; ?></td>
<td><input class="input_textbox" type="text" name="serendipity[add_color][title]" size="16" /></td>
</tr>
<form class="serendipity_todolist_form" action="?serendipity[adminModule]=event_display&amp;serendipity[adminAction]=percentagedone&amp;serendipity[manage_colors]=1" method="post">
<input type="hidden" name="serendipity[add_project][id]" value="<?php echo $id; ?>">
<tr>
<td><?php echo PLUGIN_EVENT_TODOLIST_ADDCOLOR_COLOR1; ?></td>
<td><input class="input_textbox" type="text" name="serendipity[add_color][color1]" size="8" /></td>
</tr>
<div class="form_field">
<label for="serendipity_addcolor_title"><?php echo PLUGIN_EVENT_TODOLIST_ADDCOLOR_NAME; ?></label>
<input id="serendipity_addcolor_title" type="text" name="serendipity[add_color][title]" size="10">
</div>
<tr>
<td><?php echo PLUGIN_EVENT_TODOLIST_ADDCOLOR_COLOR2; ?></font></td>
<td><input class="input_textbox" type="text" name="serendipity[add_color][color2]" size="8" /></td>
</tr>
</table>
<div><?php echo $button; ?></div>
<div class="form_field">
<label for="serendipity_addcolor_color1"><?php echo PLUGIN_EVENT_TODOLIST_ADDCOLOR_COLOR1; ?></label>
<input id="serendipity_addcolor_color1" type="text" name="serendipity[add_color][color1]" size="7">
</div>
<div class="form_field">
<label for="serendipity_addcolor_color2"><?php echo PLUGIN_EVENT_TODOLIST_ADDCOLOR_COLOR2; ?></label>
<input id="serendipity_addcolor_color2" type="text" name="serendipity[add_color][color2]" size="7">
</div>
<div class="form_buttons">
<?php echo $button; ?>
</div>
</form>
<?php
echo '<h3>'.PLUGIN_EVENT_TODOLIST_MANAGE_COLORS.'</h3>';
echo "<a href=# onclick=\"F1 = window.open('index.php?/plugin/colorwheel','Zoom','height=600,width=950,top=0,left=0,toolbar=no,menubar=no,location=no,resize=1,resizable=1,statusbar=0');\">".PLUGIN_EVENT_TODOLIST_COLORWHEEL.'</a>';
echo "<a class='button_link' href=# onclick=\"F1 = window.open('index.php?/plugin/colorwheel','Zoom','height=600,width=950,top=0,left=0,toolbar=no,menubar=no,location=no,resize=1,resizable=1,statusbar=0');\">".PLUGIN_EVENT_TODOLIST_COLORWHEEL.'</a>';
?>
<form action="?serendipity[adminModule]=event_display&amp;serendipity[adminAction]=percentagedone&amp;serendipity[manage_colors]=1" method="post">
<table border="2" cellpadding="1" cellspacing="0" width="100%">
<tr>
<td></td>
<td align="center"><strong><?php echo PLUGIN_EVENT_TODOLIST_COLOR; ?></strong></td>
<td colspan="2" align="center"><strong><?php echo PLUGIN_EVENT_TODOLIST_COLOR1; ?></strong></td>
<td colspan="2" align="center"><strong><?php echo PLUGIN_EVENT_TODOLIST_COLOR2; ?></strong></td>
<td align="center"><strong><?php echo PLUGIN_EVENT_TODOLIST_SAMPLE; ?></strong></td>
</tr>
<div class="serendipity_todolist_wrap">
<table>
<thead>
<tr>
<th>&nbsp;</th>
<th><?php echo PLUGIN_EVENT_TODOLIST_COLOR; ?></th>
<th colspan="2"><?php echo PLUGIN_EVENT_TODOLIST_COLOR1; ?></th>
<th colspan="2"><?php echo PLUGIN_EVENT_TODOLIST_COLOR2; ?></th>
<th><?php echo PLUGIN_EVENT_TODOLIST_SAMPLE; ?></th>
</tr>
</thead>
<tbody>
<?php
$q = "SELECT *
FROM {$serendipity['dbPrefix']}project_colors
@ -1781,34 +1791,32 @@ class serendipity_event_todolist extends serendipity_event {
$color1 = preg_replace('/[^0-9a-fA-F]/', '', $color1);
$color2 = preg_replace('/[^0-9a-fA-F]/', '', $color2);
?>
<tr>
<td width="16">
<input class="input_checkbox" type="checkbox" name="serendipity[color_to_remove][]" value="<?php echo $color['colorid']; ?>" />
</td>
<tr>
<td class="form_check"><input type="checkbox" name="serendipity[color_to_remove][]" value="<?php echo $color['colorid']; ?>"></td>
<!--
<td style="border-bottom: 1px solid #000000" nowrap="nowrap" align="center">
<div><input name="serendipity[project_to_repercent][<?php echo $id?>]" value="<?php echo $percentagecomplete?>" size="3" />%</div>
<div><input type="text" name="serendipity[project_to_repercent][<?php echo $id?>]" value="<?php echo $percentagecomplete?>" size="3" />%</div>
</td>
-->
<td width="30" align="center"><div><input class="input_textbox" name="serendipity[color_to_rename][<?php echo $colorid?>]" value="<?php echo $color['color_name'] ?>" size="16" /></td>
<td width="10" bgcolor="#<?php echo $color1 ?>"> </td>
<td width="30" align="center"><div><input class="input_textbox" name="serendipity[color_to_recolor1][<?php echo $colorid?>]" value="<?php echo $color['color1'] ?>" size="8" /></td>
<td width="10" bgcolor="#<?php echo $color2 ?>"> </td>
<td width="30" align="center"><div><input class="input_textbox" name="serendipity[color_to_recolor2][<?php echo $colorid?>]" value="<?php echo $color['color2'] ?>" size="8" /></td>
<td width="120" align="center"><img src="<?php echo $imgsrc ?>" height="<?php echo $height?>" width="<?php echo $barlength?>" alt=""/></td>
</tr>
<td class="form_field"><input type="text" name="serendipity[color_to_rename][<?php echo $colorid?>]" value="<?php echo $color['color_name'] ?>" size="16"></td>
<td width="10" bgcolor="#<?php echo $color1 ?>"> </td>
<td class="form_field"><input type="text" name="serendipity[color_to_recolor1][<?php echo $colorid?>]" value="<?php echo $color['color1'] ?>" size="7"></td>
<td width="10" bgcolor="#<?php echo $color2 ?>"> </td>
<td class="form_field"><input type="text" name="serendipity[color_to_recolor2][<?php echo $colorid?>]" value="<?php echo $color['color2'] ?>" size="7"></td>
<td><img src="<?php echo $imgsrc ?>" height="<?php echo $height?>" width="<?php echo $barlength?>" alt=""></td>
</tr>
<?php
}
?>
</table>
<div>
</table>
</div>
<div class="form_buttons">
<?php
echo '<input type="submit" name="SAVE" title="'.SAVE.'" value="'.SAVE.'" class="serendipityPrettyButton input_button" />';
echo '&nbsp;';
echo '<input type="submit" name="REMOVE" title="'.REMOVE.'" value="'.DELETE.'" class="serendipityPrettyButton input_button" />';
echo ' <input type="submit" name="SAVE" title="'.SAVE.'" value="'.SAVE.'">';
echo ' <input class="state_cancel" type="submit" name="REMOVE" title="'.REMOVE.'" value="'.DELETE.'">';
?>
</div>
</div>
</form>
<?php
}
@ -1828,39 +1836,45 @@ class serendipity_event_todolist extends serendipity_event {
$colortext .= '<option value="'.$color['colorid'].'">'.$color['color_name']."</option>\n";
}
$maintitle = PLUGIN_EVENT_TODOLIST_ADD_CAT;
$button = '<input type="submit" name="ADD" title="'.GO.'" value="'.GO.'" class="serendipityPrettyButton input_button" />';
echo '<h3>'.$maintitle.'</h3>';
$button = '<input type="submit" name="ADD" title="'.GO.'" value="'.GO.'">';
echo '<h2>'.$maintitle.'</h2>';
?>
<form action="?serendipity[adminModule]=event_display&amp;serendipity[adminAction]=percentagedone&amp;serendipity[manage_category]=1" method="post">
<input type="hidden" name="serendipity[add_project][id]" value="<?php echo $id; ?>">
<table border="0" cellpadding="5" cellspacing="0" width="100%">
<tr>
<td><?php echo PLUGIN_EVENT_TODOLIST_CAT_NAME; ?></td>
<td><input class="input_textbox" type="text" name="serendipity[add_category][title]" size="30" /></td>
</tr>
<form class="serendipity_todolist_form" action="?serendipity[adminModule]=event_display&amp;serendipity[adminAction]=percentagedone&amp;serendipity[manage_category]=1" method="post">
<input type="hidden" name="serendipity[add_project][id]" value="<?php echo $id; ?>">
<tr>
<td><?php echo PLUGIN_EVENT_TODOLIST_PARENT_CATEGORY; ?></td>
<td><?php echo $this->category_box('cat',$categories,$cat); ?></td>
</tr>
<div class="form_field">
<label for="serendipity_addcategory_title"><?php echo PLUGIN_EVENT_TODOLIST_CAT_NAME; ?></label>
<input id="serendipity_addcategory_title" type="text" name="serendipity[add_category][title]" size="30">
</div>
<tr>
<td><?php echo PLUGIN_EVENT_TODOLIST_COLOR; ?></td>
<td><select name="serendipity[add_category][colorid]"><?php echo $colortext?></select></td>
</tr>
</table>
<div><?php echo $button; ?></div>
<div class="form_select">
<label for="serendipity_project_to_recat"><?php echo PLUGIN_EVENT_TODOLIST_PARENT_CATEGORY; ?></label>
<?php echo $this->category_box('cat',$categories,$cat); ?>
</div>
<div class="form_select">
<label for="serendipity_addcategory_colorid"><?php echo PLUGIN_EVENT_TODOLIST_COLOR; ?></label>
<select id="serendipity_addcategory_colorid" name="serendipity[add_category][colorid]"><?php echo $colortext?></select>
</div>
<div class="form_buttons">
<?php echo $button; ?>
</div>
</form>
<?php
echo '<h3>'.PLUGIN_EVENT_TODOLIST_ADMINCAT.'</h3>';
?>
<form action="?serendipity[adminModule]=event_display&amp;serendipity[adminAction]=percentagedone&amp;serendipity[manage_category]=1" method="post">
<table border="0" cellpadding="1" cellspacing="0" width="100%">
<tr>
<td></td>
<td><strong><?php echo CATEGORY; ?></strong></td>
<td><strong><?php echo PLUGIN_EVENT_TODOLIST_COLOR; ?></strong></td>
</tr>
<div class="serendipity_todolist_wrap">
<table>
<thead>
<tr>
<th>&nbsp;</th>
<th><?php echo CATEGORY; ?></th>
<th><span id="todolist_category_label"><?php echo PLUGIN_EVENT_TODOLIST_COLOR; ?></span></th>
</tr>
</thead>
<tbody>
<?php
$q = "SELECT *
FROM {$serendipity['dbPrefix']}project_category
@ -1879,28 +1893,23 @@ class serendipity_event_todolist extends serendipity_event {
}
}
?>
<tr>
<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;" alt=""> <?php echo (function_exists('serendipity_specialchars') ? serendipity_specialchars($category['category_name']) : htmlspecialchars($category['category_name'], ENT_COMPAT, LANG_CHARSET)) ?></td>
<td>
<select name="serendipity[category_to_recolor][<?php echo $category['categoryid']?>]"><?php echo $colortext?></select>
</td>
</tr>
<tr>
<td class="form_check"><input type="checkbox" name="serendipity[category_to_remove][]" value="<?php echo $category['categoryid']; ?>"></td>
<td class="category_level_<?php echo $category['depth'] ?>"><?php echo (function_exists('serendipity_specialchars') ? serendipity_specialchars($category['category_name']) : htmlspecialchars($category['category_name'], ENT_COMPAT, LANG_CHARSET)) ?></td>
<td class="form_select"><select aria-labelledby="todolist_category_label" name="serendipity[category_to_recolor][<?php echo $category['categoryid']?>]"><?php echo $colortext?></select></td>
</tr>
<?php
}
?>
</table>
<div>
</tbody>
</table>
</div>
<div class="form_buttons">
<?php
echo '<input type="submit" name="SAVE" title="'.SAVE.'" value="'.SAVE.'" class="serendipityPrettyButton input_button" />';
echo '&nbsp;';
echo '<input type="submit" name="REMOVE" title="'.REMOVE.'" value="'.DELETE.'" class="serendipityPrettyButton input_button" />';
echo ' <input type="submit" name="SAVE" title="'.SAVE.'" value="'.SAVE.'">';
echo ' <input class="state_cancel" type="submit" name="REMOVE" title="'.REMOVE.'" value="'.DELETE.'">';
?>
</div>
</div>
</form>
<?php
}
@ -1935,7 +1944,7 @@ class serendipity_event_todolist extends serendipity_event {
s.order_num AS order_num
FROM '.$serendipity['dbPrefix'].'percentagedone AS s
ORDER BY s.order_num ASC';
$this->tdoutput = '<td colspan="2">&nbsp;</td>';
$this->tdoutput = '<th colspan="2">&nbsp;</th>';
break;
case 'dateacs':

View file

@ -0,0 +1,60 @@
.serendipity_todolist_wrap {
min-height: .01%;
-ms-overflow-style: -ms-autohiding-scrollbar;
overflow-x: auto;
overflow-y: hidden;
}
.serendipity_todolist_wrap table {
border: 1px solid #aaa;
border-bottom: 0;
margin-top: 0;
width: 100%;
}
.serendipity_todolist_wrap tr {
border-bottom: 1px solid #aaa;
}
.serendipity_todolist_wrap th,
.serendipity_todolist_wrap td {
padding: .25em;
white-space: nowrap;
}
.serendipity_todolist_wrap thead tr,
.serendipity_todolist_wrap tbody tr:nth-child(even) {
background-color: #eee;
}
.serendipity_todolist_wrap input[type='text'],
.serendipity_todolist_wrap select {
width: 100%;
}
.serendipity_todolist_form label {
display: block;
}
.serendipity_todolist_form input[type='text'],
.serendipity_todolist_form select {
max-width: 20em;
min-width: 15em;
}
@media screen and (min-width: 768px) {
.serendipity_todolist_wrap {
overflow-y: auto;
}
.serendipity_todolist_wrap th,
.serendipity_todolist_wrap td {
white-space: normal;
}
.serendipity_todolist_form input[type='text'],
.serendipity_todolist_form select {
max-width: 30em;
min-width: 20em;
}
}