PageRenderTime 70ms CodeModel.GetById 26ms RepoModel.GetById 1ms app.codeStats 0ms

/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
  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=check&amp;act=manage&amp;type=translation_status';
  1230. HTML_joomfish::_quickiconButton( $link, 'checkin.png', JText::_('Check Translation Status'), '/administrator/images/', 'ajaxFrame', "updateResultDiv('" .JText::_('Processing'). "', 'text');" );
  1231. $link = 'index3.php?option=com_joomfish&amp;task=check&amp;act=manage&amp;type=original_status';
  1232. HTML_joomfish::_quickiconButton( $link, 'checkin.png', JText::_('Check Original Status'), '/administrator/images/', 'ajaxFrame', "updateResultDiv('" .JText::_('Processing'). "', 'text');" );
  1233. $link = 'index3.php?option=com_joomfish&amp;task=copy&amp;act=manage&amp;type=original_language';
  1234. HTML_joomfish::_quickiconButton( $link, 'dbrestore.png', JText::_('Copy Original to Language'), '/administrator/images/', 'ajaxFrame', "updateResultDiv('" .JText::_('Processing', 'text'). "');" );
  1235. /*
  1236. echo '<div style="clear: both;" />';
  1237. $link = 'index3.php?option=com_joomfish&amp;task=copy&amp;act=manage&amp;type=translation_language';
  1238. HTML_joomfish::_quickiconButton( $link, 'dbrestore.png', JText::_('Copy Translation to Langage'), '/administrator/images/', 'ajaxFrame', "updateResultDiv('" .JText::_('Processing', 'text'). "');" );
  1239. $link = 'index3.php?option=com_joomfish&amp;task=update&amp;act=manage&amp;type=original_value';
  1240. HTML_joomfish::_quickiconButton( $link, 'query.png', JText::_('Update original values'), '/administrator/images/', 'ajaxFrame', "updateResultDiv('" .JText::_('Processing'). "', 'text');" );
  1241. */
  1242. ?>
  1243. </div>
  1244. </td>
  1245. <td width="45%" valign="top">
  1246. <div style="width: 98%; height: 100%;">
  1247. <h3><JText>Management info</JText></h3>
  1248. <div id="manage_results"><?php echo JText::_('MANAGEMENT_INTRO');?></div>
  1249. </div>
  1250. <iframe style="display: none;" id="ajaxFrame" name="ajaxFrame" ></iframe>
  1251. </td>
  1252. </tr>
  1253. <?php
  1254. HTML_joomfish::_JoomlaFooter($task, 'config_elements');
  1255. }
  1256. /**
  1257. * This method copies the result information from the iframe into the available div area
  1258. *
  1259. * @param string $resultInformation inner HTML output
  1260. * @param string $reload url for a requested URL
  1261. */
  1262. function showManagementResult( $resultInformation=null, $reload='' ) {
  1263. ?>
  1264. <div id="resultContent"><?php echo $resultInformation;?></div>
  1265. <script language="javascript" type="text/javascript">
  1266. resultDiv = document.getElementById("resultContent");
  1267. window.parent.updateResultDiv( resultDiv, 'div' );
  1268. <?php
  1269. if( $reload != '' ) {
  1270. echo "document.location.href='$reload';";
  1271. }
  1272. ?>
  1273. </script>
  1274. <?php
  1275. }
  1276. /**
  1277. * This method renders a nice status overview table from the content element files
  1278. *
  1279. * @param unknown_type $contentelements
  1280. */
  1281. function renderOriginalStatusTable($originalStatus, $message='', $langCodes=null) {
  1282. $htmlOutput = '';
  1283. $htmlOutput = '<table cellpadding="4" cellspacing="0" border="0" width="100%" class="adminlist">';
  1284. $htmlOutput .= '<tr><th>' .JText::_('Content'). '</th><th>' .JText::_('table exist'). '</th><th>' .JText::_('original total'). '</th><th>' .JText::_('Orphans'). '</th>';
  1285. if(is_array($langCodes)) {
  1286. foreach ($langCodes as $code) {
  1287. $htmlOutput .= '<th>' .$code. '</th>';
  1288. }
  1289. }
  1290. $htmlOutput .= '</tr>';
  1291. $ceName = '';
  1292. foreach ($originalStatus as $statusRow ) {
  1293. $href = 'index2.php?option=com_joomfish&amp;task=overview&amp;act=translate&amp;catid='.$statusRow['catid'];
  1294. $htmlOutput .= '<tr>';
  1295. $htmlOutput .= '<td><a href="' .$href. '" target="_blank">' .$statusRow['name']. '</a></td>';
  1296. $htmlOutput .= '<td style="text-align: center;">' .($statusRow['missing_table'] ? JText::_('missing') : JText::_('valid')). '</td>';
  1297. $htmlOutput .= '<td style="text-align: center;">' .$statusRow['total']. '</td>';
  1298. $htmlOutput .= '<td style="text-align: center;">' .$statusRow['orphans']. '</td>';
  1299. if(is_array($langCodes)) {
  1300. foreach ($langCodes as $code) {
  1301. if( array_key_exists('langentry_' .$code, $statusRow)) {
  1302. $persentage = intval( ($statusRow['langentry_' .$code]*100) / $statusRow['total'] );
  1303. $htmlOutput .= '<td>' .$persentage. '%</td>';
  1304. } else {
  1305. $htmlOutput .= '<td>&nbsp;</td>';
  1306. }
  1307. }
  1308. }
  1309. $htmlOutput .= '</tr>';
  1310. }
  1311. if($message!='') {
  1312. $htmlOutput .= '<tr><td colspan="5" class="message">' .$message. '</td></tr>';
  1313. }
  1314. $htmlOutput .= '</table>';
  1315. return $htmlOutput;
  1316. }
  1317. /**
  1318. * Status table for translation checks
  1319. *
  1320. * @param array $translationStatus
  1321. * @return unknown
  1322. */
  1323. function renderTranslationStatusTable($translationStatus, $message='') {
  1324. $htmlOutput = '';
  1325. $htmlOutput .= '<table cellpadding="4" cellspacing="0" border="0" width="100%" class="adminlist">';
  1326. $htmlOutput .= '<tr><th>' .JText::_('Content'). '</th><th>' .JText::_('language'). '</th><th>' .JText::_('translation total'). '</th><th>' .JText::_('TITLE_PUBLISHED'). '</th><th>' .JText::_('valid'). '</th><th>' .JText::_('unvalid'). '</th></tr>';
  1327. foreach ($translationStatus as $statusRow ) {
  1328. $href = 'index2.php?option=com_joomfish&amp;task=overview&amp;act=translate&amp;catid='.$statusRow['catid'].'&amp;language_id='.$statusRow['language_id'];
  1329. $htmlOutput .= '<tr>';
  1330. $htmlOutput .= '<td><a href="'.$href.'" target="_blank">' .$statusRow['content']. '</a></td>';
  1331. $htmlOutput .= '<td>' .$statusRow['language']. '</td>';
  1332. $htmlOutput .= '<td style="text-align: center;">' .$statusRow['total']. '</td>';
  1333. $htmlOutput .= '<td style="text-align: center;">' .$statusRow['published']. '</td>';
  1334. $htmlOutput .= '<td style="text-align: center;">' .$statusRow['state_valid']. '</td>';
  1335. $htmlOutput .= '<td style="text-align: center;">' .$statusRow['state_unvalid']. '</td>';
  1336. $htmlOutput .= '</tr>';
  1337. }
  1338. if($message!='') {
  1339. $htmlOutput .= '<tr><td colspan="7" class="message">' .$message. '</td></tr>';
  1340. }
  1341. $htmlOutput .= '</table>';
  1342. return $htmlOutput;
  1343. }
  1344. /**
  1345. * This method renders the information page for the copy process
  1346. *
  1347. * @param unknown_type $contentelements
  1348. */
  1349. function renderCopyInformation($original2languageInfo, $message='', $langList=null) {
  1350. $htmlOutput = '';
  1351. if($message!='') {
  1352. $htmlOutput .= '<span class="message">' .$message. '</span><br />';
  1353. }
  1354. $htmlOutput .= '<table cellpadding="4" cellspacing="0" border="0" width="100%" class="adminlist">';
  1355. $htmlOutput .= '<tr><th width="25%">' .JText::_('Content'). '</th><th width="10%">' .JText::_('original total'). '</th><th width="10%">' .JText::_('processed'). '</th><th width="10%">' .JText::_('copied'). '</th><th>' .JText::_('copy to language'). '</th>';
  1356. $htmlOutput .= "</tr>\n";
  1357. $ceName = '';
  1358. foreach ($original2languageInfo as $statusRow ) {
  1359. $href = 'index2.php?option=com_joomfish&amp;task=overview&amp;act=translate&amp;catid='.$statusRow['catid'];
  1360. $htmlOutput .= '<tr>';
  1361. $htmlOutput .= '<td><a href="' .$href. '" target="_blank">' .$statusRow['name']. '</a></td>';
  1362. $htmlOutput .= '<td style="text-align: center;">' .$statusRow['total']. '</td>';
  1363. $htmlOutput .= '<td style="text-align: center;">' .$statusRow['processed']. '</td>';
  1364. $htmlOutput .= '<td style="text-align: center;">' .$statusRow['copied']. '</td>';
  1365. $htmlOutput .= '<td style="text-align: center;"><input name="copy_catid" type="checkbox" value="' .$statusRow['catid'].'" /></td>';
  1366. $htmlOutput .= "</tr>\n";
  1367. }
  1368. if($langList != null) {
  1369. $htmlOutput .= '<tr><td>' .JText::_('select language'). '</td>';
  1370. $htmlOutput .= '<td style="text-align: center;" colspan="3" nowrap="nowrap">' .$langList. '<input id="confirm_overwrite" name="confirm_overwrite" type="checkbox" value="1" />' .JText::_('overwrite existing translations'). '&nbsp;';
  1371. $htmlOutput .= '<input id="copy_original" name="copy_original" type="button" value="' .JText::_('copy'). '" onClick="executeCopyOriginal(document.getElementById(\'select_language\'), document.getElementById(\'confirm_overwrite\'), document.getElementsByName(\'copy_catid\'))" /></td>';
  1372. $htmlOutput .= "</tr>\n";
  1373. }
  1374. $htmlOutput .= '</table>';
  1375. return $htmlOutput;
  1376. }
  1377. /**
  1378. * This method renders the information page for the copy process
  1379. *
  1380. * @param unknown_type $contentelements
  1381. */
  1382. function renderCopyProcess($original2languageInfo, $message='') {
  1383. $htmlOutput = '';
  1384. $htmlOutput = '<table cellpadding="4" cellspacing="0" border="0" width="100%" class="adminlist">';
  1385. $htmlOutput .= '<tr><th>' .JText::_('Content'). '</th><th width="10%">' .JText::_('original total'). '</th><th width="10%">' .JText::_('processed'). '</th><th width="10%">' .JText::_('copied'). '</th>';
  1386. $htmlOutput .= '</tr>';
  1387. $ceName = '';
  1388. foreach ($original2languageInfo as $statusRow ) {
  1389. $href = 'index2.php?option=com_joomfish&amp;task=overview&amp;act=translate&amp;catid='.$statusRow['catid'];
  1390. $htmlOutput .= '<tr>';
  1391. $htmlOutput .= '<td><a href="' .$href. '" target="_blank">' .$statusRow['name']. '</a></td>';
  1392. $htmlOutput .= '<td style="text-align: center;">' .$statusRow['total']. '</td>';
  1393. $htmlOutput .= '<td style="text-align: center;">' .$statusRow['processed']. '</td>';
  1394. $htmlOutput .= '<td style="text-align: center;">' .$statusRow['copied']. '</td>';
  1395. $htmlOutput .= '</tr>';
  1396. }
  1397. if($message!='') {
  1398. $htmlOutput .= '<tr><td colspan="7" class="message">' .$message. '</td></tr>';
  1399. }
  1400. $htmlOutput .= '</table>';
  1401. return $htmlOutput;
  1402. }
  1403. /**
  1404. * @return void
  1405. * @param object $actContentObject
  1406. * @param array $langlist
  1407. * @param string $catid
  1408. * @desc Shows the dialog for the content translation
  1409. */
  1410. function showTranslation( $actContentObject, $langlist, $catid , $select_id , $tranFilters) {
  1411. global $my, $act, $task, $database, $option, $select_language_id, $mosConfig_live_site;
  1412. $elementTable = $actContentObject->getTable();
  1413. HTML_joomfish::_JoomlaHeader( JText::_('TITLE_TRANSLATION'), 'joomfish', '', false );
  1414. $editorFields=null;
  1415. foreach ($tranFilters as $filter) {
  1416. echo "<input type='hidden' name='".$filter->filterType."_filter_value' value='".$filter->filter_value."'/>";
  1417. }
  1418. // check system and user editor and load appropriate copying script
  1419. global $mosConfig_editor, $adminPath, $my;
  1420. // Per User Editor selection
  1421. $editorParams = new mosParameters( $my->params );
  1422. $editor = $editorParams->get( 'editor', '' );
  1423. if (!$editor) {
  1424. $editor = $mosConfig_editor;
  1425. }
  1426. echo "\n<!-- editor is $editor //-->\n";
  1427. $editorFile = $adminPath."/editors/".strtolower($editor).".php";
  1428. if (file_exists($editorFile)){
  1429. require_once($editorFile);
  1430. }
  1431. else {
  1432. ?>
  1433. <script language="javascript" type="text/javascript">
  1434. function copyToClipboard(value,action) {
  1435. try {
  1436. if (document.getElementById) {
  1437. innerHTML="";
  1438. if (action=="copy") {
  1439. srcEl = document.getElementById("original_value_"+value);
  1440. innerHTML = srcEl.innerHTML;
  1441. }
  1442. if (window.clipboardData){
  1443. window.clipboardData.setData("Text",innerHTML);
  1444. alert("<?php echo JText::_('CLIPBOARD_COPIED'); ?>");
  1445. }
  1446. else {
  1447. srcEl = document.getElementById("text_origText_"+value);
  1448. srcEl.value = innerHTML;
  1449. srcEl.select();
  1450. alert("<?php echo JText::_('CLIPBOARD_COPY');?>");
  1451. }
  1452. }
  1453. }
  1454. catch(e){
  1455. alert("<?php echo JText::_('CLIPBOARD_NOSUPPORT');?>");
  1456. }
  1457. }
  1458. </script>
  1459. <?php } ?>
  1460. <script language="javascript" type="text/javascript">
  1461. function confirmChangeLanguage(fromLang, fromIndex){
  1462. selections = document.getElementsByName("language_id")[0].options;
  1463. selection = document.getElementsByName("language_id")[0].selectedIndex;
  1464. //alert(selection+" from "+ fromIndex+" which is "+fromLang+" xx "+document.getElementsByName("language_id")[0].value);
  1465. var toLang = selections[selection].text;
  1466. var toValue = selection = document.getElementsByName("language_id")[0].value;
  1467. if (fromIndex!=toValue){
  1468. answer = confirm("<?php echo ereg_replace( '<br />', '\n', JText::_('JS_CHANGE_TRANSLATION_LANGUAGE')); ?>");
  1469. if (!answer) {
  1470. document.getElementsByName("language_id")[0].selectedIndex=fromIndex;
  1471. }
  1472. }
  1473. else {
  1474. alert("<?php echo ereg_replace( '<br />', '\n', JText::_('JS_REINSTATE_TRANSLATION_LANGUAGE')); ?>");
  1475. }
  1476. }
  1477. </script>
  1478. <table width="100%">
  1479. <tr>
  1480. <td>
  1481. <table width="90%" border="0" cellpadding="2" cellspacing="2" class="adminform">
  1482. <?php
  1483. $k=1;
  1484. for( $i=0; $i<count($elementTable->Fields); $i++ ) {
  1485. $field =& $elementTable->Fields[$i];
  1486. $originalValue = $field->originalValue;
  1487. if( $field->Translate ) {
  1488. $translationContent = $field->translationContent;
  1489. // This causes problems in Japanese/Russian etc.
  1490. mosMakeHtmlSafe( $translationContent );
  1491. ?>
  1492. <tr class="<?php echo "row$k"; ?>">
  1493. <th colspan="3"><?php echo JText::_('DBFIELDLABLE') .': '. $field->Lable;?></th>
  1494. </tr>
  1495. <?php
  1496. if (strtolower($field->Type)!='params'){
  1497. ?>
  1498. <tr class="<?php echo "row$k"; ?>">
  1499. <td align="left" valign="top"><JText>ORIGINAL</JText></td>
  1500. <td align="left" valign="top" id="original_value_<?php echo $field->Name?>">
  1501. <?php
  1502. echo $field->originalValue;
  1503. ?>
  1504. </td>
  1505. <td valign="top">
  1506. <input type="hidden" name="origValue_<?php echo $field->Name;?>" value='<?php echo md5( $field->originalValue );?>' />
  1507. <?php if( strtolower($field->Type)!='htmltext' ) {?>
  1508. <input type="hidden" name="origText_<?php echo $field->Name;?>" value='<?php echo $field->originalValue;?>' />
  1509. <a class="toolbar" onclick="document.adminForm.refField_<?php echo $field->Name;?>.value = document.adminForm.origText_<?php echo $field->Name;?>.value;" onmouseout="MM_swapImgRestore();" onmouseover="MM_swapImage('copy_<?php echo $field->Name;?>','','images/copy_f2.png',1);"><img src="images/copy.png" alt="<?php echo JText::_('copy');?>" border="0" name="copy_<?php echo $field->Name;?>" align="middle" /></a>
  1510. <?php } else { ?>
  1511. <input type="text" id="text_origText_<?php echo $field->Name;?>" value='' style="position:absolute;left:-999px;top:-999px"/>
  1512. <a class="toolbar" onclick="copyToClipboard('<?php echo $field->Name;?>','copy');" onmouseout="MM_swapImgRestore();" onmouseover="MM_swapImage('copy_<?php echo $field->Name;?>','','images/copy_f2.png',1);"><img src="images/copy.png" alt="<?php echo JText::_('copy');?>" border="0" name="copy_<?php echo $field->Name;?>" align="middle" /></a>
  1513. <?php }?>
  1514. </td>
  1515. </tr>
  1516. <tr class="<?php echo "row$k"; ?>">
  1517. <td align="left" valign="top"><JText>Translation</JText></td>
  1518. <td align="left" valign="top">
  1519. <input type="hidden" name="id_<?php echo $field->Name;?>" value="<?php echo $translationContent->id;?>" />
  1520. <?php
  1521. if( strtolower($field->Type)=='text' || strtolower($field->Type)=='titletext' ) {
  1522. $length = ($field->Length>0)?$field->Length:60;
  1523. $maxLength = ($field->MaxLength>0)?$field->MaxLength:60;
  1524. ?>
  1525. <input class="inputbox" type="text" name="refField_<?php echo $field->Name;?>" size="<?php echo $length;?>" value="<?php echo $translationContent->value; ?>" maxlength="<?php echo $maxLength;?>"/>
  1526. <?php
  1527. } else if( strtolower($field->Type)=='textarea' ) {
  1528. $ta_rows = ($field->Rows>0)?$field->Rows:15;
  1529. $ta_cols = ($field->Columns>0)?$field->Columns:30;
  1530. ?>
  1531. <textarea name="refField_<?php echo $field->Name;?>" rows="<?php echo $ta_rows;?>" cols="<?php echo $ta_cols;?>" ><?php echo $translationContent->value; ?></textarea>
  1532. <?php
  1533. } else if( strtolower($field->Type)=='htmltext' ) {
  1534. ?>
  1535. <?php
  1536. $editorFields[] = array( "editor_".$field->Name, "refField_".$field->Name );
  1537. // parameters : areaname, content, hidden field, width, height, rows, cols
  1538. editorArea( "editor_".$field->Name, $translationContent->value , "refField_".$field->Name, '100%;', '300', '70', '15' ) ;
  1539. }
  1540. ?>
  1541. </td>
  1542. <td valign="top">
  1543. <?php if( strtolower($field->Type)!='htmltext' ) {?>
  1544. <a class="toolbar" onclick="document.adminForm.refField_<?php echo $field->Name;?>.value = '';" onmouseout="MM_swapImgRestore();" onmouseover="MM_swapImage('clear_<?php echo $field->Name;?>','','images/delete_f2.png',1);"><img src="images/delete.png" alt="<?php echo JText::_('clear');?>" border="0" name="clear_<?php echo $field->Name;?>" align="middle" /></a>
  1545. <?php } else {?>
  1546. <!-- ToDo
  1547. <a class="toolbar" onclick="editor_setHTML('refField_<?php echo $field->Name;?>', ''); document.adminForm.refField_<?php echo $field->Name;?>.value = '';" onmouseout="MM_swapImgRestore();" onmouseover="MM_swapImage('clear_<?php echo $field->Name;?>','','images/delete_f2.png',1);"><img src="images/delete.png" alt="<?php echo JText::_('clear');?>" border="0" name="clear_<?php echo $field->Name;?>" align="middle" /></a>
  1548. -->
  1549. <a class="toolbar" onclick="copyToClipboard('<?php echo $field->Name;?>','clear');" onmouseout="MM_swapImgRestore();" onmouseover="MM_swapImage('clear_<?php echo $field->Name;?>','','images/delete_f2.png',1);"><img src="images/delete.png" alt="<?php echo JText::_('clear');?>" border="0" name="clear_<?php echo $field->Name;?>" align="middle" /></a>
  1550. <?php }?>
  1551. </td>
  1552. </tr>
  1553. <?php
  1554. }
  1555. else {
  1556. ?>
  1557. <tr class="<?php echo "row$k"; ?>">
  1558. <td colspan="3">
  1559. <table class='translateparams'>
  1560. <tr>
  1561. <td valign="top" style="text-align:center!important"><JText>ORIGINAL</JText></td>
  1562. <td valign="top" style="text-align:center!important"><JText>Translation</JText></td>
  1563. <td valign="top" align="right">
  1564. <input type="hidden" name="origValue_<?php echo $field->Name;?>" value='<?php echo md5( $field->originalValue );?>' />
  1565. <input type="hidden" name="origText_<?php echo $field->Name;?>" value='<?php echo $field->originalValue;?>' />
  1566. <a class="toolbar" onclick="copyParams('orig', '<?php echo $field->Name;?>');" onmouseout="MM_swapImgRestore();" onmouseover="MM_swapImage('copy_<?php echo $field->Name;?>','','images/copy_f2.png',1);">
  1567. <img src="images/copy.png" alt="<?php echo JText::_('copy');?>" border="0" name="copy_<?php echo $field->Name;?>" align="middle" />
  1568. </a>
  1569. <a class="toolbar" onclick="copyParams('defaultvalue', '<?php echo $field->Name;?>');" onmouseout="MM_swapImgRestore();" onmouseover="MM_swapImage('clear_<?php echo $field->Name;?>','','images/delete_f2.png',1);">
  1570. <img src="images/delete.png" alt="<?php echo JText::_('clear');?>" border="0" name="clear_<?php echo $field->Name;?>" align="middle" />
  1571. </a>
  1572. </td>
  1573. </tr>
  1574. <tr>
  1575. <td align="left" valign="top" class="origparams" id="original_value_<?php echo $field->Name?>">
  1576. <?php
  1577. $tpclass = "TranslateParams_".$elementTable->Name;
  1578. if (!class_exists($tpclass)){
  1579. $tpclass = "TranslateParams";
  1580. }
  1581. $transparams = new $tpclass($field->originalValue,$translationContent->value, $field->Name,$elementTable->Fields);
  1582. $transparams->showOriginal();
  1583. $transparams->showDefault();
  1584. ?>
  1585. </td>
  1586. <td align="left" valign="top" class="translateparams">
  1587. <input type="hidden" name="id_<?php echo $field->Name;?>" value="<?php echo $translationContent->id;?>" />
  1588. <?php
  1589. $retval = $transparams->editTranslation();
  1590. if ($retval){
  1591. $editorFields[] = $retval;
  1592. }
  1593. ?>
  1594. </td>
  1595. </tr>
  1596. </table>
  1597. </td>
  1598. </tr>
  1599. <?php
  1600. }
  1601. ?>
  1602. <?php
  1603. }
  1604. $k=1-$k;
  1605. }
  1606. ?>
  1607. </table>
  1608. </td>
  1609. <td valign="top" width="30%">
  1610. <?php
  1611. $tabs = new mosTabs(0);
  1612. $tabs->startPane("translation");
  1613. $tabs->startTab(JText::_('PUBLISHING'),"ItemInfo-page");
  1614. ?>
  1615. <table width="100%" border="0" cellpadding="4" cellspacing="2" class="adminForm">
  1616. <tr>
  1617. <td width="34%"><strong><JText>TITLE_STATE</JText>:</strong></td>
  1618. <td width="50%"><?php echo $actContentObject->state > 0 ? JText::_('STATE_OK') : ($actContentObject->state < 0 ? JText::_('STATE_NOTEXISTING') : JText::_('STATE_CHANGED'));?></td>
  1619. </tr>
  1620. <tr>
  1621. <td><strong><?php echo JText::_('LANGUAGE');?>:</strong></td>
  1622. <td><?php echo $langlist;?></td>
  1623. </tr>
  1624. <tr>
  1625. <td><strong><?php echo JText::_('TITLE_PUBLISHED')?>:</strong></td>
  1626. <td><input type="checkbox" name="published" value="1" <?php echo $actContentObject->published&0x0001 ? 'checked="checked"' : ''; ?> /></td>
  1627. </tr>
  1628. <tr>
  1629. <td><strong><?php echo JText::_('TITLE_DATECHANGED');?>:</strong></td>
  1630. <td><?php echo $actContentObject->lastchanged ? strftime("%A, %d %B %Y %H:%M",strtotime($actContentObject->lastchanged)) : JText::_('new');?></td>
  1631. </tr>
  1632. </table>
  1633. <?php
  1634. $tabs->endTab();
  1635. $tabs->endPane();
  1636. ?>
  1637. <input type="hidden" name="select_language_id" value="<?php echo $select_language_id;?>" />
  1638. <input type="hidden" name="reference_id" value="<?php echo $actContentObject->id;?>" />
  1639. <input type="hidden" name="reference_table" value="<?php echo (isset($elementTable->name) ? $elementTable->name : '');?>" />
  1640. <input type="hidden" name="catid" value="<?php echo $catid;?>" />
  1641. </td></tr>
  1642. <?php
  1643. HTML_joomfish::_JoomlaFooter($task, $act, $editorFields);
  1644. }
  1645. /**
  1646. * show and edit the config value translation page
  1647. *
  1648. * @param unknown_type $itemsToTranslate
  1649. * @param unknown_type $language
  1650. */
  1651. function translateConfig( $itemsToTranslate, $language ){
  1652. global $my, $act, $task, $database, $option, $select_language_id, $mosConfig_live_site;
  1653. HTML_joomfish::_JoomlaHeader(JText::_("Translate Configuration : ").$language->name);
  1654. $langParams = new mosParameters( $language->params );
  1655. ?>
  1656. <input type="hidden" name="lang" value="<?php echo $language->id;?>" />
  1657. <table width="100%" border="1" cellpadding="4" cellspacing="2" class="adminlist">
  1658. <tr>
  1659. <th width="20%"><JText>Config Field</JText></th>
  1660. <th ><JText>Original</JText></th>
  1661. <th ><JText>Translation</JText></th>
  1662. </tr>
  1663. <?php
  1664. $k=0;
  1665. foreach ($itemsToTranslate as $item=>$type) {
  1666. echo "<tr class='row$k'>";
  1667. echo "<td><JText>Translate_".$item."</JText></td>";
  1668. echo "<td>".$GLOBALS["mosConfig_".$item]."</td>";
  1669. switch ($type) {
  1670. case "text":
  1671. echo "<td><input class='inputbox' type='text' name='transConf$item' size='80' value='". $langParams->get($item,"")."'></td>";
  1672. break;
  1673. case 'textarea':
  1674. echo "<td><textarea class='text_area' name='transConf$item' cols='55' rows='4'>". $langParams->get($item,"")."</textarea></td>";
  1675. break;
  1676. default:
  1677. echo "<td>$type : ".JText::_("Not yet supported")."</td>";
  1678. break;
  1679. }
  1680. echo "<tr/>\n";
  1681. $k=($k+1)%2;
  1682. }
  1683. ?>
  1684. </table>
  1685. <?php
  1686. HTML_joomfish::_JoomlaFooter('save',$act, $option);
  1687. }
  1688. /**
  1689. * show the Orphan translations
  1690. *
  1691. * @param array $rows
  1692. * @param array $catid category id's
  1693. */
  1694. function showOrphan($rows, $catid)
  1695. {
  1696. global $my, $act, $task, $database, $option, $select_language_id, $mosConfig_live_site;
  1697. HTML_joomfish::_JoomlaHeader("Orphan Detail");
  1698. ?>
  1699. <input type="hidden" name="cid[]" value="<?php echo $rows[0]->id."|".$rows[0]->reference_id."|".$rows[0]->language_id; ?>"/>
  1700. <input type="hidden" name="catid" value="<?php echo $catid;?>" />
  1701. <table width="100%" border="1" cellpadding="4" cellspacing="2" class="adminForm">
  1702. <tr align="center" valign="middle">
  1703. <th width="10%" align="left" valign="top"><JText>DBFIELDLABLE</JText></th>
  1704. <th width="12%" align="left" valign="top"><JText>Original</JText></th>
  1705. <th width="78%" align="left" valign="top"><JText>Translation</JText></th>
  1706. </tr>
  1707. <?php
  1708. $style1="style='background-color:rgb(241,243,245)'";
  1709. $style2="style='background-color:rgb(255,228,196)'";
  1710. $style=$style1;
  1711. ?>
  1712. <tr align="center" valign="middle" <?php echo $style; ?>>
  1713. <td align="left" valign="top"><?php echo "Debug Info";?></td>
  1714. <td colspan="2" align="left" valign="top"><?php echo "Original Table:<b>".$rows[0]->reference_table."</b> === Orginal Id: <b>".$rows[0]->reference_id."</b>";?></td>
  1715. </tr>
  1716. <?php
  1717. foreach ($rows as $row) {
  1718. $style=$style==$style1?$style2:$style1;
  1719. ?>
  1720. <tr align="center" valign="middle" <?php echo $style; ?>>
  1721. <td align="left" valign="top"><?php echo $row->reference_field;?></td>
  1722. <td align="left" valign="top"><?php echo $row->original_value;?></td>
  1723. <td align="left" valign="top"><?php echo $row->value;?></td>
  1724. </tr>
  1725. <?php
  1726. }
  1727. ?>
  1728. </table>
  1729. <?php
  1730. HTML_joomfish::_JoomlaFooter('show', $act, $option);
  1731. }
  1732. /**
  1733. * Show the upgrade dialog
  1734. *
  1735. */
  1736. function showUpgradeInstall( $joomFishManager, $upgradeSucessful, $upgradeDone, $lists ) {
  1737. global $act, $task, $option, $mosConfig_live_site;
  1738. HTML_joomfish::_JoomlaHeader( JText::_('UPGRADE INSTALLATION'), 'upgrade' );
  1739. if( !$upgradeSucessful && !$upgradeDone ) {
  1740. ?>
  1741. <tr>
  1742. <td width="30%" align="left" valign="top">&nbsp;</td>
  1743. <td align="left" valign="top"><JText>UPGRADE_INFO</JText></td>
  1744. </tr>
  1745. <tr>
  1746. <td width="30%" align="left" valign="top"><strong><JText>UPGRADE_DELETE_TABLES</JText></strong></td>
  1747. <td><?php echo mosHTML::yesnoRadioList( 'confirmDelete', '', $lists['confirmDelete'] );?></td>
  1748. <tr>
  1749. <tr><td colspan="2">&nbsp;</td></tr>
  1750. <tr>
  1751. <td width="30%" align="left" valign="top"><strong><JText>UPGRADE_BACKUP_TABLES</JText></strong></td>
  1752. <td><?php echo mosHTML::yesnoRadioList( 'backupTables', '', $lists['backupTables'] );?></td>
  1753. <tr>
  1754. <tr>
  1755. <td width="30%" align="left" valign="top"><strong><JText>UPGRADE_RENAME_TABLES</JText></strong></td>
  1756. <td><?php echo mosHTML::yesnoRadioList( 'renameTables', '', $lists['renameTables'] );?></td>
  1757. <tr>
  1758. <?php
  1759. } else {
  1760. $summary = $lists['summary'];
  1761. ?>
  1762. <tr>
  1763. <th>&nbsp;</th>
  1764. <th colspan="2"><JText>TITLE_STATE</JText></th>
  1765. </tr>
  1766. <tr>
  1767. <td width="30%"><JText>TITLE_STATE</JText>:</td>
  1768. <td width="30%"><?php echo ($summary['state'] ? JText::_('UPGRADE_SUCCESSFUL') : JText::_('UPGRADE_FAILURE') );?></td>
  1769. <td><?php if( key_exists( 'message', $summary ) ) echo $summary['message'];?></td>
  1770. </tr>
  1771. <tr>
  1772. <td><JText>MBFBOT</JText>:</td>
  1773. <td><?php echo ($summary['mbf_bot_unpublished'] ? JText::_('MBF_UNPUBLISHED') : JText::_('MBF_NOTUNPUBLISHED') );?></td>
  1774. <td>
  1775. <?php echo ($summary['mbf_bot_unpublished'] ? '' : $summary['mbf_bot_unpublished_error']);?>
  1776. </td>
  1777. </tr>
  1778. <tr>
  1779. <td><JText>MBFMODULE</JText>:</td>
  1780. <td><?php echo ($summary['mbf_module_unpublished'] ? JText::_('MBF_UNPUBLISHED') : JText::_('MBF_NOTUNPUBLISHED') );?></td>
  1781. <td>
  1782. <?php echo ($summary['mbf_module_unpublished'] ? '' : $summary['mbf_module_unpublished_error']);?>
  1783. </td>
  1784. </tr>
  1785. <tr><td>&nbsp;</tr>
  1786. <?php if( $lists['backupTables'] ) { ?>
  1787. <tr>
  1788. <td><JText>CONTENT_BACKUP</JText>:</td>
  1789. <td>
  1790. <?php echo ($summary['jf_content_backup'] ? JText::_('BAK_CONTENT_SUCESSFUL') : JText::_('BAK_CONTENT_FAILURE') );?><br />
  1791. <?php echo ($summary['jf_languages_backup'] ? JText::_('BAK_LANGUAGES_SUCESSFUL') : JText::_('_BAK_LANGUAGES_FAILURE') );?>
  1792. </td>
  1793. <td>
  1794. <?php echo ($summary['jf_content_backup'] ? '' : $summary['jf_languages_backup_error']);?>
  1795. <?php echo ($summary['jf_languages_backup'] ? '' : $summary['jf_languages_backup_error']);?>
  1796. </td>
  1797. </tr>
  1798. <tr><td>&nbsp;</tr>
  1799. <?php } ?>
  1800. <tr>
  1801. <td><JText>CONTENT_TABLES</JText>:</td>
  1802. <td>
  1803. <?php echo ($summary['jf_content_deleted'] ? JText::_('DEL_SUCESSFUL') : JText::_('DEL_FAILURE') );?><br />
  1804. <?php echo ($summary['jf_content_copied'] ? JText::_('COPY_SUCESSFUL') : JText::_('COPY_FAILURE') );?>
  1805. </td>
  1806. <td>
  1807. <?php echo ($summary['jf_content_deleted'] ? '' : $summary['jf_content_deleted_error']);?>
  1808. <?php echo ($summary['jf_content_copied'] ? '' : $summary['jf_content_copied_error']);?>
  1809. </td>
  1810. </tr>
  1811. <tr>
  1812. <td><JText>LANGUAGE_TABLES</JText>:</td>
  1813. <td>
  1814. <?php echo ($summary['jf_languages_deleted'] ? JText::_('DEL_SUCESSFUL') : JText::_('DEL_FAILURE') );?><br />
  1815. <?php echo ($summary['jf_languages_copied'] ? JText::_('COPY_SUCESSFUL') : JText::_('COPY_FAILURE') );?>
  1816. </td>
  1817. <td>
  1818. <?php echo ($summary['jf_languages_deleted'] ? '' : $summary['jf_languages_deleted_error']);?>
  1819. <?php echo ($summary['jf_languages_copied'] ? '' : $summary['jf_languages_copied_error']);?>
  1820. </td>
  1821. </tr>
  1822. <?php
  1823. }
  1824. HTML_joomfish::_JoomlaFooter( 'show', $act, $option );
  1825. }
  1826. function showInformation( $fileCode='TN' ) {
  1827. global $act, $task, $option, $mosConfig_live_site;
  1828. HTML_joomfish::_JoomlaHeader( 'Joom!Fish documentation', 'credits', '' );
  1829. ?>
  1830. <tr align="center" valign="middle">
  1831. <td align="left" valign="top" width="70%">
  1832. <h2>PREAMBLE</h2>
  1833. The JoomFish is an extention for the open source CMS Joomla!.<br />
  1834. Joomla! is Copyright (C) 2005 Open Source Matters. All rights reserved.<br />
  1835. license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php<br />
  1836. Joomla! is free software. This version may have been modified pursuant<br />
  1837. to the GNU General Public License, and as distributed it includes or<br />
  1838. is derivative of works licensed under the GNU General Public License or<br />
  1839. other free or open source software licenses.<br />
  1840. See /COPYRIGHT.php for copyright notices and details.<br />
  1841. &nbsp;<br />
  1842. Within this license the "product" refers to the name "Joom!Fish" or "Mambel Fish".<br />
  1843. Also the term "Joom!Fish - Joomla! Babel Fish" must not be used by any derived software.
  1844. <?php
  1845. switch ( $fileCode ) {
  1846. case "changelog":
  1847. ?>
  1848. <h2>Changelog</h2>
  1849. <?php
  1850. echo nl2br(file_get_contents(dirname( __FILE__) ."/documentation/CHANGELOG.php"));
  1851. break;
  1852. case "license":
  1853. ?>
  1854. <h2>Think Network Open Source License</h2>
  1855. <?php
  1856. echo nl2br(file_get_contents(dirname( __FILE__) ."/documentation/LICENSE.php"));
  1857. break;
  1858. case "readme":
  1859. default:
  1860. ?>
  1861. <h2>Read ME</h2>
  1862. <?php
  1863. echo nl2br(file_get_contents(dirname( __FILE__) ."/documentation/ReadMe.php"));
  1864. break;
  1865. }
  1866. ?>
  1867. </td>
  1868. <td align="left" valign="top" nowrap>
  1869. <?php HTML_joomfish::_sideMenu();?>
  1870. <?php HTML_joomfish::_creditsCopyright(); ?>
  1871. </td>
  1872. </tr>
  1873. <?php
  1874. HTML_joomfish::_footer($task, $option);
  1875. }
  1876. /**
  1877. * Show the side menu
  1878. *
  1879. */
  1880. function _sideMenu() {
  1881. global $mosConfig_live_site;
  1882. ?>
  1883. <img src="<?php echo $mosConfig_live_site;?>/administrator/components/com_joomfish/images/joomfish_slogan.png" border="0" alt="<?php echo JText::_('Language Title');?>" />
  1884. <p><span class="contentheading"><JText>Related topics</JText>:</span>
  1885. <ul>
  1886. <li><a href="http://www.joomfish.net" target="_blank"><JText>Official Project WebSite</JText></a></li>
  1887. <li><a href="http://www.joomfish.net/forum/" target="_blank"><JText>Official Project Forum</JText></a></li>
  1888. <li><a href="http://joomlacode.org/gf/project/joomfish/tracker/" target="_blank"><JText>Bug and Feature tracker</JText></a></li>
  1889. </ul>
  1890. </p>
  1891. <p><span class="contentheading"><JText>Documentation and Tutorials</JText>:</span>
  1892. <ul>
  1893. <li><a href="http://www.joomfish.net/joomfish-documentation-overview.html" target="_blank"><JText>Online Documentation and Tutorials</JText></a></li>
  1894. <li><a href="index2.php?option=com_joomfish&amp;task=postInstall"><JText>Installation notes</JText></a></li>
  1895. <li><a href="index2.php?option=com_joomfish&amp;task=showInformation&amp;fileCode=changelog"><JText>Changelog</JText></a></li>
  1896. </ul>
  1897. </p>
  1898. <p><span class="contentheading"><JText>License</JText>:</span>
  1899. <ul>
  1900. <li><a href="index2.php?option=com_joomfish&amp;task=showInformation&amp;fileCode=license">GPL based Think Network Open Source license</a></li>
  1901. </ul>
  1902. </p>
  1903. <p><span class="contentheading"><JText>Additional Sites</JText>:</span>
  1904. <ul>
  1905. <li><a href="http://www.joomla.org" target="_blank">Joomla!</a></li>
  1906. </ul>
  1907. </p>
  1908. <?php
  1909. }
  1910. function _header() {
  1911. HTML_joomfish::_pageHeader();
  1912. ?>
  1913. <script language="javascript" type="text/javascript">
  1914. /* <![CDATA[ */
  1915. function submitbutton(pressbutton) {
  1916. var form = document.adminForm;
  1917. if (pressbutton == 'cancel') {
  1918. submitform( pressbutton );
  1919. return;
  1920. } else {
  1921. submitform( pressbutton );
  1922. }
  1923. }
  1924. /* ]]> */
  1925. </script>
  1926. <div id="joomfish">
  1927. <form action="index2.php" method="post" name="adminForm">
  1928. <table width="90%" border="0" cellpadding="2" cellspacing="2" class="adminheading">
  1929. <tr><th width="100%" align="left" colspan="2">
  1930. <JText>JOOMFISH_HEADER</JText>
  1931. </th></tr>
  1932. </table>
  1933. <table width="90%" border="0" cellpadding="2" cellspacing="2" class="adminform">
  1934. <?php
  1935. }
  1936. function _footer($task, $option) {
  1937. ?>
  1938. </tr>
  1939. </table>
  1940. <input type="hidden" name="task" value="<?php echo $task; ?>" />
  1941. <input type="hidden" name="option" value="<?php echo $option; ?>" />
  1942. </form>
  1943. </div>
  1944. <?php
  1945. HTML_joomfish::_pageFooter();
  1946. }
  1947. /**
  1948. * The page header generates a general output handling for all admin pages
  1949. *
  1950. */ function _pageHeader(){
  1951. global $mainframe;
  1952. $cssHTML = '<link rel="stylesheet" href="' .$GLOBALS['mosConfig_live_site']. '/administrator/components/com_joomfish/css/joomfish.css" type="text/css" />' . "\n";
  1953. $mainframe->addCustomHeadTag( $cssHTML );
  1954. ob_start();
  1955. }
  1956. /**
  1957. * The page footer ensures a final translation of the content and outputs the page
  1958. *
  1959. */
  1960. function _pageFooter() {
  1961. $content = ob_get_contents();
  1962. ob_end_clean();
  1963. // define the regular expression for the translation
  1964. $regex = "|<JText>(.*?)</JText>|";
  1965. $content = preg_replace_callback($regex,"jfTranslate",$content);
  1966. echo $content;
  1967. }
  1968. function _JoomlaHeader( $title, $title_class='', $headingOptions= 'fish', $adminform = true ) {
  1969. HTML_joomfish::_pageHeader();
  1970. ?>
  1971. <div id="overDiv" style="position:absolute; visibility:hidden; z-index:10000;"></div>
  1972. <div id="joomfish">
  1973. <form action="index2.php" method="post" name="adminForm">
  1974. <?php HTML_joomfish::_JAdminHeading( $title, $title_class, $headingOptions );?>
  1975. <?php
  1976. if ( $adminform ) {
  1977. HTML_joomfish::_openAdminForm();
  1978. }
  1979. }
  1980. function _JAdminHeading( $title, $title_class, $headingOptions = 'fish' ) {
  1981. global $mosConfig_live_site;
  1982. ?>
  1983. <table width="90%" border="0" cellpadding="2" cellspacing="2" class="adminheading">
  1984. <tr>
  1985. <th width="100%" class="<?php echo $title_class;?>" align="left" colspan="2"><?php echo $title;?></th>
  1986. <?php if( $headingOptions == 'fish' ) { ?>
  1987. <td><img src="<?php echo $mosConfig_live_site;?>/administrator/components/com_joomfish/images/fishl.png" alt="" border="0" /></td>
  1988. <?php
  1989. } elseif ( $headingOptions != '' ) {
  1990. echo $headingOptions;
  1991. }
  1992. ?></tr>
  1993. </table>
  1994. <?php
  1995. }
  1996. function _openAdminForm() {
  1997. ?>
  1998. <table width="90%" border="0" cellpadding="2" cellspacing="2" class="adminform" >
  1999. <?php
  2000. }
  2001. function _JoomlaFooter($task, $act, $editorFields=null) {
  2002. global $mosConfig_live_site;
  2003. ?>
  2004. </table>
  2005. <input type="hidden" name="hidemainmenu" value="" />
  2006. <input type="hidden" name="boxchecked" value="0" />
  2007. <input type="hidden" name="task" value="<?php echo $task; ?>" />
  2008. <input type="hidden" name="act" value="<?php echo $act; ?>" />
  2009. <input type="hidden" name="option" value="com_joomfish" />
  2010. </form>
  2011. <script type="text/javascript" src="<?php echo $mosConfig_live_site;?>/includes/js/overlib_mini.js"></script>
  2012. <script language="javascript" type="text/javascript">
  2013. function submitbutton(pressbutton) {
  2014. var form = document.getElementsByName ('adminForm');
  2015. <?php
  2016. if( isset($editorFields) && is_array($editorFields) ) {
  2017. foreach ($editorFields as $editor) {
  2018. // Where editor[0] = your areaname and editor[1] = the field name
  2019. getEditorContents( $editor[0], $editor[1]) ;
  2020. }
  2021. }
  2022. ?>
  2023. if (pressbutton == 'cancel') {
  2024. submitform( pressbutton );
  2025. return;
  2026. } else {
  2027. submitform( pressbutton );
  2028. }
  2029. }
  2030. </script>
  2031. <table width="100%" border="0">
  2032. <tr>
  2033. <td width="99%" align="right" valign="top">
  2034. <?php
  2035. $x = "@";
  2036. $y="Support";
  2037. $z="JoomFish.net";
  2038. $mail=$y.$x.$z;
  2039. ?><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>
  2040. </td>
  2041. </tr>
  2042. </table>
  2043. </div>
  2044. <?php
  2045. HTML_joomfish::_pageFooter();
  2046. }
  2047. function _creditsCopyright() {
  2048. ?>
  2049. <p>
  2050. <span class="smallgrey"><strong>Credits:</strong></span><br />
  2051. <span class="smallgrey">To all the people of the JoomFish community!<br />
  2052. Present development team:
  2053. <ul>
  2054. <li>Alex Kempkens (<?php
  2055. $x = "@";
  2056. $y="Alex";
  2057. $z="JoomFish.net";
  2058. $mail=$y.$x.$z;
  2059. $mode=0;
  2060. echo mosHTML::emailCloaking( $mail, $mode );
  2061. ?>)</li>
  2062. <li>Geraint Edwards (<?php
  2063. $x = "@";
  2064. $y="joomfish.credits";
  2065. $z="copyn.plus.com";
  2066. $mail=$y.$x.$z;
  2067. $mode=0;
  2068. echo mosHTML::emailCloaking( $mail, $mode );
  2069. ?>)</li>
  2070. <li>Ivo Apostolov (<?php
  2071. $x = "@";
  2072. $y="ivo";
  2073. $z="joomfish.net";
  2074. $mail=$y.$x.$z;
  2075. $mode=0;
  2076. echo mosHTML::emailCloaking( $mail, $mode );
  2077. ?>)</li>
  2078. <li>Robin Muilwijk</li>
  2079. </ul>
  2080. <br />
  2081. Logo design by:
  2082. <ul>
  2083. <li>Tommy White (<?php
  2084. $x = "@";
  2085. $y="tommy";
  2086. $z="tommywhite.com";
  2087. $mail=$y.$x.$z;
  2088. $mode=0;
  2089. echo mosHTML::emailCloaking( $mail, $mode );
  2090. ?>)</li>
  2091. </ul>
  2092. &nbsp;<br />
  2093. Special thank's for testing, good suggestions & translations to:<br />
  2094. Bernhard, Michael, Luc, Olivier, Robin, Rune, Victor, Akarawuth</span><br />
  2095. &nbsp;<br />
  2096. <span class="smallgrey"><strong>Contact:</strong></span><br />
  2097. <?php
  2098. $x = "@";
  2099. $y="Support";
  2100. $z="JoomFish.net";
  2101. $mail=$y.$x.$z;
  2102. echo '<span class="smallgrey">' .mosHTML::emailCloaking( $mail, 1, $mail) .'</span>';
  2103. ?>
  2104. <br />
  2105. &nbsp;<br />
  2106. <span class="smallgrey"><strong>Version:</strong></span><br />
  2107. <span class="smallgrey"><?php echo JoomFishManager::getVersion();?></span><br />
  2108. &nbsp;<br />
  2109. <span class="smallgrey"><strong>Copyright:</strong></span><br />
  2110. <span class="smallgrey">&copy; 2003-2007 </span><a href="http://www.ThinkNetwork.com" target="_blank" class="smallgrey"><span class="smallgrey">Think Network, Munich</span></a><br />
  2111. <a href="index2.php?option=com_joomfish&amp;task=showInformation&amp;fileCode=license" class="smallgrey"><span class="smallgrey">Open Source License.</span></a>
  2112. </p>
  2113. <?php
  2114. }
  2115. /**
  2116. * This method creates a standard cpanel button
  2117. *
  2118. * @param unknown_type $link
  2119. * @param unknown_type $image
  2120. * @param unknown_type $text
  2121. */
  2122. function _quickiconButton( $link, $image, $text, $path='/administrator/images/', $target='', $onclick='' ) {
  2123. if( $target != '' ) {
  2124. $target = 'target="' .$target. '"';
  2125. }
  2126. if( $onclick != '' ) {
  2127. $onclick = 'onclick="' .$onclick. '"';
  2128. }
  2129. ?>
  2130. <div style="float:left;">
  2131. <div class="icon">
  2132. <a href="<?php echo $link; ?>" <?php echo $target;?> <?php echo $onclick;?>>
  2133. <?php echo mosAdminMenus::imageCheckAdmin( $image, $path, NULL, NULL, $text ); ?>
  2134. <span><?php echo $text; ?></span>
  2135. </a>
  2136. </div>
  2137. </div>
  2138. <?php
  2139. }
  2140. /**
  2141. * Method to truncate a original text to a certain length
  2142. * When the original is longer than the text '...' is added
  2143. * @param string original text
  2144. * @param int max text length
  2145. * @return string truncated text
  2146. */
  2147. function _truncateString($origText, $maxLength) {
  2148. $retString = '';
  2149. if(strlen($origText) > $maxLength) {
  2150. $retString = substr($origText, 0, $maxLength);
  2151. $retString .= ' ...';
  2152. } else {
  2153. $retString = $origText;
  2154. }
  2155. return $retString;
  2156. }
  2157. }
  2158. ?>