PageRenderTime 75ms CodeModel.GetById 16ms RepoModel.GetById 0ms app.codeStats 1ms

/administrator/components/com_joomfish/admin.joomfish.html.php

https://bitbucket.org/dgough/annamaria-daneswood-25102012
PHP | 2289 lines | 1990 code | 127 blank | 172 comment | 170 complexity | 7e640c34ac6a01ed7899f76a5a2b757c MD5 | raw file
Possible License(s): GPL-2.0, LGPL-2.1

Large files files are truncated, but you can click here to view the full file

  1. <?php
  2. /**
  3. * Joom!Fish - Multi Lingual extention and translation manager for Joomla!
  4. * Copyright (C) 2003-2007 Think Network GmbH, Munich
  5. *
  6. * All rights reserved. The Joom!Fish project is a set of extentions for
  7. * the content management system Joomla!. It enables Joomla!
  8. * to manage multi lingual sites especially in all dynamic information
  9. * which are stored in the database.
  10. *
  11. * This program is free software; you can redistribute it and/or
  12. * modify it under the terms of the GNU General Public License
  13. * as published by the Free Software Foundation; either version 2
  14. * of the License, or (at your option) any later version.
  15. *
  16. * This program is distributed in the hope that it will be useful,
  17. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  18. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  19. * GNU General Public License for more details.
  20. *
  21. * You should have received a copy of the GNU General Public License
  22. * along with this program; if not, write to the Free Software
  23. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA.
  24. *
  25. * The "GNU General Public License" (GPL) is available at
  26. * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
  27. * -----------------------------------------------------------------------------
  28. * $Id: admin.joomfish.html.php 749 2007-11-11 01:02:32Z apostolov $
  29. *
  30. */
  31. defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );
  32. $adminPath = dirname( __FILE__);
  33. define('JFCPANEL_NEWS', 4);
  34. define('JFCPANEL_UNPUBLISHED', 2);
  35. define('JFCPANEL_STATE', 1);
  36. /**
  37. * Method to translate with a pre_reg function call
  38. *
  39. * @param array $matches
  40. * @return string
  41. */
  42. function jfTranslate($matches){
  43. $translation = JText::_($matches[1]);
  44. return $translation;
  45. }
  46. class HTML_joomfish {
  47. /**
  48. * Creates the CPanel for the Joom!Fish component
  49. * @param array status informations for the panel
  50. */
  51. function showCPanel( $panelStates, $contentInfo ) {
  52. global $act, $task, $option, $mosConfig_live_site, $mosConfig_absolute_path, $joomFishManager;
  53. HTML_joomfish::_header()
  54. ?>
  55. <tr>
  56. <td width="55%" valign="top">
  57. <div id="cpanel">
  58. <?php
  59. $link = 'index2.php?option=com_joomfish&amp;task=overview&amp;act=translate';
  60. HTML_joomfish::_quickiconButton( $link, 'addedit.png', JText::_('Translation') );
  61. $link = 'index2.php?option=com_joomfish&amp;task=overview&amp;act=orphans';
  62. HTML_joomfish::_quickiconButton( $link, 'query.png', JText::_('Orphans') );
  63. $link = 'index2.php?option=com_joomfish&amp;task=overview&amp;act=manage';
  64. HTML_joomfish::_quickiconButton( $link, 'menu.png', JText::_('Manage Translations') );
  65. $link = 'index2.php?option=com_joomfish&amp;task=show&amp;act=help';
  66. HTML_joomfish::_quickiconButton( $link, 'support.png', JText::_('HELP AND HOWTO') );
  67. echo '<div style="clear: both;" />';
  68. $link = 'index2.php?option=com_joomfish&amp;task=show&amp;act=config_component&amp;hidemainmenu=1';
  69. HTML_joomfish::_quickiconButton( $link, 'config.png', JText::_('Configuration') );
  70. $link = 'index2.php?option=com_joomfish&amp;task=show&amp;act=config_language&amp;hidemainmenu=1';
  71. HTML_joomfish::_quickiconButton( $link, 'langmanager.png', JText::_('Language Configuration') );
  72. $link = 'index2.php?option=com_joomfish&amp;task=show&amp;act=config_elements';
  73. HTML_joomfish::_quickiconButton( $link, 'cpanel.png', JText::_('Content elements') );
  74. $link = 'index2.php?option=com_joomfish&amp;task=show&amp;act=credits';
  75. HTML_joomfish::_quickiconButton( $link, 'credits.png', JText::_('About and Credits') );
  76. ?>
  77. </div>
  78. </td>
  79. <td width="45%" valign="top">
  80. <div style="width: 100%;">
  81. <?php
  82. // Prepare formating for the output of the state
  83. $stateRows = array();
  84. $alertState = false;
  85. $alertContent = false;
  86. foreach ($panelStates as $key => $state ) {
  87. if( ereg( '_state', $key ) ) {
  88. if( !$state ) {
  89. $alertState = true;
  90. }
  91. $stateHeader = substr($key, 0, strpos($key, '_'));
  92. $stateGroups[$stateHeader] = $panelStates[$stateHeader];
  93. } elseif ( ereg( 'mbf', $key )) {
  94. if( $state == 2 ) {
  95. $panelStates [ $key . '_href' ] = "";
  96. $panelStates[ $key . '_text' ] = JText::_('INSTAL_UPGRADED');
  97. } elseif($state == 1) {
  98. $panelStates[ $key . '_href' ] = "$mosConfig_live_site/administrator/index2.php?option=com_joomfish&amp;task=show&amp;act=upgrade_install&amp;hidemainmenu=1";
  99. $panelStates[ $key . '_text' ] = JText::_('INSTAL_NOT_UPGRADED');
  100. $alertState = true;
  101. }
  102. }
  103. }
  104. if( array_key_exists('unpublished', $contentInfo) && is_array($contentInfo['unpublished']) ) {
  105. $alertContent = true;
  106. }
  107. $publishedTabs = $joomFishManager->getCfg('showCPanels');
  108. // Tabs
  109. $tabs = new mosTabs(1);
  110. $tabs->startPane( 'modules-jfcpane' );
  111. $tabs->startTab( JText::_('Information'), 'jfinformation' );
  112. $sysInfo = $panelStates['system'];
  113. ?>
  114. <table class="adminlist" border="1">
  115. <tr><th><JText>JOOMFISH_TITLE</JText></th></tr>
  116. <tr><td><?php JText::printf('INFORMATION_TEXT', $sysInfo['translations']);?></tr>
  117. <tr><td><?php echo JText::_('INFORMATION_SHOP');?></td></tr>
  118. <tr><td><p><?php JText::printf ('INFORMATION_DONATE', intval($sysInfo['translations']) *0.10);?></p>
  119. <div align="center">
  120. <iframe src="<?php echo $mosConfig_live_site;?>/administrator/components/com_joomfish/donate.php?translations=<?php echo intval($sysInfo['translations']);?>" frameborder="0" style='border:0px;height:80px;width:180px;overflow:hidden;'></iframe>
  121. </div>
  122. </td></tr>
  123. </table>
  124. <?php
  125. $tabs->endTab();
  126. if( $publishedTabs & JFCPANEL_NEWS ) {
  127. $tabs->startTab( JText::_('News'), 'jfnews' );
  128. require_once($mosConfig_absolute_path . "/includes/domit/xml_domit_rss_lite.php");
  129. $cacheDir = $mosConfig_absolute_path . "/cache/";
  130. $LitePath = $mosConfig_absolute_path . "/includes/Cache/Lite.php";
  131. @$rss = &new xml_domit_rss_document_lite();
  132. $rss->useCacheLite(true, $LitePath, $cacheDir, 86400 );
  133. $rss->loadRSS('http://www.joomfish.net/rss-feed/extension-news/');
  134. ?>
  135. <table class="adminlist">
  136. <?php
  137. if( $rss->getChannelCount() == 0 ) {
  138. ?>
  139. <tr>
  140. <th colspan="3"><JText>Joom!Fish news</JText></th>
  141. </tr>
  142. <tr>
  143. <td colspan="3"><JText>NEWS_INTRODUCTION</JText></td>
  144. </tr>
  145. <?php
  146. } else {
  147. $k=0;
  148. $channel = &$rss->getChannel(0);
  149. ?>
  150. <tr>
  151. <th colspan="3"><a href="<?php echo $channel->getLink() ?>" target="_blank"><?php echo $channel->getTitle()?></a></th>
  152. </tr>
  153. <tr>
  154. <td colspan="3"><JText>NEWS_INTRODUCTION</JText></td>
  155. </tr>
  156. <?php
  157. $numItems = $channel->getItemCount();
  158. if( !$numItems ) {
  159. ?>
  160. <tr><th><JText>No news items found</JText></th></tr><?php
  161. } else {
  162. $numItems = ($numItems > 5) ? 5 : $numItems;
  163. for( $j = 0; $j < $numItems; $j++ ) {
  164. $item = & $channel->getItem($j);?>
  165. <tr><td class="row<?php echo $k;?>">
  166. <a href="<?php echo $item->getLink()?>" target="_blank"><?php echo $item->getTitle()?></a><?php
  167. if( $description = HTML_joomfish::_truncateString($item->getDescription(), 500) ) {?>
  168. <br /><?php echo $description?><?php
  169. }?>
  170. </td></tr><?php
  171. }
  172. }
  173. $k = 1 - $k;
  174. }
  175. ?>
  176. </table>
  177. <?php
  178. $tabs->endTab();
  179. }
  180. if( $publishedTabs & JFCPANEL_UNPUBLISHED || $alertContent ) {
  181. $tabTitle = $alertContent==true ? '<span style="color: red; font-weight: bold;">' .JText::_('TITLE_UNPUBLISHED'). '</span>' : JText::_('TITLE_UNPUBLISHED');
  182. $tabs->startTab( $tabTitle, 'jfcontentstate' );
  183. ?>
  184. <table class="adminlist" border="1">
  185. <tr>
  186. <th><JText>UNPUBLISHED CONTENT ELEMENTS</JText></th>
  187. <th style="text-align: center;"><JText>Language</JText></th>
  188. <th style="text-align: center;"><JText>Publish</JText></th>
  189. </tr>
  190. <?php
  191. $k=0;
  192. if( $alertContent ) {
  193. $curReftable = '';
  194. foreach ($contentInfo['unpublished'] as $ceInfo ) {
  195. $contentElement = $joomFishManager->getContentElement( $ceInfo['catid'] );
  196. // Trap for content elements that may have been removed
  197. if (is_null($contentElement)){
  198. $name = "<span style='font-style:italic'>".JText::sprintf("CONTENT_ELEMENT_MISSING",$ceInfo["reference_table"])."</span>";
  199. }
  200. else {
  201. $name = $contentElement->Name;
  202. }
  203. if ($ceInfo["reference_table"] != $curReftable){
  204. $curReftable = $ceInfo["reference_table"];
  205. $k=0;
  206. ?>
  207. <tr><td colspan="3"><strong><?php echo $name;?></strong></td></tr>
  208. <?php
  209. }
  210. $contentObject = new ContentObject( $ceInfo['language_id'], $contentElement );
  211. $contentObject->loadFromContentID($ceInfo['reference_id']);
  212. $link = 'index2.php?option=com_joomfish&amp;task=edit&amp;&amp;act=translate&amp;&amp;catid=' .$ceInfo['catid']. '&cid[]=0|' .$ceInfo['reference_id'].'|'.$ceInfo['language_id'];
  213. $hrefEdit = "<a href='".$link."'>".$contentObject->title. "</a>";
  214. $link = 'index2.php?option=com_joomfish&amp;task=publish&amp;&amp;act=translate&amp;&amp;catid=' .$ceInfo['catid']. '&cid[]=0|' .$ceInfo['reference_id'].'|'.$ceInfo['language_id'];
  215. $hrefPublish = '<a href="'.$link.'"><img src="images/publish_x.png" width="12" height="12" border="0" alt="" /></a>';
  216. ?>
  217. <tr class="row<?php echo $k;?>">
  218. <td align="left"><?php echo $hrefEdit;?></td>
  219. <td style="text-align: center;"><?php echo $ceInfo['language'];?></td>
  220. <td style="text-align: center;"><?php echo $hrefPublish;?></td>
  221. </tr>
  222. <?php
  223. $k = 1 - $k;
  224. }
  225. } else {
  226. ?>
  227. <tr class="row0">
  228. <td colspan="3"><JText>No unpublished translations found</JText></td>
  229. </tr>
  230. <?php
  231. }
  232. ?>
  233. </table>
  234. <?php
  235. $tabs->endTab();
  236. }
  237. if( $publishedTabs & JFCPANEL_STATE || $alertState ) {
  238. $tabTitle = $alertState==true ? '<span style="color: red; font-weight: bold;">' .JText::_('System State'). '</span>' : JText::_('System State');
  239. $tabs->startTab( $tabTitle, 'jfsystemstate' );
  240. ?>
  241. <table class="adminlist">
  242. <?php
  243. foreach ($stateGroups as $key=>$stateRow) {
  244. ?>
  245. <tr>
  246. <th colspan="3"><JText><?php echo $key. ' state';?></JText></th>
  247. </tr>
  248. <?php
  249. $k=0;
  250. foreach ($stateRow as $row) {
  251. ?>
  252. <tr class="row<?php echo $k;?>">
  253. <td><?php
  254. if( $row->link != '' ) {
  255. $row->description = '<a href="' .$row->link. '">' .$row->description. '</a>';
  256. }
  257. echo $row->description;
  258. ?></td>
  259. <td colspan="2"><?php echo $row->resultText;?></td>
  260. <?php
  261. $k = 1 - $k;
  262. }
  263. }
  264. ?>
  265. <?php if( key_exists( 'mbfInstall', $panelStates ) && $panelStates['mbfInstall'] != 0 ) { ?>
  266. <tr>
  267. <th colspan="3"><JText>Translation State</JText></th>
  268. </tr>
  269. <tr class="row">
  270. <td><JText>Mambelfish Install</JText></td>
  271. <td><?php echo $panelStates['mbfInstall_text' ];?></td>
  272. <td><?php if( $panelStates[ 'mbfInstall_href' ] != "" ) : ?>
  273. <a href="<?php echo $panelStates[ 'mbfInstall_href' ];?>"><img src="<?php echo $mosConfig_live_site;?>/administrator/images/dbrestore.png" border="0" alt="<?php echo JText::_('UPGRADE_INSTALLATION');?>" /></a>
  274. <?php endif; ?>
  275. </td>
  276. </tr>
  277. <?php } ?>
  278. </table>
  279. <?php
  280. $tabs->endTab();
  281. }
  282. $tabs->endPane();
  283. ?>
  284. </div>
  285. </td>
  286. </tr>
  287. <?php
  288. HTML_joomfish::_JoomlaFooter( '', $act, $option );
  289. }
  290. /**
  291. * Method to show the component configuration
  292. *
  293. * @param object $joomfishManager
  294. * @param array $languageList
  295. */
  296. function showComponentConfiguration( $joomfishManager, $languageList) {
  297. global $act, $task, $option, $database, $mosConfig_lang, $mosConfig_live_site;
  298. HTML_joomfish::_JoomlaHeader( JText::_('PREF_TITLE'), 'config');
  299. ?>
  300. <tr>
  301. <th colspan="3"><JText>Component Configuration</JText></th>
  302. </tr>
  303. <tr align="center" valign="middle">
  304. <td width="30%" align="left" valign="top"><strong><JText>Component Admin Interface Language</JText></strong></td>
  305. <td width="20%" align="left" valign="top">
  306. <?php
  307. $frmField = mosHTML::selectList( $languageList, 'frmComponentAdminLanguage', 'class="inputbox" size="1"', 'value', 'text', $joomfishManager->getCfg( 'componentAdminLang' ) );
  308. echo $frmField;
  309. ?>
  310. </td>
  311. <td align="left" valign="top">
  312. <?php $tip = JText::_('COMPONENT_CONFIGURATION_HELP');
  313. echo mosToolTip( $tip );
  314. ?>
  315. </td>
  316. </tr>
  317. <tr>
  318. <th colspan="3"><JText>SHOWIF</JText></th>
  319. </tr>
  320. <tr align="center" valign="middle">
  321. <td width="30%" align="left" valign="top"><strong><JText>No Translation available</JText></strong></td>
  322. <td width="20%" align="left" valign="top">
  323. <?php
  324. $options[] = mosHTML::makeOption( '0', JText::_('Original content') );
  325. $options[] = mosHTML::makeOption( '1', JText::_('Placeholder') );
  326. $options[] = mosHTML::makeOption( '2', JText::_('Original with info') ); // activated mic
  327. $options[] = mosHTML::makeOption( '3', JText::_('Original with alt') );
  328. $frmField = mosHTML::selectList( $options, 'frmTranslationMode', 'class="inputbox" size="1"', 'value', 'text', $joomfishManager->getCfg( 'noTranslation' ) );
  329. echo $frmField;
  330. ?>
  331. </td>
  332. <td align="left" valign="top">
  333. <?php $tip = JText::_('NOTRANSLATION_HELP');
  334. echo mosToolTip( $tip );
  335. ?>
  336. </td>
  337. </tr>
  338. <tr align="center" valign="middle">
  339. <td width="30%" align="left" valign="top"><strong><JText>Placeholder</JText></strong></td>
  340. <td width="20%" align="left" valign="top">
  341. <input type="text" name="frmTranslationDefaultText" size="75" value="<?php echo $joomfishManager->getCfg('defaultText');?>" />
  342. </td>
  343. <td align="left">
  344. <?php
  345. $tip = JText::_('TRANS_DEFAULT_HELP');
  346. echo mosToolTip( $tip );
  347. ?>
  348. </td>
  349. </tr>
  350. <tr>
  351. <th colspan="3"><JText>Managing translations</JText></th>
  352. </tr>
  353. <tr>
  354. <td width="20%" align="left" valign="top"><strong><JText>Store original version as</JText></strong></td>
  355. <td width="20%" align="left" valign="top">
  356. <?php
  357. $options = array();
  358. $options[] = mosHTML::makeOption( 'md5', JText::_( 'MD5 key only' ) );
  359. $options[] = mosHTML::makeOption( 'both', JText::_('MD5 key and clear text') );
  360. $frmField = mosHTML::selectList( $options, 'frmStorageOfOriginal', 'class="inputbox" size="1"', 'value', 'text', $joomfishManager->getCfg( 'storageOfOriginal' ) );
  361. echo $frmField;
  362. ?>
  363. </td>
  364. <td align="left" valign="top"> <?php
  365. $tip = JText::_('MNGORIGINAL_HELP');
  366. echo mosToolTip( $tip );
  367. ?>
  368. </td>
  369. </tr>
  370. <tr>
  371. <th colspan="3"><JText>Access Preferences</JText></th>
  372. </tr>
  373. <tr>
  374. <td width="20%" align="left" valign="top"><strong><JText>Frontend publish</JText></strong></td>
  375. <td width="20%" align="left" valign="top">
  376. <?php
  377. $options = array();
  378. $options[] = mosHTML::makeOption( '0', JText::_('Noone'));
  379. $options[] = mosHTML::makeOption( '1', JText::_('Publishers') );
  380. $frmField = mosHTML::selectList( $options, 'frmPublish', 'class="inputbox" size="1"', 'value', 'text', $joomfishManager->getCfg( 'frontEndPublish' ) );
  381. echo $frmField;
  382. ?>
  383. </td>
  384. <td align="left" valign="top"> <?php
  385. $tip = JText::_('FEPUBLISH_HELP');
  386. echo mosToolTip( $tip );
  387. ?>
  388. </tr>
  389. <tr>
  390. <th colspan="3"><JText>Inactive Language Preview Preference</JText></th>
  391. </tr>
  392. <tr>
  393. <td width="20%" align="left" valign="top"><strong><JText>Enable inactive languages for managers and above</JText></strong></td>
  394. <td width="20%" align="left" valign="top">
  395. <?php
  396. $options = array();
  397. $options[] = mosHTML::makeOption( '0', JText::_('No'));
  398. $options[] = mosHTML::makeOption( '1', JText::_('Yes') );
  399. $frmField = mosHTML::selectList( $options, 'frmFrontEndPreview', 'class="inputbox" size="1"', 'value', 'text', $joomfishManager->getCfg( 'frontEndPreview' ) );
  400. echo $frmField;
  401. ?>
  402. </td>
  403. <td align="left" valign="top"> <?php
  404. $tip = JText::_('PREVIEW_HELP');
  405. echo mosToolTip( $tip );
  406. ?>
  407. </tr>
  408. <tr>
  409. <th colspan="3"><JText>Control Panel Moduls</JText></th>
  410. </tr>
  411. <tr>
  412. <td width="20%" align="left" valign="top"><strong><JText>Which modules are active on the control panel</JText></strong></td>
  413. <td width="20%" align="left" valign="top">
  414. <?php
  415. $cpanelModules = $joomfishManager->getCfg( 'showCPanels' );
  416. ?>
  417. <select name="frmShowCPanels[]" class="inputbox" size="3" multiple>
  418. <option value="<?php echo JFCPANEL_NEWS;?>" <?php echo ($cpanelModules & JFCPANEL_NEWS) ? 'SELECTED' : '';?>><JText>News</JText></option>
  419. <option value="<?php echo JFCPANEL_UNPUBLISHED;?>" <?php echo ($cpanelModules & JFCPANEL_UNPUBLISHED) ? 'SELECTED' : '';?>><JText>TITLE_UNPUBLISHED</JText></option>
  420. <option value="<?php echo JFCPANEL_STATE;?>" <?php echo ($cpanelModules & JFCPANEL_STATE) ? 'SELECTED' : '';?>><JText>TITLE_STATE</JText></option>
  421. </select>
  422. </td>
  423. <td align="left" valign="top"> <?php
  424. $tip = JText::_('CPANEL_HELP');
  425. echo mosToolTip( $tip );
  426. ?>
  427. </tr>
  428. <tr>
  429. <th colspan="3"><JText>Advanced Users Only - Experimental Query Analysis Caching</JText></th>
  430. </tr>
  431. <tr>
  432. <td width="20%" align="left" valign="top"><strong><JText>Enable experimental query analysis caching</JText></strong></td>
  433. <td width="20%" align="left" valign="top">
  434. <?php
  435. $options = array();
  436. $options[] = mosHTML::makeOption( '0', JText::_('No'));
  437. $options[] = mosHTML::makeOption( '1', JText::_('Yes') );
  438. $frmField = mosHTML::selectList( $options, 'qacaching', 'class="inputbox" size="1"', 'value', 'text', $joomfishManager->getCfg( 'qacaching',0 ) );
  439. echo $frmField;
  440. ?>
  441. </td>
  442. <td align="left" valign="top"> <?php
  443. $tip = JText::_('QA_CACHING_HELP');
  444. echo mosToolTip( $tip );
  445. ?>
  446. </tr>
  447. <tr>
  448. <td width="20%" align="left" valign="top"><strong><JText>Enable query analysis logging</JText> (<a href="<?php echo $mosConfig_live_site."/administrator/components/com_joomfish/qalog.txt"?>">qalog.txt</a>)</strong></td>
  449. <td width="20%" align="left" valign="top">
  450. <?php
  451. $options = array();
  452. $options[] = mosHTML::makeOption( '0', JText::_('No'));
  453. $options[] = mosHTML::makeOption( '1', JText::_('Yes') );
  454. $frmField = mosHTML::selectList( $options, 'qalogging', 'class="inputbox" size="1"', 'value', 'text', $joomfishManager->getCfg( 'qalogging',0 ) );
  455. echo $frmField;
  456. ?>
  457. </td>
  458. <td align="left" valign="top"> <?php
  459. $tip = JText::_('QA_LOGGING_HELP');
  460. echo mosToolTip( $tip );
  461. ?>
  462. </tr>
  463. <?php
  464. HTML_joomfish::_JoomlaFooter('show', $act, $option);
  465. }
  466. /**
  467. * This method creates the output for the language configuration
  468. *
  469. * @param class $joomfishManager
  470. * @param array $languageList
  471. */
  472. function showLanguageConfiguration( $joomfishManager, $languageList) {
  473. global $act, $task, $option, $database, $mosConfig_lang, $mosConfig_live_site;
  474. HTML_joomfish::_JoomlaHeader( JText::_('Language Title'), 'langmanager' );
  475. ?>
  476. <tr>
  477. <td width="30%" align="left" valign="top"><strong><JText>Default Language</JText></strong></td>
  478. <td align="left" valign="top"><strong style="color: red;"><?php echo $mosConfig_lang;?></strong>&nbsp;<JText>DEFAULT_LANGUAGE_HELP</JText></td>
  479. </tr>
  480. <tr>
  481. <td width="30%" align="left" valign="top"><strong><JText>Component Admin Interface Language</JText></strong></td>
  482. <td><JText>LANGUAGE_HELP</JText></td>
  483. <tr>
  484. <td align="center" valign="top" colspan="2">
  485. <table cellpadding="4" cellspacing="0" border="0" width="100%" class="adminlist">
  486. <tr>
  487. <th class="title">&nbsp;</th>
  488. <th class="title" width="20%" align="left"><JText>TITLE_NAME</JText>&nbsp;
  489. <?php
  490. $tip = JText::_('NAME_HELP');
  491. echo mosToolTip( $tip );
  492. ?>
  493. </th>
  494. <th width="5%" align="left"><JText>TITLE_ACTIVE</JText></th>
  495. <th width="10%" nowrap="nowrap" align="left"><JText>TITLE_ISOCODE</JText>&nbsp;
  496. <?php
  497. $tip = JText::_('ISOCODE_HELP');
  498. echo mosToolTip( $tip );
  499. ?>
  500. </th>
  501. <th width="10%" nowrap="nowrap" align="left"><JText>TITLE_SHORTCODE</JText>&nbsp;
  502. <?php
  503. $tip = JText::_('SHORTCODE_HELP');
  504. echo mosToolTip( $tip );
  505. ?>
  506. </th>
  507. <th width="15%" nowrap="nowrap" align="left"><JText>TITLE_JOOMLA</JText></th>
  508. <th nowrap="nowrap" align="left"><JText>TITLE_FALLBACK</JText>&nbsp;
  509. <?php
  510. $tip = JText::_('FALLBACK_HELP');
  511. echo mosToolTip( $tip );
  512. ?>
  513. </th>
  514. <th width="30%" nowrap="nowrap" align="left"><JText>TITLE_IMAGE</JText>&nbsp;
  515. <?php
  516. $tip = JText::_('IMAGES_DIR_HELP');
  517. echo mosToolTip( $tip );
  518. ?>
  519. </th>
  520. <th nowrap="nowrap" align="left"><JText>TITLE_ORDER</JText>&nbsp;
  521. <?php
  522. $tip = JText::_('ORDER_HELP');
  523. echo mosToolTip( $tip );
  524. ?>
  525. </th>
  526. <th nowrap="nowrap" align="left"><JText>TITLE_CONFIG</JText>&nbsp;
  527. <?php
  528. $tip = JText::_('CONFIG_HELP');
  529. echo mosToolTip( $tip );
  530. ?>
  531. </th>
  532. </tr>
  533. <?php
  534. $k=0;
  535. $i=0;
  536. reset($languageList);
  537. foreach ($languageList as $language ) { ?>
  538. <tr class="<?php echo 'row' . $k; ?>">
  539. <td align="center">
  540. <input type="hidden" name="frmLanguageID[]" value="<?php echo $language->id; ?>" />
  541. <?php if ( $mosConfig_lang != $language->code ) : ?>
  542. <input type="checkbox" name="frmLanguageDelete[]" value="<?php echo $language->id; ?>" onclick="isChecked(this.checked);" />
  543. <?php endif;?>
  544. </td>
  545. <td><input type="text" name="frmLanguageName[]" value="<?php echo $language->name; ?>" size="30" maxlength="100" /></td>
  546. <td align="center"><input type="checkbox" name="frmLanguageActive[]"<?php echo $language->active==1 ? ' checked' : ''; ?> value="<?php echo $language->id; ?>" /></td>
  547. <td><input type="text" name="frmLanguageISO[]" value="<?php echo $language->iso; ?>" size="10" maxlength="20" /></td>
  548. <td><input type="text" name="frmLanguageShortCode[]" value="<?php echo $language->shortcode; ?>" size="10" maxlength="20" /></td>
  549. <td><input type="text" name="frmLanguageCode[]" value="<?php echo $language->code; ?>" size="13" maxlength="20" /></td>
  550. <td><input type="text" name="frmLanguageFallbackCode[]" value="<?php echo $language->fallback_code; ?>" size="10" maxlength="20" /></td>
  551. <td nowrap="nowrap">
  552. <input type="text" name="frmLanguageImage[]" value="<?php echo $language->image; ?>" size="30" />
  553. <?php
  554. // new by mic
  555. if( !empty( $language->image ) || !empty( $language->shortcode ) ) {
  556. if( eregi( '/', $language->image ) ) {
  557. $flag_image_src = $language->image;
  558. }else{
  559. $flag_image_src = $mosConfig_live_site
  560. . '/components/com_joomfish/images/flags/' . $language->shortcode . '.gif';
  561. } ?>
  562. &nbsp;
  563. <img src="<?php echo $flag_image_src; ?>" alt="<?php echo $language->name; ?>" title="<?php echo $language->name; ?>" width="20" height="14" border="0" />
  564. <?php
  565. } ?>
  566. </td>
  567. <td><input type="text" name="frmLanguageOrder[]" value="<?php echo $language->ordering; ?>" size="5" maxlength="5" /></td>
  568. <td align="center"><input type="hidden" name="frmLanguageParams[]" value="<?php echo $language->params; ?>" />
  569. <a href="index2.php?option=com_joomfish&amp;task=edit&amp;act=translateConfig&amp;hidemainmenu=1&amp;lang=<?php echo $language->id;?>"><img src="<?php echo $mosConfig_live_site;?>/images/M_images/edit.png" alt="<?php echo _E_EDIT;?>" border="0" /></a></td>
  570. <?php
  571. $k = 1 - $k;
  572. $i++;
  573. }
  574. ?>
  575. </tr>
  576. </table>
  577. </td>
  578. </tr>
  579. <?php
  580. HTML_joomfish::_JoomlaFooter('show', $act, $option);
  581. }
  582. function showElementOverview( $joomfishManager, $pageNav ) {
  583. global $my, $act, $task, $database, $mosConfig_live_site;
  584. $filterOptions = '';
  585. $filterOptions .= '<td nowrap align="center">' .JText::_('DISPLAY'). ':<br/>' .$pageNav->getLimitBox(). '</td>';
  586. HTML_joomfish::_JoomlaHeader( JText::_('Content elements'), 'cpanel', $filterOptions );
  587. ?>
  588. </table>
  589. <table cellpadding="4" cellspacing="0" border="0" width="100%" class="adminlist">
  590. <tr>
  591. <td>
  592. <table cellpadding="4" cellspacing="0" border="0" width="100%" class="adminList">
  593. <tr>
  594. <th width="20" nowrap>&nbsp;</th>
  595. <th class="title" width="35%" align="left"><JText>TITLE_NAME</JText></th>
  596. <th width="15%" align="left"><JText>TITLE_AUTHOR</JText></th>
  597. <th width="15%" nowrap="nowrap" align="left"><JText>TITLE_VERSION</JText></th>
  598. <th nowrap="nowrap" align="left"><JText>TITLE_DESCRIPTION</JText></th>
  599. </tr>
  600. <?php
  601. $elements = $joomfishManager->getContentElements();
  602. $k=0;
  603. $i=0;
  604. $element_values = array_values($elements);
  605. for ( $i=$pageNav->limitstart; $i<$pageNav->limitstart + $pageNav->limit && $i<$pageNav->total; $i++ ) {
  606. $element = $element_values[$i];
  607. $key = $element->referenceInformation['tablename'];
  608. ?>
  609. <tr class="<?php echo "row$k"; ?>">
  610. <td width="20">
  611. <?php if ($element->checked_out && $element->checked_out != $my->id) { ?>
  612. &nbsp;
  613. <?php } else { ?>
  614. <input type="checkbox" id="cb<?php echo $i;?>" name="cid[]" value="<?php echo $key; ?>" onclick="isChecked(this.checked);" />
  615. <?php } ?>
  616. </td>
  617. <td>
  618. <a href="#edit" onclick="return listItemTask('cb<?php echo $i;?>','edit')"><?php echo $element->Name; ?></a>
  619. </td>
  620. <td><?php echo $element->Author ? $element->Author : '&nbsp;'; ?></td>
  621. <td><?php echo $element->Version ? $element->Version : '&nbsp;'; ?></td>
  622. <td><?php echo $element->Description ? $element->Description : '&nbsp;'; ?></td>
  623. <?php
  624. $k = 1 - $k;
  625. }
  626. ?>
  627. </tr>
  628. <tr>
  629. <th align="center" colspan="5"><?php echo $pageNav->writePagesLinks(); ?></th>
  630. </tr>
  631. <tr>
  632. <td align="center" colspan="5"><?php echo $pageNav->writePagesCounter(); ?></td>
  633. </tr>
  634. </table>
  635. </td>
  636. </tr>
  637. <?php
  638. HTML_joomfish::_JoomlaFooter($task, 'config_elements');
  639. }
  640. function showElementConfiguration( $joomfishManager, $id ) {
  641. global $my, $act, $task, $database, $option, $mosConfig_live_site;
  642. HTML_joomfish::_JoomlaHeader( JText::_('Content elements'), 'joomfish', '', false );
  643. $contentElement = $joomfishManager->getContentElement( $id );
  644. ?>
  645. <table class="adminform">
  646. <tr>
  647. <td width="100%">
  648. <?php
  649. $tabs = new mosTabs(0);
  650. $tabs->startPane("contentelements");
  651. $tabs->startTab(JText::_('CONFIGURATION'),"ElementConfig-page");
  652. ?>
  653. <table width="100%" border="0" cellpadding="4" cellspacing="2" class="adminForm">
  654. <tr>
  655. <th colspan="3"><JText>General information</JText></th>
  656. </tr>
  657. <tr align="center" valign="middle">
  658. <td width="30%" align="left" valign="top"><strong><JText>TITLE_NAME</JText></strong></td>
  659. <td width="20%" align="left" valign="top"><?php echo $contentElement->Name;?></td>
  660. <td align="left"></td>
  661. </tr>
  662. <tr align="center" valign="middle">
  663. <td width="30%" align="left" valign="top"><strong><JText>TITLE_AUTHOR</JText></strong></td>
  664. <td width="20%" align="left" valign="top"><?php echo $contentElement->Author;?></td>
  665. <td align="left"></td>
  666. </tr>
  667. <tr align="center" valign="middle">
  668. <td width="30%" align="left" valign="top"><strong><JText>TITLE_VERSION</JText></strong></td>
  669. <td width="20%" align="left" valign="top"><?php echo $contentElement->Version;?></td>
  670. <td align="left"></td>
  671. </tr>
  672. <tr align="center" valign="middle">
  673. <td width="30%" align="left" valign="top"><strong><JText>TITLE_DESCRIPTION</JText></strong></td>
  674. <td width="20%" align="left" valign="top"><?php echo $contentElement->Description;?></td>
  675. <td align="left"></td>
  676. </tr>
  677. </table>
  678. <?php
  679. $tabs->endTab();
  680. $tabs->startTab(JText::_('DB Reference'),"ElementReference-page");
  681. $contentTable = $contentElement->getTable();
  682. ?>
  683. <table width="100%" border="0" cellpadding="4" cellspacing="2" class="adminForm">
  684. <tr>
  685. <th colspan="2"><JText>DATABASE_INFORMATION</JText></th>
  686. </tr>
  687. <tr align="center" valign="middle">
  688. <td width="15%" align="left" valign="top"><strong><JText>DATABASETABLE</JText></strong><br /><JText>DATABASETABLE_HELP</JText></td>
  689. <td width="60%" align="left" valign="top"><?php echo $contentTable->Name;?></td>
  690. </tr>
  691. <tr align="center" valign="middle">
  692. <td width="15%" align="left" valign="top"><strong><JText>DATABASEFIELDS</JText></strong><br /><JText>DATABASEFIELDS_HELP</JText></td>
  693. <td width="60%" align="left" valign="top">
  694. <table cellpadding="4" cellspacing="0" border="0" width="100%" class="adminlist">
  695. <tr>
  696. <th><JText>DBFIELDNAME</JText></th>
  697. <th><JText>DBFIELDTYPE</JText></th>
  698. <th><JText>DBFIELDLABLE</JText></th>
  699. <th><JText>TRANSLATE</JText></th>
  700. </tr>
  701. <?php
  702. $k=0;
  703. foreach( $contentTable->Fields as $tableField ) {
  704. ?>
  705. <tr class="<?php echo "row$k"; ?>">
  706. <td><?php echo $tableField->Name ? $tableField->Name : "&nbsp;";?></td>
  707. <td><?php echo $tableField->Type ? $tableField->Type : "&nbsp;";?></td>
  708. <td><?php echo $tableField->Lable ? $tableField->Lable : "&nbsp;";?></td>
  709. <td><?php echo $tableField->Translate ? _CMN_YES : _CMN_NO;?></td>
  710. </tr>
  711. <?php
  712. $k=1-$k;
  713. }
  714. ?>
  715. </table>
  716. <?php
  717. ?>
  718. </td>
  719. </tr>
  720. </table>
  721. <?php
  722. $tabs->endTab();
  723. $tabs->startTab(JText::_('Sample data'),"ElementSamples-page");
  724. $contentTable = $contentElement->getTable();
  725. ?>
  726. <table width="100%" border="0" cellpadding="4" cellspacing="2" class="adminForm">
  727. <tr>
  728. <th><JText>Sample data</JText></th>
  729. </tr>
  730. <tr align="center" valign="middle">
  731. <td width="100%" align="center" valign="top">
  732. <table cellpadding="4" cellspacing="0" border="0" width="100%" class="adminlist">
  733. <tr>
  734. <?php
  735. $sqlFields = "";
  736. foreach( $contentTable->Fields as $tableField ) {
  737. if( $sqlFields!='' ) $sqlFields .= ',';
  738. $sqlFields .= '`' .$tableField->Name. '`';
  739. ?>
  740. <th nowrap><?php echo $tableField->Lable;?></th>
  741. <?php
  742. }
  743. ?>
  744. </tr>
  745. <?php
  746. $k=0;
  747. $idname = $joomfishManager->getPrimaryKey($contentTable->Name);
  748. $sql = "SELECT $sqlFields"
  749. . "\nFROM #__" .$contentTable->Name
  750. . "\nORDER BY $idname limit 0,10";
  751. $database->setQuery( $sql );
  752. $rows = $database->loadObjectList();
  753. if( $rows != null ) {
  754. foreach ($rows as $row) {
  755. ?>
  756. <tr class="<?php echo "row$k"; ?>">
  757. <?php
  758. foreach( $contentTable->Fields as $tableField ) {
  759. $fieldName = $tableField->Name;
  760. $fieldValue = $row->$fieldName;
  761. if( $tableField->Type='htmltext' ) {
  762. $fieldValue = htmlspecialchars( $fieldValue );
  763. }
  764. if( $fieldValue=='' ) $fieldValue="&nbsp;";
  765. if( strlen($fieldValue) > 97 ) {
  766. $fieldValue = substr( $fieldValue, 0, 100) . '...';
  767. }
  768. ?>
  769. <td valign="top"><?php echo $fieldValue;?></td>
  770. <?php
  771. }
  772. ?>
  773. </tr>
  774. <?php
  775. $k=1-$k;
  776. }
  777. }
  778. ?>
  779. </table>
  780. <?php
  781. ?>
  782. </td>
  783. </tr>
  784. </table>
  785. <?php
  786. $tabs->endTab();
  787. $tabs->endPane();
  788. ?>
  789. </td></tr>
  790. <?php
  791. HTML_joomfish::_JoomlaFooter('', $task, $option);
  792. }
  793. /**
  794. * shows the element installer dialog
  795. */
  796. function showContentElementInstaller( $cefiles=null, $message=null ) {
  797. global $task, $act, $option;
  798. HTML_joomfish::_pageHeader();
  799. ?>
  800. <form enctype="multipart/form-data" action="index2.php" method="post" name="filename">
  801. <table class="adminheading">
  802. <tr>
  803. <th class="install"><JText>Install</JText> <JText>Content Elements</JText></th>
  804. </tr>
  805. </table>
  806. <?php if( $message != null ) : ?>
  807. <div class="message"><?php echo $message;?></div>
  808. <?php endif; ?>
  809. <table class="adminform">
  810. <tr>
  811. <th><JText>Upload XML file</JText></th>
  812. </tr>
  813. <tr>
  814. <td align="left"><JText>File name</JText>:
  815. <input class="text_area" name="userfile" type="file" size="70"/>
  816. <input class="button" type="submit" value="<?php echo JText::_('Upload file and install');?>" />
  817. </td>
  818. </tr>
  819. </table>
  820. <input type="hidden" name="task" value="uploadfile"/>
  821. <input type="hidden" name="act" value="config_elements"/>
  822. <input type="hidden" name="option" value="com_joomfish"/>
  823. </form>
  824. <p>&nbsp;</p>
  825. <?php if( $cefiles != null ) { ?>
  826. <form action="index2.php" method="post" name="adminForm">
  827. <table class="adminheading">
  828. <tr>
  829. <th class="install"><JText>Content Elements</JText></th>
  830. </tr>
  831. </table>
  832. <table cellpadding="4" cellspacing="0" border="0" width="100%" class="adminlist">
  833. <tr>
  834. <th width="20" nowrap>&nbsp;</th>
  835. <th class="title" width="35%" align="left"><JText>TITLE_NAME</JText></th>
  836. <th width="15%" align="left"><JText>TITLE_AUTHOR</JText></th>
  837. <th width="15%" nowrap="nowrap" align="left"><JText>TITLE_VERSION</JText></th>
  838. <th nowrap="nowrap" align="left"><JText>TITLE_DESCRIPTION</JText></th>
  839. </tr>
  840. <?php
  841. $k=0;
  842. $i=0;
  843. foreach (array_values($cefiles) as $element ) {
  844. $key = $element->referenceInformation['tablename'];
  845. ?>
  846. <tr class="<?php echo "row$k"; ?>">
  847. <td width="20">
  848. <?php if ($element->checked_out && $element->checked_out != $my->id) { ?>
  849. &nbsp;
  850. <?php } else { ?>
  851. <input type="radio" id="cb<?php echo $i;?>" name="cid[]" value="<?php echo $key; ?>" onclick="isChecked(this.checked);">
  852. <?php } ?>
  853. </td>
  854. <td><?php echo $element->Name; ?></td>
  855. <td><?php echo $element->Author ? $element->Author : '&nbsp;'; ?></td>
  856. <td><?php echo $element->Version ? $element->Version : '&nbsp;'; ?></td>
  857. <td><?php echo $element->Description ? $element->Description : '&nbsp;'; ?></td>
  858. </tr>
  859. <?php
  860. $k = 1 - $k;
  861. $i++;
  862. }
  863. } else {
  864. ?>
  865. <tr><td class="small">
  866. There are no custom elements installed
  867. </td></tr>
  868. <?php
  869. }
  870. ?>
  871. </table>
  872. <input type="hidden" name="task" value="" />
  873. <input type="hidden" name="act" value="config_elements" />
  874. <input type="hidden" name="boxchecked" value="0" />
  875. <input type="hidden" name="option" value="<?php echo $option;?>" />
  876. </form>
  877. <table width="100%" border="0">
  878. <tr>
  879. <td width="99%" align="right" valign="top">
  880. <?php
  881. $x = "@";
  882. $y="Support";
  883. $z="JoomFish.net";
  884. $mail=$y.$x.$z;
  885. ?><div align="center"><span class="smallgrey">Joom!Fish Version <?php echo JoomFishManager::getVersionFooter();?>, &copy; 2003-2007 Copyright by <a href="http://www.ThinkNetwork.com" target="_blank" class="smallgrey">Think Network</a> under <a href="index2.php?option=com_joomfish&amp;task=showInformation&amp;fileCode=license" class="smallgrey">Open Source License.</a> Contact: <?php echo mosHTML::emailCloaking( $mail, 0);?></span></div>
  886. </td>
  887. </tr>
  888. </table>
  889. <?php
  890. HTML_joomfish::_pageFooter();
  891. }
  892. /**
  893. * shows the translation overview
  894. *
  895. * @param array $rows of rows within this particular overview
  896. * @param array $search of search parameters
  897. * @param object $pageNav of page navigation information
  898. * @param array $langlist of languages available
  899. * @param array $clist of content element files
  900. * @param array $catid of selected id's
  901. * @param int $language_id of the current language
  902. * @param array $filterlist of additional filter settings
  903. */
  904. function showTranslationOverview( $rows, $search, $pageNav, $langlist, $clist, $catid , $language_id, $filterlist=array()) {
  905. global $my, $act, $task, $database, $option, $mosConfig_live_site;
  906. $filterOptions = '<td align="right"><table><tr>';
  907. $filterOptions .= '<td nowrap align="center">' .JText::_('Display'). ':<br/>' .$pageNav->getLimitBox(). '</td>';
  908. $filterOptions .= '<td nowrap align="center">' .JText::_('Languages'). ':<br/>' .$langlist. '</td>';
  909. $filterOptions .= '<td nowrap align="center">' .JText::_('Content elements'). ':<br/>' .$clist. '</td>';
  910. $filterOptions .= '</tr></table>';
  911. if (isset($filterlist) && count($filterlist)>0){
  912. $filterOptions .= '<table><tr>';
  913. foreach ($filterlist as $fl){
  914. if (is_array($fl)) $filterOptions .= "<td nowrap align='center'>".$fl["title"].":<br/>".$fl["html"]."</td>";
  915. }
  916. $filterOptions .= '</tr></table>';
  917. }
  918. HTML_joomfish::_JoomlaHeader( JText::_('TITLE_TRANSLATION'), 'edit', $filterOptions );
  919. ?>
  920. </table>
  921. <table cellpadding="4" cellspacing="0" border="0" width="100%" class="adminlist">
  922. <tr>
  923. <th width="20"><input type="checkbox" name="toggle" value="" onclick="checkAll(<?php echo count($rows); ?>);" /></th>
  924. <th class="title" width="20%" align="left" nowrap="nowrap"><JText>TITLE</JText></th>
  925. <th width="10%" align="left" nowrap="nowrap"><JText>Language</JText></th>
  926. <th width="20%" align="left" nowrap="nowrap"><JText>TITLE_TRANSLATION</JText></th>
  927. <th width="15%" align="left" nowrap="nowrap"><JText>TITLE_DATECHANGED</JText></th>
  928. <th width="15%" nowrap="nowrap" align="center"><JText>TITLE_STATE</JText></th>
  929. <th align="center" nowrap="nowrap"><JText>TITLE_PUBLISHED</JText></th>
  930. </tr>
  931. <?php
  932. if( !isset($catid) || $catid == "" || $language_id==-1) {
  933. ?>
  934. <tr><td colspan="8"><p><JText>NOELEMENT_SELECTED</JText></p></td></tr>
  935. <?php
  936. }
  937. else {
  938. ?>
  939. <?php
  940. $k=0;
  941. $i=0;
  942. foreach ($rows as $row ) {
  943. ?>
  944. <tr class="<?php echo "row$k"; ?>">
  945. <td width="20">
  946. <?php if ($row->checked_out && $row->checked_out != $my->id) { ?>
  947. &nbsp;
  948. <?php } else { ?>
  949. <input type="checkbox" id="cb<?php echo $i;?>" name="cid[]" value="<?php echo $row->translation_id."|".$row->id."|".$row->language_id; ?>" onclick="isChecked(this.checked);" />
  950. <?php } ?>
  951. </td>
  952. <td>
  953. <a href="#edit" onclick="hideMainMenu(); return listItemTask('cb<?php echo $i;?>','edit');"><?php echo $row->title; ?></a>
  954. </td>
  955. <td nowrap><?php echo $row->language ? $row->language : JText::_('NOTRANSLATIONYET') ; ?></td>
  956. <td><?php echo $row->titleTranslation ? $row->titleTranslation : '&nbsp;'; ?></td>
  957. <td><?php echo $row->lastchanged ? strftime("%A, %d %B %Y %H:%M",strtotime($row->lastchanged)):"";?></td>
  958. <?php
  959. switch( $row->state ) {
  960. case 1:
  961. $img = 'status_g.png';
  962. break;
  963. case 0:
  964. $img = 'status_y.png';
  965. break;
  966. case -1:
  967. default:
  968. $img = 'status_r.png';
  969. break;
  970. }
  971. ?>
  972. <td align="center"><img src="components/com_joomfish/images/<?php echo $img;?>" width="12" height="12" border="0" alt="" /></td>
  973. <?php
  974. if (isset($row->published) && $row->published) {
  975. $img = 'publish_g.png';
  976. } else {
  977. $img = 'publish_x.png';
  978. }
  979. $href='';
  980. if( $row->state>=0 ) {
  981. $href = '<a href="javascript: void(0);" ';
  982. $href .= 'onclick="return listItemTask(\'cb' .$i. '\',\'' .($row->published ? 'unpublish' : 'publish'). '\')">';
  983. $href .= '<img src="images/' .$img. '" width="12" height="12" border="0" alt="" />';
  984. $href .= '</a>';
  985. }
  986. else {
  987. $href = '<img src="images/' .$img. '" width="12" height="12" border="0" alt="" />';
  988. }
  989. ?>
  990. <td align="center"><?php echo $href;?></td>
  991. <?php
  992. $k = 1 - $k;
  993. $i++;
  994. }
  995. ?>
  996. </tr>
  997. <tr>
  998. <th align="center" colspan="10">
  999. <?php echo $pageNav->writePagesLinks(); ?></th>
  1000. </tr>
  1001. <tr>
  1002. <td align="center" colspan="10"> <?php echo $pageNav->writePagesCounter(); ?></td>
  1003. </tr>
  1004. </table>
  1005. <br />
  1006. <table cellspacing="0" cellpadding="4" border="0" align="center">
  1007. <tr align="center">
  1008. <td> <img src="components/com_joomfish/images/status_g.png" width="12" height="12" border=0 alt="<JText>STATE_OK</JText>" />
  1009. </td>
  1010. <td> <JText>TRANSLATION_UPTODATE</JText> |</td>
  1011. <td> <img src="components/com_joomfish/images/status_y.png" width="12" height="12" border=0 alt="<JText>STATE_CHANGED</JText>" />
  1012. </td>
  1013. <td> <JText>TRANSLATION_INCOMPLETE</JText> |</td>
  1014. <td> <img src="components/com_joomfish/images/status_r.png" width="12" height="12" border=0 alt="<JText>STATE_NOTEXISTING</JText>" />
  1015. </td>
  1016. <td> <JText>TRANSLATION_NOT_EXISTING</JText></td>
  1017. </tr>
  1018. <tr align="center">
  1019. <td> <img src="images/publish_g.png" width="12" height="12" border=0 alt="Translation visible" />
  1020. </td>
  1021. <td> <JText>TRANSLATION_PUBLISHED</JText> |</td>
  1022. <td> <img src="images/publish_x.png" width="12" height="12" border=0 alt="Finished" />
  1023. </td>
  1024. <td> <JText>TRANSLATION_NOT_PUBLISHED</JText></td>
  1025. <td> &nbsp;
  1026. </td>
  1027. <td><JText>STATE_TOGGLE</JText></td>
  1028. </tr>
  1029. <?php } ?>
  1030. <?php
  1031. HTML_joomfish::_JoomlaFooter( 'overview', $act, $option);
  1032. }
  1033. /**
  1034. * shows the overview of orphan translations
  1035. *
  1036. * @param unknown_type $rows
  1037. * @param unknown_type $search
  1038. * @param unknown_type $pageNav
  1039. * @param unknown_type $langlist
  1040. * @param unknown_type $clist
  1041. * @param unknown_type $catid
  1042. * @param unknown_type $language_id
  1043. * @param unknown_type $filterlist
  1044. */
  1045. function showOrphanOverview( $rows, $search, $pageNav, $langlist="", $clist, $catid , $language_id, $filterlist=array()) {
  1046. global $my, $act, $task, $database, $option, $mosConfig_live_site;
  1047. $filterOptions = '<td align="right"><table><tr>';
  1048. $filterOptions .= '<td nowrap align="center">' .JText::_('DISPLAY'). ':<br/>' .$pageNav->getLimitBox(). '</td>';
  1049. if (strlen($langlist)>0) $filterOptions .= '<td nowrap align="center">' .JText::_('Languages'). ':<br/>' .$langlist. '</td>';
  1050. $filterOptions .= '<td nowrap align="center">' .JText::_('Content elements'). ':<br/>' .$clist. '</td>';
  1051. $filterOptions .= '</tr></table>';
  1052. if (isset($filterlist) && count($filterlist)>0){
  1053. $filterOptions .= '<table><tr>';
  1054. foreach ($filterlist as $fl){
  1055. if (is_array($fl)) $filterOptions .= "<td nowrap align='center'>".$fl["title"].":<br/>".$fl["html"]."</td>";
  1056. }
  1057. $filterOptions .= '</tr></table>';
  1058. }
  1059. HTML_joomfish::_JoomlaHeader( JText::_('CLEANUP ORPHANS'), 'orphan', $filterOptions );
  1060. ?>
  1061. </table>
  1062. <table cellpadding="4" cellspacing="0" border="0" width="100%" class="adminlist">
  1063. <tr>
  1064. <th width="20"><input type="checkbox" name="toggle" value="" onclick="checkAll(<?php echo count($rows); ?>);" /></th>
  1065. <th class="title" width="20%" align="left" nowrap="nowrap"><JText>TITLE</JText></th>
  1066. <th width="10%" align="left" nowrap="nowrap"><JText>Language</JText></th>
  1067. <th width="20%" align="left" nowrap="nowrap"><JText>TITLE_TRANSLATION</JText></th>
  1068. <th width="15%" align="left" nowrap="nowrap"><JText>TITLE_DATECHANGED</JText></th>
  1069. <th width="15%" nowrap="nowrap" align="center"><JText>TITLE_STATE</JText></th>
  1070. <th align="center" nowrap="nowrap"><JText>TITLE_PUBLISHED</JText></th>
  1071. </tr>
  1072. <?php
  1073. if( !isset($catid) || $catid == "" ) {
  1074. ?>
  1075. <tr><td colspan="8"><p><JText>NOELEMENT_SELECTED</JText></p></td></tr>
  1076. <?php
  1077. }
  1078. else {
  1079. ?>
  1080. <?php
  1081. $k=0;
  1082. $i=0;
  1083. foreach ($rows as $row ) {
  1084. ?>
  1085. <tr class="<?php echo "row$k"; ?>">
  1086. <td width="20">
  1087. <?php if ($row->checked_out && $row->checked_out != $my->id) { ?>
  1088. &nbsp;
  1089. <?php } else { ?>
  1090. <input type="checkbox" id="cb<?php echo $i;?>" name="cid[]" value="<?php echo $row->jfc_id."|".$row->jfc_refid."|".$row->language_id; ?>" onclick="isChecked(this.checked);" />
  1091. <?php } ?>
  1092. </td>
  1093. <td>
  1094. <a href="#edit" onclick="return listItemTask('cb<?php echo $i;?>','edit')"><?php echo $row->title; ?></a>
  1095. </td>
  1096. <td nowrap><?php echo $row->language ? $row->language : JText::_('NOTRANSLATIONYET'); ?></td>
  1097. <td><?php echo $row->titleTranslation ? $row->titleTranslation : '&nbsp;'; ?></td>
  1098. <td><?php echo $row->lastchanged ? strftime("%A, %d %B %Y %H:%M",strtotime($row->lastchanged)):"";?></td>
  1099. <?php
  1100. switch( $row->state ) {
  1101. case 1:
  1102. $img = 'status_g.png';
  1103. break;
  1104. case 0:
  1105. $img = 'status_y.png';
  1106. break;
  1107. case -1:
  1108. default:
  1109. $img = 'status_r.png';
  1110. break;
  1111. }
  1112. ?>
  1113. <td align="center"><img src="components/com_joomfish/images/<?php echo $img;?>" width="12" height="12" border="0" alt="" /></td>
  1114. <?php
  1115. if (isset($row->published) && $row->published) {
  1116. $img = 'publish_g.png';
  1117. } else {
  1118. $img = 'publish_x.png';
  1119. }
  1120. $href='';
  1121. if( $row->state>=0 ) {
  1122. $href = '<a href="javascript: void(0);" ';
  1123. $href .= 'onclick="return listItemTask(\'cb' .$i. '\',\'' .($row->published ? 'unpublish' : 'publish'). '\')">';
  1124. $href .= '<img src="images/' .$img. '" width="12" height="12" border="0" alt="" />';
  1125. $href .= '</a>';
  1126. }
  1127. else {
  1128. $href = '<img src="images/' .$img. '" width="12" height="12" border="0" alt="" />';
  1129. }
  1130. ?>
  1131. <td align="center"><?php echo $href;?></td>
  1132. <?php
  1133. $k = 1 - $k;
  1134. $i++;
  1135. ?>
  1136. </tr>
  1137. <?php }?>
  1138. <tr>
  1139. <th align="center" colspan="10"> <?php echo $pageNav->writePagesLinks(); ?></th>
  1140. </tr>
  1141. <tr>
  1142. <td align="center" colspan="10"> <?php echo $pageNav->writePagesCounter(); ?></td>
  1143. </tr>
  1144. </table>
  1145. <br />
  1146. <table cellspacing="0" cellpadding="4" border="0" align="center">
  1147. <tr align="center">
  1148. <td> <img src="components/com_joomfish/images/status_g.png" width="12" height="12" border=0 alt="<JText>STATE_OK</JText>" />
  1149. </td>
  1150. <td> <JText>TRANSLATION_UPTODATE</JText> |</td>
  1151. <td> <img src="components/com_joomfish/images/status_y.png" width="12" height="12" border=0 alt="<JText>STATE_CHANGED</JText>" />
  1152. </td>
  1153. <td> <JText>TRANSLATION_INCOMPLETE</JText> |</td>
  1154. <td> <img src="components/com_joomfish/images/status_r.png" width="12" height="12" border=0 alt="<JText>STATE_NOTEXISTING</JText>" />
  1155. </td>
  1156. <td> <JText>TRANSLATION_NOT_EXISTING</JText></td>
  1157. </tr>
  1158. <tr align="center">
  1159. <td> <img src="images/publish_g.png" width="12" height="12" border=0 alt="Translation visible" />
  1160. </td>
  1161. <td> <JText>TRANSLATION_PUBLISHED</JText> |</td>
  1162. <td> <img src="images/publish_x.png" width="12" height="12" border=0 alt="Finished" />
  1163. </td>
  1164. <td> <JText>TRANSLATION_NOT_PUBLISHED</JText> </td>
  1165. <td> &nbsp;
  1166. </td>
  1167. <td> <JText>STATE_TOGGLE</JText> </td>
  1168. </tr>
  1169. <?php } ?>
  1170. <?php
  1171. HTML_joomfish::_JoomlaFooter('overview', $act, $option);
  1172. }
  1173. /**
  1174. * shows the overview of the check
  1175. *
  1176. * @param unknown_type $rows
  1177. * @param unknown_type $search
  1178. * @param unknown_type $pageNav
  1179. * @param unknown_type $langlist
  1180. * @param unknown_type $clist
  1181. * @param unknown_type $catid
  1182. * @param unknown_type $language_id
  1183. * @param unknown_type $filterlist
  1184. */
  1185. function showManagementOverview($type='' ) {
  1186. global $act, $task, $option, $mosConfig_live_site;
  1187. ?>
  1188. <script language="javascript" type="text/javascript">
  1189. function updateResultDiv( resultInfo, type ) {
  1190. resultDiv = document.getElementById("manage_results");
  1191. if( type == 'div' ) {
  1192. resultDiv.innerHTML = resultInfo.innerHTML;
  1193. } else {
  1194. resultDiv.innerHTML = resultInfo;
  1195. }
  1196. }
  1197. function executeCopyOriginal( toLanguage, confirmCheck, copyCat ) {
  1198. if( toLanguage == null || toLanguage.value == -1 ) return;
  1199. var link = 'index3.php?option=com_joomfish&task=copy&act=manage&type=original_language&phase=2';
  1200. if( confirmCheck.checked == true ) {
  1201. if( !window.confirm( '<?php echo JText::_('CONFIRM_COPY_TO', true);?>' ) ) return;
  1202. link += '&overwrite=1';
  1203. } else {
  1204. link += '&overwrite=0';
  1205. }
  1206. link += '&language_id=' +toLanguage.value;
  1207. // adding all requested catids to one string
  1208. var catString = '';
  1209. for(var i=0; i<copyCat.length; i++) {
  1210. if( copyCat[i].value != null && copyCat[i].checked == true ) {
  1211. if(catString != '') {
  1212. catString += ',';
  1213. }
  1214. catString += copyCat[i].value;
  1215. }
  1216. }
  1217. link += '&state_catid=' + catString;
  1218. ajaxFrame = document.getElementById("ajaxFrame");
  1219. ajaxFrame.contentDocument.location.href = link;
  1220. }
  1221. </script>
  1222. <?php
  1223. HTML_joomfish::_JoomlaHeader( JText::_('TITLE_Management'), 'check', '' );
  1224. ?>
  1225. <tr>
  1226. <td width="35%" valign="top">
  1227. <div id="cpanel">
  1228. <?php
  1229. $link = 'index3.php?option=com_joomfish&amp;taskā€¦

Large files files are truncated, but you can click here to view the full file