[pLog-svn] r866 - in plugins/trunk: contentfilter/templates
hostblock hostblock/class hostblock/class/action
hostblock/class/view hostblock/templates
mark at devel.plogworld.net
mark at devel.plogworld.net
Thu Jan 27 17:04:09 GMT 2005
Author: mark
Date: 2005-01-27 17:04:08 +0000 (Thu, 27 Jan 2005)
New Revision: 866
Added:
plugins/trunk/hostblock/class/view/
plugins/trunk/hostblock/class/view/adminblockedhostsview.class.php
plugins/trunk/hostblock/class/view/adminnewblockedhostview.class.php
Modified:
plugins/trunk/contentfilter/templates/filteredcontent.template
plugins/trunk/hostblock/class/action/adminblockedhostsaction.class.php
plugins/trunk/hostblock/class/action/adminnewblockedhostaction.class.php
plugins/trunk/hostblock/pluginhostblock.class.php
plugins/trunk/hostblock/templates/addblockedhost.template
plugins/trunk/hostblock/templates/blockedhosts.template
Log:
Modified: plugins/trunk/contentfilter/templates/filteredcontent.template
===================================================================
--- plugins/trunk/contentfilter/templates/filteredcontent.template 2005-01-27 16:42:40 UTC (rev 865)
+++ plugins/trunk/contentfilter/templates/filteredcontent.template 2005-01-27 17:04:08 UTC (rev 866)
@@ -14,7 +14,7 @@
<th style="width:95px;">{$locale->tr("actions")}</th>
</tr>
{foreach from=$filteredcontent item=content}
- <tr>
+ <tr>
<td align="center"><input class="checkbox" type="checkbox" name="deleteFilteredContent[{$content->getId()}]" value="{$content->getId()}"/></td>
<td class="col_highlighted"><a href="admin.php?op=editFilteredContent&contentId={$content->getId()}">{$content->getRegExp(true)}</a></td>
<td>{$content->getReason()}</td>
@@ -26,7 +26,7 @@
<a href="?op=editFilteredContent&contentId={$content->getId()}"><img src="imgs/icon_edit-16.png" alt="{$locale->tr("edit")}" /></a>
<a href="?op=deleteFilteredContent&contentId={$content->getId()}"><img src="imgs/icon_delete-16.png" alt="{$locale->tr("delete")}" /></a>
</div>
- </td>
+ </td>
</tr>
{/foreach}
</table>
Modified: plugins/trunk/hostblock/class/action/adminblockedhostsaction.class.php
===================================================================
--- plugins/trunk/hostblock/class/action/adminblockedhostsaction.class.php 2005-01-27 16:42:40 UTC (rev 865)
+++ plugins/trunk/hostblock/class/action/adminblockedhostsaction.class.php 2005-01-27 17:04:08 UTC (rev 866)
@@ -1,8 +1,7 @@
<?php
include_once( PLOG_CLASS_PATH."class/action/admin/siteadminaction.class.php" );
- include_once( PLOG_CLASS_PATH."class/view/admin/adminplugintemplatedview.class.php" );
- include_once( PLOG_CLASS_PATH."plugins/hostblock/class/dao/blockedhosts.class.php" );
+ include_once( PLOG_CLASS_PATH."plugins/hostblock/class/view/adminblockedhostsview.class.php" );
/**
* Shows the list of hosts that have been globally blocked
@@ -20,15 +19,8 @@
*/
function perform()
{
- // get the content that has been filtered by this blog
- $blockedHosts = new BlockedHosts();
- $hostsBlockedFromPosting = $blockedHosts->getBlogBlacklist( GLOBALLY_BLOCKED_HOST, BLOCK_COMMENT_POSTING );
- $hostsBlocked = $blockedHosts->getBlogBlacklist( GLOBALLY_BLOCKED_HOST, BLOCK_ACCESS );
+ $this->_view = new AdminBlockedHostsView( $this->_blogInfo );
- $blogBlockedHosts = array_merge( $hostsBlockedFromPosting, $hostsBlocked );
-
- $this->_view = new AdminPluginTemplatedView( $this->_blogInfo, "hostblock", "blockedhosts" );
- $this->_view->setValue( "blockedhosts", $blogBlockedHosts );
$this->setCommonData();
// better to return true if everything fine
Modified: plugins/trunk/hostblock/class/action/adminnewblockedhostaction.class.php
===================================================================
--- plugins/trunk/hostblock/class/action/adminnewblockedhostaction.class.php 2005-01-27 16:42:40 UTC (rev 865)
+++ plugins/trunk/hostblock/class/action/adminnewblockedhostaction.class.php 2005-01-27 17:04:08 UTC (rev 866)
@@ -1,7 +1,7 @@
<?php
include_once( PLOG_CLASS_PATH."class/action/admin/siteadminaction.class.php" );
- include_once( PLOG_CLASS_PATH."class/view/admin/adminplugintemplatedview.class.php" );
+ include_once( PLOG_CLASS_PATH."plugins/hostblock/class/view/adminnewblockedhostview.class.php" );
/**
* Shows a form to add a new globally blocked host
@@ -15,7 +15,8 @@
function perform()
{
- $this->_view = new AdminPluginTemplatedView( $this->_blogInfo, "hostblock", "addblockedhost" );
+ $this->_view = new AdminNewBlockedHostView( $this->_blogInfo );
+
$this->setCommonData();
return true;
Added: plugins/trunk/hostblock/class/view/adminblockedhostsview.class.php
===================================================================
--- plugins/trunk/hostblock/class/view/adminblockedhostsview.class.php 2005-01-27 16:42:40 UTC (rev 865)
+++ plugins/trunk/hostblock/class/view/adminblockedhostsview.class.php 2005-01-27 17:04:08 UTC (rev 866)
@@ -0,0 +1,30 @@
+<?php
+
+ include_once( PLOG_CLASS_PATH."class/view/admin/adminplugintemplatedview.class.php" );
+ include_once( PLOG_CLASS_PATH."plugins/hostblock/class/dao/blockedhosts.class.php" );
+ /**
+ * implements the main view of the feed reader plugin
+ */
+ class AdminBlockedHostsView extends AdminPluginTemplatedView
+ {
+
+ function AdminBlockedHostsView( $blogInfo )
+ {
+ $this->AdminPluginTemplatedView( $blogInfo, "hostblock", "blockedhosts" );
+ }
+
+ function render()
+ {
+ // get the content that has been filtered by this blog
+ $blockedHosts = new BlockedHosts();
+ $hostsBlockedFromPosting = $blockedHosts->getBlogBlacklist( GLOBALLY_BLOCKED_HOST, BLOCK_COMMENT_POSTING );
+ $hostsBlocked = $blockedHosts->getBlogBlacklist( GLOBALLY_BLOCKED_HOST, BLOCK_ACCESS );
+
+ $blogBlockedHosts = array_merge( $hostsBlockedFromPosting, $hostsBlocked );
+
+ $this->setValue( "blockedhosts", $blogBlockedHosts );
+
+ parent::render();
+ }
+ }
+?>
\ No newline at end of file
Added: plugins/trunk/hostblock/class/view/adminnewblockedhostview.class.php
===================================================================
--- plugins/trunk/hostblock/class/view/adminnewblockedhostview.class.php 2005-01-27 16:42:40 UTC (rev 865)
+++ plugins/trunk/hostblock/class/view/adminnewblockedhostview.class.php 2005-01-27 17:04:08 UTC (rev 866)
@@ -0,0 +1,22 @@
+<?php
+
+ include_once( PLOG_CLASS_PATH."class/view/admin/adminplugintemplatedview.class.php" );
+
+ /**
+ * implements the main view of the feed reader plugin
+ */
+ class AdminNewBlockedHostView extends AdminPluginTemplatedView
+ {
+
+ function AdminNewBlockedHostView( $blogInfo )
+ {
+ $this->AdminPluginTemplatedView( $blogInfo, "hostblock", "addblockedhost" );
+ }
+
+ function render()
+ {
+ // get the content that has been filtered by this blog
+ parent::render();
+ }
+ }
+?>
\ No newline at end of file
Modified: plugins/trunk/hostblock/pluginhostblock.class.php
===================================================================
--- plugins/trunk/hostblock/pluginhostblock.class.php 2005-01-27 16:42:40 UTC (rev 865)
+++ plugins/trunk/hostblock/pluginhostblock.class.php 2005-01-27 17:04:08 UTC (rev 866)
@@ -1,21 +1,7 @@
<?php
include_once( PLOG_CLASS_PATH."class/plugin/pluginbase.class.php" );
-
include_once( PLOG_CLASS_PATH."plugins/hostblock/class/security/hostsblacklist.class.php" );
- /*include_once( PLOG_CLASS_PATH."plugins/hostblock/class/action/adminaddblockedhostaction.class.php" );
- include_once( PLOG_CLASS_PATH."plugins/hostblock/class/action/adminaddblogblockedhostaction.class.php" );
- include_once( PLOG_CLASS_PATH."plugins/hostblock/class/action/adminblogblockhostfrompostingaction.class.php" );
- include_once( PLOG_CLASS_PATH."plugins/hostblock/class/action/adminblockedhostsaction.class.php" );
- include_once( PLOG_CLASS_PATH."plugins/hostblock/class/action/adminblogblockedhostsaction.class.php" );
- include_once( PLOG_CLASS_PATH."plugins/hostblock/class/action/admindeleteblockedhostaction.class.php" );
- include_once( PLOG_CLASS_PATH."plugins/hostblock/class/action/admindeleteblogblockedhostaction.class.php" );
- include_once( PLOG_CLASS_PATH."plugins/hostblock/class/action/admineditblockedhostaction.class.php" );
- include_once( PLOG_CLASS_PATH."plugins/hostblock/class/action/admineditblogblockedhostaction.class.php" );
- include_once( PLOG_CLASS_PATH."plugins/hostblock/class/action/adminnewblockedhostaction.class.php" );
- include_once( PLOG_CLASS_PATH."plugins/hostblock/class/action/adminnewblogblockedhostaction.class.php" );
- include_once( PLOG_CLASS_PATH."plugins/hostblock/class/action/adminupdateblockedhostaction.class.php" );
- include_once( PLOG_CLASS_PATH."plugins/hostblock/class/action/adminupdateblogblockedhostaction.class.php" );*/
/**
* events that this plugin generates
@@ -54,20 +40,22 @@
// register the superadmin actions
$this->registerAdminAction( "blockedHosts", "AdminBlockedHostsAction" );
$this->registerAdminAction( "newBlockedHost", "AdminNewBlockedHostAction" );
- $this->registerAdminAction( "deleteBlockedHost", "AdminDeleteBlockedHostAction" );
$this->registerAdminAction( "addBlockedHost", "AdminAddBlockedHostAction" );
$this->registerAdminAction( "editBlockedHost", "AdminEditBlockedHostAction" );
$this->registerAdminAction( "updateBlockedHost", "AdminUpdateBlockedHostAction" );
+ $this->registerAdminAction( "deleteBlockedHost", "AdminDeleteBlockedHostAction" );
+ $this->registerAdminAction( "deleteBlockedHosts", "AdminDeleteBlockedHostAction" );
// register the filter
$this->registerFilter( "HostsBlackList" );
// register the blog owner actions
$this->registerAdminAction( "blogBlockHostFromPosting", "AdminBlogBlockHostFromPostingAction" );
$this->registerAdminAction( "blogBlockedHosts", "AdminBlogBlockedHostsAction" );
$this->registerAdminAction( "newBlogBlockedHost", "AdminNewBlogBlockedHostAction" );
- $this->registerAdminAction( "blogDeleteBlockedHost", "AdminDeleteBlogBlockedHostAction" );
$this->registerAdminAction( "addBlogBlockedHost", "AdminAddBlogBlockedHostAction" );
$this->registerAdminAction( "editBlogBlockedHost", "AdminEditBlogBlockedHostAction" );
$this->registerAdminAction( "updateBlogBlockedHost", "AdminUpdateBlogBlockedHostAction" );
+ $this->registerAdminAction( "deleteBlogBlockedHost", "AdminDeleteBlogBlockedHostAction" );
+ $this->registerAdminAction( "deleteBlogBlockedHosts", "AdminDeleteBlogBlockedHostAction" );
// register the menu entries, but the first one is only registered if it hasn't been
// created yet
Modified: plugins/trunk/hostblock/templates/addblockedhost.template
===================================================================
--- plugins/trunk/hostblock/templates/addblockedhost.template 2005-01-27 16:42:40 UTC (rev 865)
+++ plugins/trunk/hostblock/templates/addblockedhost.template 2005-01-27 17:04:08 UTC (rev 866)
@@ -1,48 +1,52 @@
{include file="$admintemplatepath/header.template"}
{include file="$admintemplatepath/navigation.template" showOpt=newBlockedHost title=$locale->tr("newBlockedHost")}
{include file="common.template"}
-<p>
-{$locale->tr("global_block_host_intro")}
-</p>
<form name="newBlockedHost" action="admin.php" method="post" onSubmit="return checkIpAddress(this);">
- <table width="100%">
- <tr>
- <td class="alignright" width="15%">{$locale->tr("ip_address")}: </td>
- <td>
- <input type="text" size="3" maxlength="3" name="ip1" />.
- <input type="text" size="3" maxlength="3" name="ip2" />.
- <input type="text" size="3" maxlength="3" name="ip3" />.
- <input type="text" size="3" maxlength="3" name="ip4" />
- / <select name="mask">
+ <fieldset class="inputField">
+ <legend>{$locale->tr("addFilteredContent")}</legend>
+ {include file="$admintemplatepath/successmessage.template"}
+ {include file="$admintemplatepath/errormessage.template"}
+ <div class="field">
+ <label for="blockedHost">{$locale->tr("ip_address")}</label>
+ <span class="required">*</span>
+ <div class="formHelp">{$locale->tr("host_to_block_help")}</div>
+ <input style="width:40px;" type="text" size="3" maxlength="3" name="ip1" id="ip1" />.
+ <input style="width:40px;" type="text" size="3" maxlength="3" name="ip2" id="ip1" />.
+ <input style="width:40px;" type="text" size="3" maxlength="3" name="ip3" id="ip1" />.
+ <input style="width:40px;" type="text" size="3" maxlength="3" name="ip4" id="ip1" />
+ / <select name="mask" id="mask" >
<option value="8">8 {$locale->tr("bits")}</option>
<option value="16">16 {$locale->tr("bits")}</option>
<option value="24">24 {$locale->tr("bits")}</option>
<option value="32" selected="selected">32 {$locale->tr("bits")}</option>
</select>
- </td>
- </tr>
- <tr>
- <td class="alignright">{$locale->tr("block_type")}:</td>
- <td>
- <select name="blockType">
+ </div>
+
+ <div class="field">
+ <label for="blockType">{$locale->tr("block_type")}</label>
+ <span class="required"></span>
+ <div class="formHelp">{$locale->tr("block_type_help")}</div>
+ <select name="blockType" id="blockType">
<option value="1">{$locale->tr("access_blocked")}</option>
<option value="2">{$locale->tr("posting_blocked")}</option>
</select>
- </td>
- </tr>
- <tr>
- <td class="alignright">{$locale->tr("reason")}: </td>
- <td><input type="text" style="width:100%" name="reason" value=""/></td>
- </tr>
- <tr>
- <td> </td>
- <td>
- <input type="hidden" name="op" value="addBlockedHost" />
- <input type="submit" name="Add" value="{$locale->tr("block_this")}"/>
- </td>
- </tr>
- </table>
+ </div>
+
+ <div class="field">
+ <label for="reason">{$locale->tr("reason")}</label>
+ <span class="required"></span>
+ <div class="formHelp">{$locale->tr("reason_help")}</div>
+ <input type="text" name="reason" id="reason" value=""/>
+ </div>
+
+ </fieldset>
+
+ <div class="buttons">
+ <input type="hidden" name="op" value="addBlockedHost" />
+ <input type="reset" value="{$locale->tr("reset")}" name="reset"/>
+ <input type="submit" name="Add" value="{$locale->tr("add")}"/>
+ </div>
+
</form>
-</div>
{include file="$admintemplatepath/footernavigation.template"}
{include file="$admintemplatepath/footer.template"}
\ No newline at end of file
Modified: plugins/trunk/hostblock/templates/blockedhosts.template
===================================================================
--- plugins/trunk/hostblock/templates/blockedhosts.template 2005-01-27 16:42:40 UTC (rev 865)
+++ plugins/trunk/hostblock/templates/blockedhosts.template 2005-01-27 17:04:08 UTC (rev 866)
@@ -1,31 +1,44 @@
{include file="$admintemplatepath/header.template"}
{include file="$admintemplatepath/navigation.template" showOpt=blockedHosts title=$locale->tr("blockedHosts")}
<form name="blockedHosts" action="admin.php" method="post">
-<table width="100%" border="1">
- <tr>
- <th width="40%">{$locale->tr("ip_address")}/{$locale->tr("mask")}</th>
- <th>{$locale->tr("reason")}</th>
- <th>{$locale->tr("date")}</th>
- <th>{$locale->tr("type")}</th>
- <th>{$locale->tr("delete")}</th>
- </tr>
-{foreach from=$blockedhosts item=blockedhost}
- <tr>
- <td valign="top"><a href="admin.php?op=editBlockedHost&hostId={$blockedhost->getId()}">{$blockedhost->getHost()}/{$blockedhost->getMask()}</a></td>
- <td valign="top">{$blockedhost->getReason()}</td>
- {assign var=blockedhostDate value=$blockedhost->getDateObject()}
- <td valign="top">{$locale->formatDate($blockedhostDate,"%d/%m/%Y %H:%M")}</td>
- <td valign="top">
- {if $blockedhost->getType() == 1}{$locale->tr("access_blocked")}{/if}
- {if $blockedhost->getType() == 2}{$locale->tr("posting_blocked")}{/if}
- {** {if $blockedhost->isGlobal()} <b>(GLOBAL)</b>{/if} **}
- </td>
- <td valign="top" align="center"><input type="checkbox" name="deleteBlockedHost[{$blockedhost->getId()}]" value="{$blockedhost->getId()}"/></td>
- </tr>
-{/foreach}
-</table>
-<input type="hidden" name="op" value="deleteBlockedHost" />
-<input type="submit" value="{$locale->tr("delete_selected")}" name="deleteSelected" />
+ <div id="list">
+ {include file="$admintemplatepath/successmessage.template"}
+ {include file="$admintemplatepath/errormessage.template"}
+ <table class="info">
+ <tr>
+ <th style="width:10px;"><input class="checkbox" type="checkbox" class="check" name="all" id="all" value="1" onclick="toggleAllChecks('blockedHosts');" /></th>
+ <th style="width:150px;">{$locale->tr("ip_address")}</th>
+ <th style="width:200px;">{$locale->tr("reason")}</th>
+ <th style="width:150px;">{$locale->tr("date")}</th>
+ <th style="width:150px;">{$locale->tr("type")}</th>
+ <th style="width:95px;">{$locale->tr("actions")}</th>
+ </tr>
+ {foreach from=$blockedhosts item=blockedhost}
+ <tr>
+ <td align="center"><input class="checkbox" type="checkbox" name="deleteBlockedHost[{$blockedhost->getId()}]" value="{$blockedhost->getId()}"/></td>
+ <td class="col_highlighted"><a href="admin.php?op=editBlockedHost&hostId={$blockedhost->getId()}">{$blockedhost->getHost()}/{$blockedhost->getMask()}</a></td>
+ <td>{$blockedhost->getReason()}</td>
+ {assign var=blockedhostDate value=$blockedhost->getDateObject()}
+ <td>{$locale->formatDate($blockedhostDate,"%d/%m/%Y %H:%M")}</td>
+ <td>
+ {if $blockedhost->getType() == 1}{$locale->tr("access_blocked")}{/if}
+ {if $blockedhost->getType() == 2}{$locale->tr("posting_blocked")}{/if}
+ {if $blockedhost->isGlobal()} (<b>{$locale->tr("global")}</b>){/if}
+ </td>
+ <td>
+ <div class="list_action_button">
+ <a href="?op=editBlockedHost&hostId={$blockedhost->getId()}"><img src="imgs/icon_edit-16.png" alt="{$locale->tr("edit")}" /></a>
+ <a href="?op=deleteBlockedHost&hostId={$blockedhost->getId()}"><img src="imgs/icon_delete-16.png" alt="{$locale->tr("delete")}" /></a>
+ </div>
+ </td>
+ </tr>
+ {/foreach}
+ </table>
+ <div id="list_action_bar">
+ <input type="hidden" name="op" value="deleteBlockedHosts" />
+ <input type="submit" value="{$locale->tr("delete")}" name="deleteSelected" />
+ </div>
+ </div>
</form>
{include file="$admintemplatepath/footernavigation.template"}
{include file="$admintemplatepath/footer.template"}
\ No newline at end of file
More information about the pLog-svn
mailing list