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