Files
@ c7d7e38b2269
Branch filter:
Location: hot67beta/administrator/components/com_newsfeeds/admin.newsfeeds.html.php
c7d7e38b2269
10.6 KiB
text/x-php
Initial import of the site.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 | <?php
/**
* @version $Id: admin.newsfeeds.html.php 11371 2008-12-30 01:31:50Z ian $
* @package Joomla
* @subpackage Newsfeeds
* @copyright Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved.
* @license GNU/GPL, see LICENSE.php
* Joomla! is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* See COPYRIGHT.php for copyright notices and details.
*/
// no direct access
defined( '_JEXEC' ) or die( 'Restricted access' );
/**
* @package Joomla
* @subpackage Newsfeeds
*/
class HTML_newsfeeds
{
function showNewsFeeds( &$rows, &$lists, &$pageNav, $option )
{
global $mainframe;
$user =& JFactory::getUser();
//Ordering allowed ?
$ordering = ($lists['order'] == 'a.ordering');
JHTML::_('behavior.tooltip');
?>
<form action="index.php?option=com_newsfeeds" method="post" name="adminForm">
<table>
<tr>
<td align="left" width="100%">
<?php echo JText::_( 'Filter' ); ?>:
<input type="text" name="search" id="search" value="<?php echo $lists['search'];?>" class="text_area" onchange="document.adminForm.submit();" />
<button onclick="this.form.submit();"><?php echo JText::_( 'Go' ); ?></button>
<button onclick="document.getElementById('search').value='';this.form.getElementById('filter_catid').value='0';this.form.getElementById('filter_state').value='';this.form.submit();"><?php echo JText::_( 'Reset' ); ?></button>
</td>
<td nowrap="nowrap">
<?php
echo $lists['catid'];
echo $lists['state'];
?>
</td>
</tr>
</table>
<table class="adminlist">
<thead>
<tr>
<th width="10">
<?php echo JText::_( 'NUM' ); ?>
</th>
<th width="10">
<input type="checkbox" name="toggle" value="" onclick="checkAll(<?php echo count( $rows ); ?>);" />
</th>
<th class="title">
<?php echo JHTML::_('grid.sort', 'News Feed', 'a.name', @$lists['order_Dir'], @$lists['order'] ); ?>
</th>
<th width="5%">
<?php echo JHTML::_('grid.sort', 'Published', 'a.published', @$lists['order_Dir'], @$lists['order'] ); ?>
</th>
<th width="8%" nowrap="nowrap">
<?php echo JHTML::_('grid.sort', 'Order', 'a.ordering', @$lists['order_Dir'], @$lists['order'] ); ?>
<?php echo JHTML::_('grid.order', $rows ); ?>
</th>
<th class="title" width="10%">
<?php echo JHTML::_('grid.sort', 'Category', 'catname', @$lists['order_Dir'], @$lists['order'] ); ?>
</th>
<th width="5%" nowrap="nowrap">
<?php echo JHTML::_('grid.sort', 'Num Articles', 'a.numarticles', @$lists['order_Dir'], @$lists['order'] ); ?>
</th>
<th width="5%">
<?php echo JHTML::_('grid.sort', 'Cache time', 'a.cache_time', @$lists['order_Dir'], @$lists['order'] ); ?>
</th>
<th width="1%" nowrap="nowrap">
<?php echo JHTML::_('grid.sort', 'ID', 'a.id', @$lists['order_Dir'], @$lists['order'] ); ?>
</th>
</tr>
</thead>
<tfoot>
<tr>
<td colspan="10">
<?php echo $pageNav->getListFooter(); ?>
</td>
</tr>
</tfoot>
<tbody>
<?php
$k = 0;
for ($i=0, $n=count( $rows ); $i < $n; $i++) {
$row = &$rows[$i];
$link = JRoute::_( 'index.php?option=com_newsfeeds&task=edit&cid[]='. $row->id );
$checked = JHTML::_('grid.checkedout', $row, $i );
$published = JHTML::_('grid.published', $row, $i );
$row->cat_link = JRoute::_( 'index.php?option=com_categories§ion=com_newsfeeds&task=edit&cid[]='. $row->catid );
?>
<tr class="<?php echo 'row'. $k; ?>">
<td align="center">
<?php echo $pageNav->getRowOffset( $i ); ?>
</td>
<td>
<?php echo $checked; ?>
</td>
<td>
<?php
if ( JTable::isCheckedOut($user->get ('id'), $row->checked_out ) ) {
echo $row->name;
} else {
?>
<span class="editlinktip hasTip" title="<?php echo JText::_( 'Edit Newsfeed' );?>::<?php echo $row->name; ?>">
<a href="<?php echo $link; ?>">
<?php echo $row->name; ?></a></span>
<?php
}
?>
</td>
<td align="center">
<?php echo $published;?>
</td>
<td class="order">
<span><?php echo $pageNav->orderUpIcon($i, ($row->catid == @$rows[$i-1]->catid), 'orderup', 'Move Up', $ordering ); ?></span>
<span><?php echo $pageNav->orderDownIcon($i, $n, ($row->catid == @$rows[$i+1]->catid), 'orderdown', 'Move Down', $ordering ); ?></span>
<?php $disabled = $ordering ? '' : 'disabled="disabled"'; ?>
<input type="text" name="order[]" size="5" value="<?php echo $row->ordering;?>" <?php echo $disabled ?> class="text_area" style="text-align: center" />
</td>
<td>
<a href="<?php echo $row->cat_link; ?>" title="<?php echo JText::_( 'Edit Category' ); ?>">
<?php echo $row->catname;?></a>
</td>
<td align="center">
<?php echo $row->numarticles;?>
</td>
<td align="center">
<?php echo $row->cache_time;?>
</td>
<td align="center">
<?php echo $row->id; ?>
</td>
</tr>
<?php
$k = 1 - $k;
}
?>
</tbody>
</table>
<table class="adminform">
<tr>
<td>
<table align="center">
<?php
$visible = 0;
// check to hide certain paths if not super admin
if ( $user->get('gid') == 25 ) {
$visible = 1;
}
HTML_newsfeeds::writableCell( JPATH_SITE.DS.'cache', 0, '<strong>'. JText::_('Cache Directory') .'</strong> ', $visible );
?>
</table>
</td>
</tr>
</table>
<input type="hidden" name="option" value="<?php echo $option;?>" />
<input type="hidden" name="task" value="" />
<input type="hidden" name="boxchecked" value="0" />
<input type="hidden" name="filter_order" value="<?php echo $lists['order']; ?>" />
<input type="hidden" name="filter_order_Dir" value="<?php echo $lists['order_Dir']; ?>" />
<?php echo JHTML::_( 'form.token' ); ?>
</form>
<?php
}
function editNewsFeed( &$row, &$lists, $option )
{
JRequest::setVar( 'hidemainmenu', 1 );
JFilterOutput::objectHTMLSafe( $row, ENT_QUOTES );
?>
<script language="javascript" type="text/javascript">
function submitbutton(pressbutton) {
var form = document.adminForm;
if (pressbutton == 'cancel') {
submitform( pressbutton );
return;
}
// do field validation
if (form.name.value == '') {
alert( "<?php echo JText::_( 'Please fill in the newsfeed name.', true ); ?>" );
} else if (form.catid.value == 0) {
alert( "<?php echo JText::_( 'Please select a Category.', true ); ?>" );
} else if (form.link.value == '') {
alert( "<?php echo JText::_( 'Please fill in the newsfeed link.', true ); ?>" );
} else if (getSelectedValue('adminForm','catid') < 0) {
alert( "<?php echo JText::_( 'Please select a category.', true ); ?>" );
} else if (form.numarticles.value == "" || form.numarticles.value == 0) {
alert( "<?php echo JText::_( 'VALIDARTICLESDISPLAY', true ); ?>" );
} else if (form.cache_time.value == "" || form.cache_time.value == 0) {
alert( "<?php echo JText::_( 'Please fill in the cache refresh time.', true ); ?>" );
} else {
submitform( pressbutton );
}
}
</script>
<form action="index.php" method="post" name="adminForm">
<div class="col100">
<fieldset class="adminform">
<legend><?php echo JText::_( 'Details' ); ?></legend>
<table class="admintable">
<tr>
<td width="170" class="key">
<label for="name">
<?php echo JText::_( 'Name' ); ?>
</label>
</td>
<td>
<input class="inputbox" type="text" size="40" name="name" id="name" value="<?php echo $row->name; ?>" />
</td>
</tr>
<tr>
<td width="170" class="key">
<label for="name">
<?php echo JText::_( 'Alias' ); ?>
</label>
</td>
<td>
<input class="inputbox" type="text" size="40" name="alias" id="alias" value="<?php echo $row->alias; ?>" />
</td>
</tr>
<tr>
<td valign="top" align="right" class="key">
<?php echo JText::_( 'Published' ); ?>:
</td>
<td>
<?php echo $lists['published']; ?>
</td>
</tr>
<tr>
<td class="key">
<label for="catid">
<?php echo JText::_( 'Category' ); ?>
</label>
</td>
<td>
<?php echo $lists['category']; ?>
</td>
</tr>
<tr>
<td class="key">
<label for="link">
<?php echo JText::_( 'Link' ); ?>
</label>
</td>
<td>
<input class="inputbox" type="text" size="60" name="link" id="link" value="<?php echo $row->link; ?>" />
</td>
</tr>
<tr>
<td class="key">
<label for="numarticles">
<?php echo JText::_( 'Number of Articles' ); ?>
</label>
</td>
<td>
<input class="inputbox" type="text" size="2" name="numarticles" id="numarticles" value="<?php echo $row->numarticles; ?>" />
</td>
</tr>
<tr>
<td class="key">
<span class="editlinktip hasTip" title="<?php echo JText::_( 'TIPCACHETIME' ); ?>">
<?php echo JText::_( 'Cache time' ); ?>
</span>
</td>
<td>
<input class="inputbox" type="text" size="4" name="cache_time" id="cache_time" value="<?php echo $row->cache_time; ?>" />
</td>
</tr>
<tr>
<td class="key">
<label for="ordering">
<?php echo JText::_( 'Ordering' ); ?>
</label>
</td>
<td>
<?php echo $lists['ordering']; ?>
</td>
</tr>
<tr>
<td class="key">
<label for="rtl">
<?php echo JText::_( 'RTL feed' ); ?>
</label>
</td>
<td>
<?php echo $lists['rtl']; ?>
</td>
</tr>
<tr>
<td colspan="2" align="center">
</td>
</tr>
</table>
</fieldset>
</div>
<div class="clr"></div>
<input type="hidden" name="id" value="<?php echo $row->id; ?>" />
<input type="hidden" name="cid[]" value="<?php echo $row->id; ?>" />
<input type="hidden" name="option" value="<?php echo $option; ?>" />
<input type="hidden" name="task" value="" />
<?php echo JHTML::_( 'form.token' ); ?>
</form>
<?php
}
function writableCell( $folder, $relative=1, $text='', $visible=1 )
{
$writeable = '<b><font color="green">'. JText::_( 'Writable' ) .'</font></b>';
$unwriteable = '<b><font color="red">'. JText::_( 'Unwritable' ) .'</font></b>';
echo '<tr>';
echo '<td class="item">';
echo $text;
if ( $visible ) {
echo $folder . '/';
}
echo '</td>';
echo '<td >';
if ( $relative ) {
echo is_writable( "../$folder" ) ? $writeable : $unwriteable;
} else {
echo is_writable( "$folder" ) ? $writeable : $unwriteable;
}
echo '</td>';
echo '</tr>';
}
}
|