PageRenderTime 259ms CodeModel.GetById 21ms RepoModel.GetById 0ms app.codeStats 1ms

/administrator/components/com_jnewsletter/views/mailings.jnewsletter.html.php

https://github.com/viollarr/alab
PHP | 1573 lines | 1340 code | 173 blank | 60 comment | 136 complexity | 47d972d35d9e86aa5c5d825dffaa6f00 MD5 | raw file
Possible License(s): LGPL-2.1, GPL-2.0, AGPL-3.0, Apache-2.0, BSD-3-Clause, GPL-3.0

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

  1. <?php
  2. defined('_JEXEC') OR defined('_VALID_MOS') OR die('...Direct Access to this location is not allowed...');
  3. ### Copyright (C) 2006-2010 Joobi Limited. All rights reserved.
  4. ### http://www.ijoobi.com/index.php?option=com_content&view=article&id=12&Itemid=54
  5. class mailingsHTML {
  6. function previewMailingHTML($mailingId, $listId, $listType){
  7. ?>
  8. <script language="javascript" type="text/javascript">
  9. <!--
  10. function submitbutton(pressbutton) {
  11. var form = document.adminForm;
  12. if (pressbutton == 'cancel') {
  13. submitform( pressbutton );
  14. return;
  15. }
  16. submitform( pressbutton );
  17. }
  18. //-->
  19. </script>
  20. <span class="sectionname"><?php echo _ACA_PREVIEW_EMAIL_TEST; ?>:</span><br />
  21. <br />
  22. <form action="index2.php" method="POST" name="adminForm">
  23. <input type="hidden" name="option" value="com_jnewsletter" />
  24. <input type="hidden" name="listype" value="<?php echo $listType; ?>" />
  25. <input type="hidden" name="act" value="mailing" />
  26. <input type="hidden" name="task" value="" />
  27. <input type="hidden" name="boxchecked" value="0" />
  28. <input type="hidden" name="mailingid" value="<?php echo $mailingId; ?>" />
  29. <input type="hidden" name="listid" value="<?php echo $listId; ?>" />
  30. <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" class="contentpane">
  31. <tr>
  32. <td align="left"><?php echo _ACA_INPUT_NAME; ?></td>
  33. <td align="left"><input type="text" name="name" size=50 class="inputbox" value="<?php
  34. if ( ACA_CMSTYPE ) { // joomla 15
  35. $my =& JFactory::getUser();
  36. }else{
  37. global $my;
  38. }
  39. echo trim($my->name);
  40. ?>"/></td>
  41. </tr>
  42. <tr>
  43. <td align="left"><?php echo _ACA_INPUT_EMAIL; ?></td>
  44. <td align="left"><input type="text" name="emailaddress" class="inputbox" size=50 value="<?php
  45. echo trim($my->email);
  46. ?>"/></td>
  47. </tr>
  48. <tr>
  49. <td align="left" colspan="2"><?php echo _ACA_SEND_IN_HTML; ?>
  50. <input type="checkbox" value="1" name="html" class="inputbox" checked="checked" /></td>
  51. </tr>
  52. </table>
  53. </form>
  54. <br />
  55. <?php
  56. }
  57. function showMailingList($mailings, &$lists, $start, $limit, $total, $emailsearch, $listId, $listType, $forms, $show, $action, $setLimit=null) {
  58. global $Itemid;
  59. global $mainframe;
  60. if ( ACA_CMSTYPE ) { // joomla 15
  61. $my =& JFactory::getUser();
  62. $mainPath = ACA_PATH_ADMIN_IMAGES.'header/';
  63. $css = '.icon-48-newsletter { background-image:url('.$mainPath .'newsletter.png)}';
  64. $doc =& JFactory::getDocument();
  65. $doc->addStyleDeclaration($css, $type = 'text/css');
  66. $img = 'newsletter.png';
  67. }//endif
  68. $item = ( !empty($Itemid)) ? '&Itemid=' . $Itemid : '';
  69. $hidden = '<input type="hidden" name="listid" value="'.$listId.'" />';
  70. $hidden .= '<input type="hidden" name="act" value="'.$action.'" />';
  71. $hidden .= '<input type="hidden" name="limit" value="'.$limit.'" />';
  72. // echo jnewsletter::search($forms['select'], $hidden, $emailsearch, 'emailsearch', '', $lists['title'] );
  73. echo $forms['main'];
  74. // top portion before the table list
  75. // for search
  76. $toSearch = null;
  77. $toSearch->forms = $forms['select'];
  78. $toSearch->hidden = $hidden;
  79. $toSearch->listsearch = $emailsearch;
  80. $toSearch->id = 'emailsearch';
  81. echo jnewsletter::setTop($toSearch, $lists['title'], $setLimit );
  82. ?>
  83. <table class="joobilist">
  84. <thead>
  85. <tr>
  86. <th width="40" height="20" align="center" class="title"><center>#</center></th>
  87. <?php if ($show['select']) { ?>
  88. <th width="32" align="center" class="title">&nbsp;</th>
  89. <?php } if ($show['status']) { ?>
  90. <th width="40" class="title" align="center"><center><?php echo _ACA_PUBLISHED; ?></center></th>
  91. <?php } if ($show['delay']) { ?>
  92. <th width="80" class="title" align="center"><center><?php echo _ACA_LIST_DELAY; ?></center></th>
  93. <?php } if ($show['sentdate']) { ?>
  94. <th width="140" class="title"><?php if($mainframe->isAdmin()){echo _ACA_LIST_DATE; }else{ echo _ACA_LIST_DATE;} ?></th>
  95. <?php } if ($show['issue']) { ?>
  96. <th width="60" class="title"><?php echo _ACA_LIST_ISSUE; ?></th>
  97. <?php } ?>
  98. <th class="title" align="left"><?php echo _ACA_LIST_SUB; ?></th>
  99. <?php if($mainframe->isAdmin()){ if ($show['status']) { ?>
  100. <th width="40" class="title" align="center"><center><?php echo _ACA_VISIBLE; ?></center></th>
  101. <?php } } if ($show['id']) { ?>
  102. <th width="40" class="title"><center>ID</center></th>
  103. <?php } ?>
  104. </tr>
  105. </thead>
  106. <?php
  107. if (!empty($mailings)) {
  108. $i = 0;
  109. foreach ($mailings as $mailing) {
  110. ?>
  111. <tr class="row<?php echo ($i + 1) % 2;?>">
  112. <td height="20" align="center"><center><?php echo $i + 1 + $start; ?></center></td>
  113. <?php if ($show['select']) { ?>
  114. <td align="center"><input type="radio" id="cb<?php echo $i;?>" name="mailingid" value="<?php echo $mailing->id; ?>" onclick="isChecked(this.checked);" /></td>
  115. <?php
  116. }
  117. if ($show['status']) {
  118. switch ($mailing->published) {
  119. case '1':
  120. $img = '16/status_g.png';
  121. jnewsletter::getLegend( 'status_g.png', _ACA_VISIBLE .'/'. _ACA_TEMPLATE_PUBLISH );
  122. break;
  123. case '2':
  124. $img = '16/status_y.png';
  125. jnewsletter::getLegend( 'status_y.png', _ACA_SCHEDULED );
  126. break;
  127. default:
  128. $img = '16/status_r.png';
  129. jnewsletter::getLegend( 'status_r.png',_ACA_NOTVISIBLE .'/'. _ACA_UNPUBLISHED );
  130. break;
  131. }
  132. $publishStatus = ( !empty($mailing->published) && ( $mailing->published == 1 ) ) ? 'unpublishMailing' : 'publishMailing';
  133. ?>
  134. <td align="center"><center><a href="<?php echo jnewsletter::createToggleLink( 'mailing', $publishStatus, 'mailingid' , $mailing->id, 'togle' ); ?>"><img src="<?php echo ACA_PATH_ADMIN_IMAGES.$img; ?>" width="12" height="12" border="0" alt="" /></a></center></td>
  135. <?php } if ($show['delay']) {
  136. $delay = $mailing->delay / 1440;
  137. ?>
  138. <td align="center"><?php echo $delay; ?></td>
  139. <?php } if ($show['sentdate']) { ?>
  140. <td ><?php
  141. if($mailing->send_date==0){
  142. echo '0000-00-00 00:00:00';
  143. }else{
  144. echo date( 'Y-m-d H:i:s', $mailing->send_date);
  145. }
  146. //if( !empty($mailing->send_date) ) { echo date( 'Y-m-d H:i:s', $mailing->send_date); } else { echo ''; }
  147. ?></td>
  148. <?php } if ($show['issue']) { ?>
  149. <td align="center"><center><?php echo $mailing->issue_nb; ?></center></td>
  150. <?php }
  151. //if (!isset($mailing->list_id) or $mailing->list_id < 1) {$mailing->list_id = 0;}
  152. $backendLink = ($show['index'] == 'index') ? false : true;
  153. if ((!$show['admin']) OR ( $mailing->published == 1 AND ($mailing->mailing_type == 1 or $mailing->mailing_type == 7 or $mailing->mailing_type == 2))) {
  154. $link = 'index.php?option=com_jnewsletter&act=' . $action . '&task=view&listid='.$listId.'&mailingid=' .$mailing->id . '&listype=' .$mailing->mailing_type . $item ;
  155. } else {
  156. $link = '.php?option=com_jnewsletter&act=' . $action . '&task=edit&mailingid=' .$mailing->id . '&listid=' . $listId . '&listype=' .$mailing->mailing_type . $item;
  157. compa::completeLink($link,$backendLink);
  158. }
  159. ?>
  160. <td align="left"><a href="<?php echo $link; ?>" >
  161. <?php echo $mailing->subject; ?></a></td>
  162. <?php if($mainframe->isAdmin()){ if ($show['status']) {
  163. if ($mailing->visible == 1) {
  164. $img = '16/status_g.png';
  165. jnewsletter::getLegend( 'status_g.png', _ACA_VISIBLE .'/'. _ACA_TEMPLATE_PUBLISH );
  166. } else {
  167. $img = '16/status_r.png';
  168. jnewsletter::getLegend( 'status_r.png',_ACA_NOTVISIBLE .'/'. _ACA_UNPUBLISHED );
  169. }
  170. ?>
  171. <td align="center"><center>
  172. <a href="<?php echo jnewsletter::createToggleLink( 'mailing', 'visible', 'mailingid' , $mailing->id ); ?>"> <img src="<?php echo ACA_PATH_ADMIN_IMAGES.$img; ?>" width="12" height="12" border="0" alt="" /> </a>
  173. </center></td>
  174. <?php } } if ($show['id']) { ?>
  175. <td align="center"><center><?php echo $mailing->id; ?></center></td>
  176. <?php } ?>
  177. </tr>
  178. <?php
  179. $i++;
  180. }
  181. }
  182. ?>
  183. </table>
  184. <input type="hidden" name="act" value="<?php echo $action; ?>" />
  185. <input type="hidden" name="listid" value="<?php echo $listId; ?>" />
  186. <input type="hidden" name="listype" value="<?php echo $listType; ?>" />
  187. <?php
  188. echo '<br />';
  189. echo jnewsletter::setLegend();
  190. } //endfct
  191. function editMailing($mailingEdit, $new, $listId, $forms, $show) {
  192. $lists = array();
  193. $folders = array();
  194. if ( ACA_CMSTYPE ) {
  195. $my =& JFactory::getUser();
  196. $folders[] = JHTML::_('select.option', '/' );
  197. $lists['published'] = JHTML::_('select.booleanlist', 'published', 'class="inputbox"', $mailingEdit->published );
  198. $lists['visible'] = JHTML::_('select.booleanlist', 'visible', 'class="inputbox"', $mailingEdit->visible );
  199. }//endif
  200. $images = $mailingEdit->images;
  201. if (!isset($mailingEdit->list_id)) $mailingEdit->list_id = $listId;
  202. $pathA = ACA_JPATH_ROOT_NO_ADMIN .'/images/stories';
  203. $pathL = ACA_JPATH_LIVE .'/images/stories';
  204. $images = array();
  205. if( ACA_CMSTYPE ){
  206. mailingsHTML::ReadImages( $pathA, '/', $folders, $images );
  207. if ( !isset($images['/'] ) ) {
  208. $images['/'][] = JHTML::_('select.option', '' );
  209. }
  210. $javascript = "onchange=\"previewImage( 'imagefiles', 'view_imagefiles', '$pathL/' )\"";
  211. $lists['imagefiles'] = JHTML::_('select.genericlist', $images['/'], 'imagefiles', 'class="inputbox" size="10" multiple="multiple" '. $javascript , 'value', 'text', null );
  212. $javascript = "onchange=\"changeDynaList( 'imagefiles', folderimages, document.adminForm.folders.options[document.adminForm.folders.selectedIndex].value, 0, 0); previewImage( 'imagefiles', 'view_imagefiles', '$pathL/' );\"";
  213. $lists['folders'] = JHTML::_('select.genericlist', $folders, 'folders', 'class="inputbox" size="1" '. $javascript, 'value', 'text', '/' );
  214. $images2 = array();
  215. foreach( $mailingEdit->images as $file ) {
  216. $temp = explode( '|', $file );
  217. if( strrchr($temp[0], '/') ) {
  218. $filename = substr( strrchr($temp[0], '/' ), 1 );
  219. } else {
  220. $filename = $temp[0];
  221. }
  222. $images2[] = JHTML::_('select.option', $file, $filename );
  223. }
  224. //$javascript = "onchange=\"previewImage( 'imagelist', 'view_imagelist', '$path/' ); showImageProps( '$path/' ); \" onfocus=\"previewImage( 'imagelist', 'view_imagelist', '$path/' )\"";
  225. $javascript = "onchange=\"previewImage( 'imagelist', 'view_imagelist', '$pathL/' ); showImageProps( '$pathL/' ); \"";
  226. $lists['imagelist'] = JHTML::_('select.genericlist', $images2, 'imagelist', 'class="inputbox" size="10" '. $javascript, 'value', 'text' );
  227. $lists['_align'] = JHTML::_('list.positions', '_align' );
  228. $lists['_caption_align'] = JHTML::_('list.positions', '_caption_align' );
  229. }//endif
  230. if ( ACA_CMSTYPE ) { // joomla 15
  231. $pos[] = JHTML::_('select.option', 'bottom', _CMN_BOTTOM );
  232. $pos[] = JHTML::_('select.option', 'top', _CMN_TOP );
  233. $lists['_caption_position'] = JHTML::_('select.genericlist', $pos, '_caption_position', 'class="inputbox" size="1"', 'value', 'text' );
  234. }//endif
  235. backHTML::formStart('edit_mailing', $mailingEdit->html, $images);
  236. echo $forms['main'];
  237. // if ( $new AND $mailingEdit->mailing_type==7 )
  238. // if ( $new )
  239. // {
  240. // $mailingEdit->issue_nb=0;
  241. // }
  242. mailingsHTML::layout($mailingEdit, $lists, $show);
  243. //echo 'My mailing edit:'. $mailingEdit->next_date;
  244. ?>
  245. <input type="hidden" name="images" value="" />
  246. <input type="hidden" name="html" value="<?php echo $mailingEdit->html; ?>" />
  247. <input type="hidden" name="new_list" value="<?php echo $new; ?>" />
  248. <input type="hidden" name="listid" value="<?php echo $listId; ?>" />
  249. <input type="hidden" name="listype" value="<?php echo $mailingEdit->mailing_type; ?>" />
  250. <input type="hidden" name="mailingid" value="<?php echo $mailingEdit->id; ?>" />
  251. <input type="hidden" name="issue_nb" value="<?php echo $mailingEdit->issue_nb; ?>" />
  252. <input type="hidden" name="userid" value="<?php echo $my->id; ?>" />
  253. <?php
  254. }
  255. function lists($list) {
  256. // Gino : added listType
  257. $listType = JRequest::getVar( 'listype' );
  258. if( !isset( $mailingEdit->list_type ) )
  259. {
  260. $mySess =& JFactory::getSession();
  261. if( !empty($mySess) ) $mailingEdit->list_type = $mySess->get('listype', '', 'LType');
  262. } //endif
  263. $listType = ( !empty($listType) ) ? $listType : $mailingEdit->list_type;
  264. $typeList = ( !empty($listType) && ( $listType == 2 ) ) ? 2 : 1;
  265. ?>
  266. <div style="padding: 2px;"><span style="font-size: 12px;"><?php if( $typeList == 2 ) { echo _ACA_SUBS_LIST_CAMPAIGN; } else { echo _ACA_SUBS_LIST_LABEL; } ?></span></div>
  267. <table class="joobilist">
  268. <thead>
  269. <tr>
  270. <th class="title">
  271. #
  272. </th>
  273. <th class="title">
  274. <?php echo _ACA_LIST_NAME; ?>
  275. </th>
  276. <th class="title">
  277. <?php echo _ACA_SUBS_LIST_RECEIVE; ?>
  278. </th>
  279. </tr>
  280. </thead>
  281. <tbody>
  282. <?php
  283. //echo 'list type:'.$typeList;
  284. $lists = lists::getLists('', $typeList, '', '', false, true, false,false,false);
  285. $k = 0;
  286. $i = 0;
  287. foreach($lists as $list){
  288. ?>
  289. <tr class="<?php echo "row$k"; ?>">
  290. <td width="5%">
  291. <center>
  292. <?php
  293. echo $i+1;
  294. ?>
  295. </center>
  296. </td>
  297. <td>
  298. <?php
  299. // < Gino > : added this code
  300. $getMailingId = ( !empty($mailingEdit->id) ) ? $mailingEdit->id : JRequest::getVar( 'mailingid' );
  301. $result = xmailing::mailingListFound( $getMailingId, $list->id );
  302. $result = ( $result ) ? 1 : 0;
  303. // </ Gino >
  304. //function booleanlist( $name, $attribs = null, $selected = null, $yes='yes', $no='no', $id=false )
  305. $text = '<b>List ID: </b>'.$list->id;
  306. $text .= '<br/>'.str_replace(array("'",'"'),array("&#039;",'&quot;'),$list->list_desc);
  307. $title = str_replace(array("'",'"'),array("&#039;",'&quot;'),$list->list_name);
  308. //echo compa::toolTip( $tip, '', 280, 'tooltip.png', $title, '', 0 );
  309. echo JHTML::_('tooltip', $text, $title, 'tooltip.png', $title);
  310. ?>
  311. </td>
  312. <td width="100px" nowrap="nowrap">
  313. <center>
  314. <?php
  315. if ( ACA_CMSTYPE ) {
  316. echo JHTML::_('select.booleanlist', "aca[aca_mailing_addto][".$list->id."]" , 'class="inputbox"',$result,'Yes','No');
  317. }//endif
  318. ?>
  319. </center>
  320. </td>
  321. </tr>
  322. <?php
  323. $k = 1-$k;
  324. $i++;
  325. }
  326. if (count($lists>3)){
  327. ?>
  328. <tr>
  329. <td colspan="3" align="center" nowrap="nowrap">
  330. <script language="javascript" type="text/javascript">
  331. function updateStatus(statusval){
  332. <?php foreach($lists as $row){?>
  333. window.document.getElementById('aca[aca_mailing_addto][<?php echo $row->id; ?>]'+statusval).checked = true;
  334. <?php } ?>
  335. }
  336. </script>
  337. <div style="float:right; font-size: 12px;"><a title="Click to select all list" href="#" onclick="updateStatus(1);"><?php echo _ACA_SUBS_LIST_TOALL; ?></a> | <a href="#" onclick="updateStatus(0);"><?php echo _ACA_SUBS_LIST_TONONE; ?></a></div>
  338. </td>
  339. </tr>
  340. <?php } ?>
  341. </tbody>
  342. </table>
  343. <?php
  344. }
  345. function subject($mailingEdit, $lists, $show) {
  346. ?> <fieldset class="jnewslettercss">
  347. <table class="jnewslettertabletable" cellspacing="1" border="0">
  348. <tbody>
  349. <tr>
  350. <td width="110px" class="key">
  351. <span class="editlinktip">
  352. <?php
  353. $tip = _ACA_INFO_LIST_SUBJET ;
  354. $title = _ACA_SUBJECT;
  355. echo compa::toolTip( $tip, '', 280, 'tooltip.png', $title, '', 0 );
  356. ?>
  357. </span>
  358. </td>
  359. <td>
  360. <?php
  361. $text = str_replace('"', '&quot;' , $mailingEdit->subject);
  362. if (function_exists('htmlspecialchars_decode')) {
  363. $text = htmlspecialchars_decode( $text , ENT_NOQUOTES);
  364. } elseif (function_exists('html_entity_decode')) {
  365. $text = html_entity_decode( $text , ENT_NOQUOTES);
  366. }
  367. echo ' <input type="text" name="subject" class="inputbox" size="50" maxlength="64" value="' . $text .'" />' ;
  368. ?>
  369. </td>
  370. </tr>
  371. <?php if ($show['delay']) {?>
  372. <tr>
  373. <td class="key">
  374. <span class="editlinktip">
  375. <?php
  376. $tip = _ACA_INFO_LIST_DELAY ;
  377. $title = _ACA_AUTO_DELAY;
  378. echo compa::toolTip( $tip, '', 280, 'tooltip.png', $title, '', 0 );
  379. ?>
  380. </span>
  381. </td>
  382. <td>
  383. <?php
  384. $mailid = JRequest::getVar( 'mailingid' );
  385. $delay = ( !empty($mailid) ) ? $mailingEdit->delay / 1440 : xmailing::countMailings(0, 2);
  386. //$delay = $mailingEdit->delay / 1440;
  387. ?>
  388. <input type="text" name="delay" class="inputbox" size="5" maxlength="10" value="<?php echo $delay; ?>" />
  389. </td>
  390. </tr>
  391. <?php } ?>
  392. <?php if (($show['pub_date']) AND ($GLOBALS[ACA.'listype2']=='1') AND class_exists('auto')) { ?>
  393. <tr>
  394. <td class="key">
  395. <span class="editlinktip">
  396. <?php
  397. $tip = _ACA_INFO_LIST_DATE ;
  398. $title = _ACA_LIST_DATE;
  399. $tip .= '<br/>(Actual server time is '. jnewsletter::getNow() .' )';
  400. echo compa::toolTip( $tip, '', 280, 'tooltip.png', $title, '', 0 );
  401. ?>
  402. </span>
  403. </td>
  404. <td>
  405. <?php
  406. if(ACA_CMSTYPE){//Joomla 1.5
  407. if (!isset($doc)) $doc =& JFactory::getDocument();
  408. $doc->addStyleSheet(ACA_PATH_ADMIN_INCLUDES.'calendar2/css/calendar.css');
  409. $doc->addScript(ACA_PATH_ADMIN_INCLUDES.'calendar2/js/calendar.js');
  410. }//endif
  411. ?>
  412. <input id="acaCalendar" type="text" value="<?php echo $mailingEdit->send_date; ?>" name="senddate">
  413. <input title="<?php echo _ACA_DATETIME; ?>" type="button" class="calendarDash" value="" onclick="displayCalendar(document.getElementById('acaCalendar'),'yyyy-mm-dd hh:ii',this,true)">
  414. </td>
  415. </tr>
  416. <?php } ?>
  417. <?php if ($show['published']) {?>
  418. <tr>
  419. <td width="80" class="key">
  420. <span class="editlinktip">
  421. <?php
  422. $tip = _ACA_INFO_LIST_PUB ;
  423. $title = _ACA_PUBLISHED;
  424. echo compa::toolTip( $tip, '', 280, 'tooltip.png', $title, '', 0 );
  425. ?>
  426. </span>
  427. </td>
  428. <td><?php echo $lists['published']; ?></td>
  429. </tr>
  430. <?php } ?>
  431. <?php if ($show['hide']) {?>
  432. <tr>
  433. <td width="80" class="key">
  434. <span class="editlinktip">
  435. <?php
  436. $tip = _ACA_INFO_MAILING_VISIBLE;
  437. $title = _ACA_VISIBLE_FRONT;
  438. echo compa::toolTip( $tip, '', 280, 'tooltip.png', $title, '', 0 );
  439. ?>
  440. </span>
  441. </td>
  442. <td><?php echo $lists['visible']; ?></td>
  443. </tr>
  444. <?php } ?>
  445. </tbody>
  446. </table>
  447. </fieldset>
  448. <?php
  449. }
  450. function contenttag($mailingEdit) {
  451. ?>
  452. <script language="javascript" type="text/javascript">
  453. <!--
  454. function jNewsTagInsert(jtag) {
  455. var form = document.adminForm;
  456. if(!form){
  457. form = document.mosForm;
  458. }
  459. form.jnewstag.value = jtag;
  460. }
  461. //-->
  462. </script>
  463. <?php echo _ACA_MAILING_TAG_INSTRUCT;?>
  464. <div style="margin: 2px;">
  465. <input type="text" onfocus="this.select();" size="30" class="inputbox" name="jnewstag">
  466. <input type="button" class="joobibutton" onclick="jInsertEditorText(form.jnewstag.value,'content');" value="<?php echo _ACA_MAILING_TAGINSERT;?>">
  467. </div>
  468. <table class="joobilist">
  469. <tbody>
  470. <thead>
  471. <tr>
  472. <th class="title"><center></center></th>
  473. <th class="title"><center><?php echo _ACA_MAILING_TAG; ?></center></th>
  474. <th class="title"><center><?php echo _ACA_TEMPLATE_DESC; ?></center></th>
  475. </tr>
  476. </thead>
  477. <tr class="row0">
  478. <td><input type="radio" name="jtagname" value="[NAME]" onclick="isChecked(this.checked); jNewsTagInsert(this.value);" /></td>
  479. <td>
  480. <strong><?php echo '[NAME]'; ?></strong>
  481. </td>
  482. <td>
  483. <?php echo _ACA_TAG_NAME_DESC; ?>
  484. </td>
  485. </tr>
  486. <tr class="row1">
  487. <td><input type="radio" name="jtagname" value="[FIRSTNAME]" onclick="isChecked(this.checked); jNewsTagInsert(this.value);" /></td>
  488. <td>
  489. <strong><?php echo '[FIRSTNAME]'; ?></strong>
  490. </td>
  491. <td>
  492. <?php echo _ACA_TAG_FNAME_DESC; ?>
  493. </td>
  494. </tr>
  495. <tr class="row0">
  496. <td><input type="radio" name="jtagname" value="[ISSUENB]" onclick="isChecked(this.checked); jNewsTagInsert(this.value);" /></td>
  497. <td>
  498. <strong><?php echo '[ISSUENB]'; ?></strong>
  499. </td>
  500. <td>
  501. <?php echo _ACA_TAG_ISSUENB_DESC; ?>
  502. </td>
  503. </tr>
  504. <tr class="row1">
  505. <td><input type="radio" name="jtagname" value="[DATE]" onclick="isChecked(this.checked); jNewsTagInsert(this.value);" /></td>
  506. <td>
  507. <strong><?php echo '[DATE]'; ?></strong>
  508. </td>
  509. <td>
  510. <?php echo _ACA_TAG_DATE_DESC;
  511. $mailingType=JRequest::getInt( 'listype',0 );
  512. if ($mailingType == 7){
  513. ?>
  514. </td>
  515. </tr>
  516. <tr class="row1">
  517. <td><input type="radio" name="jtagname" value="[SMARTNEWSLETTER]" onclick="isChecked(this.checked); jNewsTagInsert(this.value);" /></td>
  518. <td>
  519. <strong><?php echo '[SMARTNEWSLETTER]'; ?></strong>
  520. </td>
  521. <td>
  522. <?php echo _ACA_SMART_TAG; }?>
  523. </td>
  524. </tr>
  525. <tr class="row0">
  526. <td><input type="radio" name="jtagname" value="[SUBSCRIPTIONS]" onclick="isChecked(this.checked); jNewsTagInsert(this.value);" /></td>
  527. <td>
  528. <strong><?php echo '[SUBSCRIPTIONS]'; ?></strong>
  529. </td>
  530. <td>
  531. <?php echo _ACA_TAG_SUBSCRIPTION_DESC ?>
  532. </td>
  533. </tr>
  534. <tr class="row1">
  535. <td><input type="radio" name="jtagname" value="[UNSUBSCRIBE]" onclick="isChecked(this.checked); jNewsTagInsert(this.value);" /></td>
  536. <td>
  537. <strong><?php echo '[UNSUBSCRIBE]'; ?></strong>
  538. </td>
  539. <td>
  540. <?php echo _ACA_TAG_UNSUBSCRIBE_DESC ?>
  541. </td>
  542. </tr>
  543. <tr class="row0">
  544. <td><input type="radio" name="jtagname" value="{viewonline:<?php echo _ACA_TAG_VIEWONLINE;?>}" onclick="isChecked(this.checked); jNewsTagInsert(this.value);" /></td>
  545. <td>
  546. <strong><?php if ($GLOBALS[ACA.'type']=='PLUS' OR $GLOBALS[ACA.'type']=='PRO'){
  547. echo "{viewonline:text here}";
  548. ?>
  549. </strong>
  550. </td>
  551. <td>
  552. <?php echo _ACA_TAG_VIEWONLINE_DESC ?>
  553. </td>
  554. </tr>
  555. <tr class="row0">
  556. <td><input type="radio" name="jtagname" value="{module=id}" onclick="isChecked(this.checked); jNewsTagInsert(this.value);" /></td>
  557. <td>
  558. <strong><?php echo "{module=id}"; ?></strong>
  559. </td>
  560. <td>
  561. <?php echo _ACA_TAG_LOADMODINFO_DESC; } ?>
  562. </td>
  563. </tr>
  564. <tr class="row1">
  565. <td><input type="radio" name="jtagname" value="[CBTAG:{field_name}]" onclick="isChecked(this.checked); jNewsTagInsert(this.value);" /></td>
  566. <td>
  567. <strong><?php echo "[CBTAG:{field_name}]"; ?></strong>
  568. </td>
  569. <td>
  570. <?php echo _ACA_TAG_CBNAME_DESC ?>
  571. </td>
  572. </tr>
  573. <?php if($GLOBALS[ACA.'type']=='PRO'){
  574. if($GLOBALS[ACA.'show_column1']==1){?>
  575. <tr class="row1">
  576. <td><input type="radio" name="jtagname" value="[COLUMN1]" onclick="isChecked(this.checked); jNewsTagInsert(this.value);" /></td>
  577. <td>
  578. <strong><?php echo '[COLUMN1]'; ?></strong>
  579. </td>
  580. <td>
  581. <?php echo _ACA_COLUMN1_DESC ?>
  582. </td>
  583. </tr>
  584. <?php
  585. }
  586. if($GLOBALS[ACA.'show_column2']==1){
  587. ?>
  588. <tr class="row0">
  589. <td><input type="radio" name="jtagname" value="[COLUMN2]" onclick="isChecked(this.checked); jNewsTagInsert(this.value);" /></td>
  590. <td>
  591. <strong><?php echo '[COLUMN2]'; ?></strong>
  592. </td>
  593. <td>
  594. <?php echo _ACA_COLUMN2_DESC ?>
  595. </td>
  596. </tr>
  597. <?php
  598. }
  599. if($GLOBALS[ACA.'show_column3']==1){
  600. ?>
  601. <tr class="row1">
  602. <td><input type="radio" name="jtagname" value="[COLUMN3]" onclick="isChecked(this.checked); jNewsTagInsert(this.value);" /></td>
  603. <td>
  604. <strong><?php echo '[COLUMN3]'; ?></strong>
  605. </td>
  606. <td>
  607. <?php echo _ACA_COLUMN3_DESC ?>
  608. </td>
  609. </tr>
  610. <?php
  611. }
  612. if($GLOBALS[ACA.'show_column4']==1){
  613. ?>
  614. <tr class="row0">
  615. <td><input type="radio" name="jtagname" value="[COLUMN4]" onclick="isChecked(this.checked); jNewsTagInsert(this.value);" /></td>
  616. <td>
  617. <strong><?php echo '[COLUMN4]'; ?></strong>
  618. </td>
  619. <td>
  620. <?php echo _ACA_COLUMN4_DESC ?>
  621. </td>
  622. </tr>
  623. <?php
  624. }
  625. if($GLOBALS[ACA.'show_column5']==1){
  626. ?>
  627. <tr class="row1">
  628. <td><input type="radio" name="jtagname" value="[COLUMN5]" onclick="isChecked(this.checked); jNewsTagInsert(this.value);" /></td>
  629. <td>
  630. <strong><?php echo '[COLUMN5]'; ?></strong>
  631. </td>
  632. <td>
  633. <?php echo _ACA_COLUMN5_DESC ?>
  634. </td>
  635. </tr>
  636. <?php } //endif
  637. }//endif
  638. ?>
  639. </tbody>
  640. </table>
  641. <?php
  642. }
  643. function senderinfo($mailingEdit, $lists, $show) {
  644. ?>
  645. <?php if ($show['sender_info']) {?>
  646. <fieldset class="jnewslettercss">
  647. <legend><?php echo _ACA_LIST_T_SENDER; ?></legend>
  648. <table class="jnewslettertable" cellspacing="1">
  649. <tbody>
  650. <tr>
  651. <td width="185" class="key">
  652. <span class="editlinktip">
  653. <?php
  654. $tip = _ACA_INFO_LIST_SENDER_NAME ;
  655. $title = _ACA_SENDER_NAME;
  656. echo compa::toolTip( $tip, '', 280, 'tooltip.png', $title, '', 0 );
  657. ?>
  658. </span>
  659. </td>
  660. <td>
  661. <?php
  662. $text = str_replace('"', '&quot;' , $mailingEdit->fromname);
  663. if (function_exists('htmlspecialchars_decode')) {
  664. $text = htmlspecialchars_decode( $text , ENT_NOQUOTES);
  665. } elseif (function_exists('html_entity_decode')) {
  666. $text = html_entity_decode( $text , ENT_NOQUOTES);
  667. }
  668. echo '<input type="text" name="fromname" class="inputbox" size="20" maxlength="64" value="' . $text .'" />';
  669. // Subscriber Box List for sender tab ==========================================
  670. ?>
  671. <?php // clickable image for sender list
  672. ?>
  673. &nbsp;<img src="components/com_jnewsletter/images/16/profile.png" id="popbtn" name="popbtn" onClick="document.getElementById('poplist').style.display = 'inline'; document.getElementById('popbtn').style.display = 'none';" title="<?php echo _ACA_SENDER_LIST_INFO; ?>" style="position:absolute;">
  674. <?php //Select tag with script
  675. ?>
  676. <select id="poplist" name="poplist" style="display:none;position:absolute;" onChange="document.getElementById('poplist').style.display = 'none'; document.getElementById('popbtn').style.display = 'inline';">
  677. <?php //create a default sender value for NONE/NULL
  678. ?>
  679. <option value="0" onClick="document.adminForm.fromname.value=''; document.adminForm.fromemail.value='';"> </option>
  680. <?php
  681. // 2nd parameter of this function should be a preference
  682. // we need to limit it so that it wouldnt cause any problems when loading a bunch of datas e.g hundreds or thousands of users
  683. // get subscribers list
  684. $subscribersLists = subscribers::getListOfSubscribers( 'name', 50 );
  685. // create options for list
  686. if( !empty($subscribersLists) )
  687. {
  688. foreach( $subscribersLists as $subscribersList )
  689. {
  690. $name = $subscribersList->name;
  691. $email = $subscribersList->email;
  692. $selected = ( (isset($mailingEdit->fromname) && ($mailingEdit->fromname==$name)) && (isset($mailingEdit->fromemail) && ($mailingEdit->fromemail==$email)) ) ? true : false;
  693. ?>
  694. <option value="<?php echo $subscribersList->name; ?>" onClick="document.adminForm.fromname.value='<?php echo $name; ?>'; document.adminForm.fromemail.value='<?php echo $email; ?>';" <?php if($selected) {echo 'selected';} ?>> <?php echo $subscribersList->name .' ('. $subscribersList->email .')'; ?> </option>
  695. <?
  696. } //endf
  697. } //endif
  698. ?>
  699. </select>
  700. <?php // ==========================================
  701. ?>
  702. </td>
  703. </tr>
  704. <tr>
  705. <td width="185" class="key">
  706. <span class="editlinktip">
  707. <?php
  708. $tip = _ACA_INFO_LIST_SENDER_EMAIL ;
  709. $title = _ACA_SENDER_EMAIL;
  710. echo compa::toolTip( $tip, '', 280, 'tooltip.png', $title, '', 0 );
  711. ?>
  712. </span>
  713. </td>
  714. <td>
  715. <input type="text" name="fromemail" class="inputbox" size="20" maxlength="64" value="<?php echo $mailingEdit->fromemail; ?>" />
  716. </td>
  717. </tr>
  718. <tr>
  719. <td width="185" class="key">
  720. <span class="editlinktip">
  721. <?php
  722. $tip = _ACA_INFO_LIST_SENDER_BOUNCED ;
  723. $title = _ACA_SENDER_BOUNCE;
  724. echo compa::toolTip( $tip, '', 280, 'tooltip.png', $title, '', 0 );
  725. ?>
  726. </span>
  727. </td>
  728. <td>
  729. <input type="text" name="frombounce" class="inputbox" size="20" maxlength="64" value="<?php echo $mailingEdit->frombounce; ?>" />
  730. </td>
  731. </tr>
  732. <tr>
  733. <td width="185" class="key">
  734. <span class="editlinktip">
  735. <?php
  736. $tip = _ACA_INFO_LIST_ACA_OWNER ;
  737. $title = _ACA_OWNER;
  738. echo compa::toolTip( $tip, '', 280, 'tooltip.png', $title, '', 0 );
  739. ?>
  740. </span>
  741. </td>
  742. <td>
  743. <?php echo $mailingEdit->author_id; ?>
  744. </td>
  745. </tr>
  746. </tbody>
  747. </table>
  748. </fieldset>
  749. <?php
  750. }
  751. }
  752. function layout($mailingEdit, $lists, $show) {
  753. if (ACA_CMSTYPE) $editor =& JFactory::getEditor();
  754. if(!empty($_SESSION['skip_subscribers'.$mailingEdit->id])){
  755. echo 'If you click on the Send button, the process will skip the first '.$_SESSION['skip_subscribers'.$mailingEdit->id].' subscribers';
  756. }
  757. ?>
  758. <fieldset class="jnewslettercss">
  759. <legend><?php echo @constant( $GLOBALS[ACA.'listname'.$mailingEdit->mailing_type] ).' '. _ACA_CONTENT ; ?></legend>
  760. <table class="jnewslettertable" cellspacing="1" width="99%" border="0">
  761. <tbody>
  762. <tr>
  763. <td valign="top">
  764. <?php
  765. mailingsHTML::subject($mailingEdit, $lists, $show);
  766. if( !isset($mailingEdit->id) || ( empty($mailingEdit->id) && $mailingEdit->id < 1 ) ){
  767. if (!empty($mailingEdit->template_id) || isset($mailingEdit->template_id)) {
  768. $template = templates::getOneTemplate($mailingEdit->template_id);
  769. }else{
  770. $template = templates::getDefault();
  771. $mailingEdit->template_id = $template->template_id;
  772. }//endif
  773. $mailingEdit->htmlcontent = ( isset( $template->body ) ) ? $template->body : '';
  774. }//endif
  775. if ($show['htmlcontent']) {
  776. if (ACA_CMSTYPE) {
  777. echo '<fieldset class="jnewslettercss" id="htmlfieldset">';
  778. echo '<legend>';
  779. echo _ACA_HTML_VERSION ;
  780. echo '</legend>';
  781. echo $editor->display( 'content', $mailingEdit->htmlcontent , '100%', '400', '80', '30' ) ;
  782. echo '</fieldset>';
  783. }
  784. }
  785. ?>
  786. </td>
  787. <td valign="top" width="490px" rowspan="2">
  788. <?php
  789. if ( ACA_CMSTYPE ) {
  790. $config_tabs = new mosTabs15(0);
  791. }//endif
  792. $config_tabs->startPane('acaMailingOptions');
  793. $config_tabs->startTab(_ACA_LIST_T_LIST, 'acaMailingOptions.general');
  794. mailingsHTML::lists($mailingEdit, $lists, $show);
  795. $config_tabs->endTab();
  796. $config_tabs->startTab(_ACA_LIST_T_SENDER, 'acaMailingOptions.general');
  797. mailingsHTML::senderinfo($mailingEdit, $lists, $show);
  798. $config_tabs->endTab();
  799. $config_tabs->startTab(_ACA_LIST_OPT_TAG, 'acaMailingOptions.options');
  800. mailingsHTML::contenttag($mailingEdit);
  801. $config_tabs->endTab();
  802. if ($show['sitecontent']) {
  803. $config_tabs->startTab(_ACA_LIST_OPT_CTT, 'acaMailingOptions.content');
  804. echo _ACA_CONTENT_ITEM_SELECT_T;
  805. if (ACA_CMSTYPE) {
  806. global $mainframe;
  807. JPluginHelper::importPlugin( 'jnewsletter' );
  808. $bot_results = $mainframe->triggerEvent( 'jnewsletterbot_editabs' );
  809. }
  810. if (!empty($bot_results)) {
  811. foreach($bot_results as $bot_result) {
  812. echo $bot_result[1];
  813. }
  814. }
  815. $config_tabs->endTab();
  816. }
  817. if ($GLOBALS[ACA.'show_jcalpro'] and class_exists('pro')) {
  818. $config_tabs->startTab(_ACA_SHOW_JCALPRO, 'acaMailingOptions.jcalpro');
  819. mailingsHTML::jcalpro();
  820. $config_tabs->endTab();
  821. }
  822. if ($show['attachement'] ) {
  823. $config_tabs->startTab(_ACA_ATTACHMENTS, 'acaMailingOptions.attachement');
  824. mailingsHTML::attachement($mailingEdit, null, null);
  825. $config_tabs->endTab();
  826. }
  827. if ( $mailingEdit->mailing_type=='2' AND class_exists('autoresponder') )
  828. {
  829. $config_tabs->startTab(_ACA_AUTORESP, 'acaListEdit.autorespond');
  830. autoresponder::edit($mailingEdit, $lists, $show, $mailingEdit->html );
  831. $config_tabs->endTab();
  832. } //endif
  833. if ( $mailingEdit->mailing_type=='7' AND class_exists('autonews') )
  834. {
  835. $listA = array();
  836. $jour = array();
  837. if ( ACA_CMSTYPE )
  838. { // joomla 15
  839. $my =& JFactory::getUser();
  840. $acl =& JFactory::getACL();
  841. $gtree = $acl->get_group_children_tree( null, 'USERS', false );
  842. $jour[] = JHTML::_('select.option','1800','Every 30 minutes');
  843. $jour[] = JHTML::_('select.option','3600','Every hour');
  844. $jour[] = JHTML::_('select.option','43200','Every 12 hours');
  845. $jour[] = JHTML::_('select.option', '1', _ACA_AUTO_DAY_CH1 );
  846. $jour[] = JHTML::_('select.option', '3', _ACA_AUTO_DAY_CH3 );
  847. $jour[] = JHTML::_('select.option', '5', _ACA_AUTO_DAY_CH5 );
  848. $jour[] = JHTML::_('select.option', '6', _ACA_AUTO_DAY_CH6 );
  849. $jour[] = JHTML::_('select.option', '7', _ACA_AUTO_DAY_CH7 );
  850. $jour[] = JHTML::_('select.option', '8', _ACA_AUTO_DAY_CH8 );
  851. $jour[] = JHTML::_('select.option', '9', _ACA_AUTO_DAY_CH9 );
  852. $auto_option[] = JHTML::_('select.option', '0', _ACA_AUTO_OPTION_NONE );
  853. $auto_option[] = JHTML::_('select.option', '1', _ACA_AUTO_OPTION_NEW );
  854. if( isset($mailingEdit->new_letter) && $mailingEdit->new_letter == 1) $auto_option[] = JHTML::_('select.option', '2', _ACA_AUTO_OPTION_ALL );
  855. if( !isset($listA['delay_min']) ) $listA['delay_min'] = null;
  856. $listA['delay_min'] = JHTML::_('select.genericlist', $jour, 'delay_min', 'class="inputbox" size="1"', 'value', 'text', ( isset($mailingEdit->delay_min) ) ? $mailingEdit->delay_min : 0 );
  857. } //endif
  858. $config_tabs->startTab(_ACA_AUTONEWS, 'acaListEdit.smartnews');
  859. autonews::edit($mailingEdit, $listA, $show, $mailingEdit->html);
  860. $config_tabs->endTab();
  861. } //endif
  862. $config_tabs->endPane();
  863. ?>
  864. </td>
  865. </tr>
  866. <?php if (($show['textcontent'])) {?>
  867. <tr>
  868. <td>
  869. <fieldset class="jnewslettercss">
  870. <legend><?php echo _ACA_NONHTML_VERSION; ?></legend>
  871. <textarea name="textcontent_" id="altbody" rows="20" cols="70" style="width: 100%; height: 400px;">
  872. <?php echo strip_tags($mailingEdit->textonly) ; ?>
  873. </textarea>
  874. </fieldset>
  875. </td>
  876. <td>
  877. </td>
  878. </tr>
  879. <?php } ?>
  880. </tbody>
  881. </table>
  882. </fieldset>
  883. <input type="hidden" id="template_id" name="template_id" value="<?php echo $mailingEdit->template_id; ?>" />
  884. <?php
  885. }
  886. function insertTemplate($editor) {
  887. ?>
  888. <table style="border: 1px solid #000; width: 100%;" cellpadding="10" cellspacing="5">
  889. <tbody>
  890. <tr>
  891. <td>
  892. <?php
  893. $applyEditor = $editor->setContent($editor->_name, 'newbody');
  894. $script = "function changeTemplate(newbody,newaltbody,template_id){
  895. if(newbody.length>2){".$applyEditor."}
  896. var vartextarea =$('altbody'); if(newaltbody.length>2){vartextarea.setHTML(newaltbody);}
  897. var vartempid =$('tempid'); vartempid.value = tempid;
  898. }
  899. ";
  900. $doc =& JFactory::getDocument();
  901. $doc->addScriptDeclaration( $script );
  902. $templates = templates::getTemplates(false, false, true, '', -1, 3);
  903. $i=0;
  904. foreach($templates as $template){
  905. $imgPath = ACA_PATH_ADMIN_THUMBNAIL_SHOW.$template->thumbnail;
  906. $img = jnewsletter::imageResize($imgPath, 100, 100, $template->thumbnail);
  907. $html = '';
  908. $html = '<a href="#" onclick="changeTemplate(document.getElementById(\'jnewshtmlcontent\').innerHTML, document.getElementById(\'jnewsaltbody\').innerHTML, '.$template->template_id.');">';
  909. $html .= '<div style="margin:5px; float: left; border: 1px solid #000;">'.$img.'</div>';
  910. $html .= '<div id="jnewshtmlcontent" style="display:none;">'.$template->body.'</div>';
  911. $html .= '<div id ="jnewsaltbody" style="display:none;">'.$template->altbody.'</div>';
  912. $html .= '</a>';
  913. echo $html;
  914. $i=$i+1;
  915. }//endforeach
  916. ?>
  917. </td>
  918. </tr>
  919. </tbody>
  920. </table>
  921. <?php
  922. }
  923. function attachement($mailingEdit, $lists, $show) {
  924. foreach($mailingEdit->attachments as $attach => $k){
  925. $mailingEdit->attachments[$attach] = basename($k);
  926. }
  927. if ( ACA_CMSTYPE ) { // joomla 15
  928. $path = ACA_JPATH_ROOT_NO_ADMIN . $GLOBALS[ACA.'upload_url'];
  929. $arr = array(null);
  930. // Get the files and folders
  931. jimport('joomla.filesystem.folder');
  932. $files2 = JFolder::files($path, '.', true, true);
  933. $folders = JFolder::folders($path, '.', true, true);
  934. // Merge files and folders into one array
  935. $files = array_merge($files2, $folders);
  936. // Sort them all
  937. asort($files);
  938. }//endif
  939. // check deleted attachments
  940. $rem = JRequest::getVar( 'rem' );
  941. if( !empty($rem) )
  942. {
  943. // get the lenght of the previous url
  944. $reml = JRequest::getVar( 'reml' );
  945. attachment::deleteAttachment($rem);
  946. attachment::deleteAttachmentQuery($rem);
  947. $urlInstances = JURI::getInstance();
  948. if( isset($urlInstances->_uri) && !empty($urlInstances->_uri) )
  949. {
  950. $url = $urlInstances->_uri;
  951. $url = substr( $url, 0, '-'.(int)$reml );
  952. // refresh or reload page with the extra url [previous]
  953. //header("Refresh: 0.5; url=$url");
  954. compa::redirect( $url );
  955. } //endif
  956. } //endif
  957. if(sizeof($files) > 0)
  958. {
  959. $delImgPath = ACA_JPATH_LIVE .DS. 'administrator' .DS. 'images' .DS. 'delete_f2.png';
  960. foreach( $files as $file )
  961. {
  962. $file = basename($file);
  963. // create delete link for attachment files
  964. $urlInstances = JURI::getInstance();
  965. if( isset($urlInstances->_uri) && !empty($urlInstances->_uri) )
  966. {
  967. $url = $urlInstances->_uri;
  968. $urlExtra = "&rem=". $file ."&reml=";
  969. $urlExtraMain = $urlExtra;
  970. // we need to get the extra url length
  971. $urlExtraLength = strlen( $urlExtra );
  972. // now we need to add the length count
  973. $urlExtra .= $urlExtraLength;
  974. // we need to get the extra url length again with its length count
  975. $urlExtraLength = strlen( $urlExtra );
  976. // we need to set the length count again [ now with its full count] and set it as our final url
  977. $url .= $urlExtraMain.$urlExtraLength;
  978. //$link = '<a href="'.$url.'" onClick="callAlert()">';
  979. $link = '<a href="'. $url .'">';
  980. }
  981. else
  982. {
  983. $url = "Link Error";
  984. //$link = '<a href="'.$url.'" onClick="callAlert()">';
  985. $link = '<a href="'. $url .'" onClick="window.alert("wee");">';
  986. } //endif
  987. if(in_array($file, $mailingEdit->attachments))
  988. {
  989. echo "<input name='attachments[]' type='checkbox' value='".$file."' checked> ". $file ." ". $link ." <img src='". $delImgPath ."' title='Delete ". $file ."' style='width:16px;height:16px;'></a> <br>";
  990. }
  991. else
  992. {
  993. echo "<input name='attachments[]' type='checkbox' value='".$file."'> ". $file ." ". $link ." <img src='". $delImgPath ."' title='Delete ". $file ."' style='width:16px;height:16px;'></a> <br>";
  994. } //endif
  995. } //endforeach
  996. } //endif
  997. echo "<br><br>";
  998. /*
  999. echo '<select name="attachments[]" multiple="multiple" style="width: 100%;" size="10">';
  1000. if(sizeof($files) > 0) {
  1001. foreach ($files as $file) {
  1002. $file = basename($file);
  1003. if(in_array($file, $mailingEdit->attachments)) {
  1004. echo '<option selected="selected">' . $file . '</option>' . "\n";
  1005. } else {
  1006. echo '<option>' . $file . '</option>' . "\n";
  1007. }
  1008. }
  1009. }
  1010. echo '</select>';
  1011. */
  1012. ?>
  1013. <script src="<?php echo ACA_PATH_ADMIN_INCLUDES; ?>multifile.js"></script>
  1014. <input id="my_file_element" type="file" name="file_1" >
  1015. </input>
  1016. <br /><b><?php echo _ACA_FILES ; ?>:</b>
  1017. <div id="files_list"></div>
  1018. <script>
  1019. var multi_selector = new MultiSelector( document.getElementById( 'files_list' ), 10 );
  1020. multi_selector.addElement( document.getElementById( 'my_file_element' ) );
  1021. </script>
  1022. <?php
  1023. }
  1024. function images($lists) {
  1025. if(ACA_CMSTYPE){
  1026. return '';
  1027. }
  1028. ?>
  1029. <table class="adminform" width="100%">
  1030. <tr>
  1031. <th colspan="2">
  1032. MOSImage Control
  1033. </th>
  1034. </tr>
  1035. <tr>
  1036. <td colspan="2">
  1037. <table width="100%">
  1038. <tr>
  1039. <td width="48%" valign="top">
  1040. <div align="center">
  1041. Gallery Images:
  1042. <br />
  1043. <?php echo $lists['imagefiles'];?>
  1044. </div>
  1045. </td>
  1046. <td width="2%">
  1047. <input class="button" type="button" value=">>" onclick="addSelectedToList(selectFormFB(),'imagefiles','imagelist')" title="Add" />
  1048. <br />
  1049. <input class="button" type="button" value="<<" onclick="delSelectedFromList(selectFormFB(),'imagelist')" title="Remove" />
  1050. </td>
  1051. <td width="48%">
  1052. <div align="center">
  1053. Content Images:
  1054. <br />
  1055. <?php echo $lists['imagelist'];?>
  1056. <br />
  1057. <input class="button" type="button" value="Up" onclick="moveInList(selectFormFB(),'imagelist',selectFB('imagelist.selectedIndex'),-1)" />
  1058. <input class="button" type="button" value="Down" onclick="moveInList(selectFormFB(),'imagelist',selectFB('imagelist.selectedIndex'),+1)" />
  1059. </div>
  1060. </td>
  1061. </tr>
  1062. </table>
  1063. Sub-folder: <?php echo $lists['folders'];?>
  1064. </td>
  1065. </tr>
  1066. <tr valign="top">
  1067. <td>
  1068. <div align="center">
  1069. Sample Image:<br />
  1070. <img name="view_imagefiles" src="../images/M_images/blank.png" alt="Sample Image" width="100" />
  1071. </div>
  1072. </td>
  1073. <td valign="top">
  1074. <div align="center">
  1075. Active Image:<br />
  1076. <img name="view_imagelist" src="../images/M_images/blank.png" alt="Active Image" width="100" />
  1077. </div>
  1078. </td>
  1079. </tr>
  1080. <tr>
  1081. <td colspan="2">
  1082. Edit the image selected:
  1083. <table>
  1084. <tr>
  1085. <td align="right">
  1086. Source:
  1087. </td>
  1088. <td>
  1089. <input class="text_area" type="text" name= "_source" value="" />
  1090. </td>
  1091. </tr>
  1092. <tr>
  1093. <td align="right">
  1094. Image Align:
  1095. </td>
  1096. <td>
  1097. <?php echo $lists['_align']; ?>
  1098. </td>
  1099. </tr>
  1100. <tr>
  1101. <td align="right">
  1102. Alt Text:
  1103. </td>
  1104. <td>
  1105. <input class="text_area" type="text" name="_alt" value="" />
  1106. </td>
  1107. </tr>
  1108. <tr>
  1109. <td align="right">
  1110. Border:
  1111. </td>
  1112. <td>
  1113. <input class="text_area" type="text" name="_border" value="" size="3" maxlength="1" />
  1114. </td>
  1115. </tr>
  1116. <tr>
  1117. <td align="right">
  1118. Caption:
  1119. </td>
  1120. <td>
  1121. <input class="text_area" type="text" name="_caption" value="" size="30" />
  1122. </td>
  1123. </tr>
  1124. <tr>
  1125. <td align="right">
  1126. Caption Position:
  1127. </td>
  1128. <td>
  1129. <?php echo $lists['_caption_position']; ?>
  1130. </td>
  1131. </tr>
  1132. <tr>
  1133. <td align="right">
  1134. Caption Align:
  1135. </td>
  1136. <td>
  1137. <?php echo $lists['_caption_align']; ?>
  1138. </td>
  1139. </tr>
  1140. <tr>
  1141. <td align="right">
  1142. Caption Width:
  1143. </td>
  1144. <td>
  1145. <input class="text_area" type="text" name="_width" value="" size="5" maxlength="5" />
  1146. </td>
  1147. </tr>
  1148. <tr>
  1149. <td colspan="2">
  1150. <input class="button" type="button" value="Apply" onclick="applyImageProps()" />
  1151. </td>
  1152. </tr>
  1153. </table>
  1154. </td>
  1155. </tr>
  1156. </table>
  1157. <?php
  1158. }
  1159. function viewMailing($mailing, $forms) {
  1160. echo $forms['main'];
  1161. ?>
  1162. <table width="100%" cellpadding="4" cellspacing="0" border="0" align="left" class="adminlist">
  1163. <tr>
  1164. <th width="100px" align="left">
  1165. <strong><?php echo _ACA_SUBJECT; ?>:</strong>
  1166. </th>
  1167. <th align="left">
  1168. <?php echo $mailing->subject; ?>
  1169. </th>
  1170. </tr>
  1171. <tr>
  1172. <th align="left">
  1173. <strong><?php echo _ACA_LIST_DATE; ?>:</strong>
  1174. </th>
  1175. <th align="left">
  1176. <?php echo $mailing->send_date; ?>
  1177. </th>
  1178. </tr>
  1179. <tr>
  1180. <th align="left">
  1181. <strong><?php echo _ACA_LIST_ISSUE; ?>:</strong>
  1182. </th>
  1183. <th align="left">
  1184. <?php echo $mailing->issue_nb; ?>
  1185. </th>
  1186. </tr>
  1187. <tr>
  1188. <th width="100%" align="left" colspan="2">
  1189. <strong><?php echo _ACA_CONTENT; ?>:</strong>
  1190. </th>
  1191. </tr>
  1192. <tr>
  1193. <td align="left" colspan="2">
  1194. <?php echo $mailing->htmlcontent; ?>
  1195. </td>
  1196. </tr>
  1197. <?php if(!empty($mailing->attachments)) { ?>
  1198. <tr>
  1199. <th align="left" valign="top">
  1200. <strong><?php echo _ACA_ATTACHED_FILES; ?>:</strong>
  1201. </th>
  1202. <td align="left">
  1203. <?php
  1204. foreach ($mailing->attachments as $file) {
  1205. echo '<a href="'.ACA_JPATH_LIVE.$GLOBALS[ACA.'upload_url'].DS.basename($file).'" target="_blank">'.basename($file).'</a><br />';
  1206. }
  1207. ?>
  1208. </td>
  1209. </tr>
  1210. <?php } ?>
  1211. </table>
  1212. <?php
  1213. }
  1214. function jcalpro(){
  1215. if ( ACA_CMSTYPE ) {
  1216. $database =& JFactory::getDBO();
  1217. }//endif
  1218. $tip = _ACA_JCALTAGS_DESC_TIPS;
  1219. $title = _ACA_JCALTAGS_DESC ;
  1220. $desc = "<span class=\"editlinktip\">" . compa::toolTip( $tip, '', 280, 'tooltip.png', $title, '', 0 ) . "</span>";
  1221. $tip = _ACA_JCALTAGS_START_TIPS;
  1222. $title = _ACA_JCALTAGS_START ;
  1223. $start = "<span class=\"editlinktip\">" . compa::toolTip( $tip, '', 280, 'tooltip.png', $title, '', 0 ) . "</span>";
  1224. $tip = _ACA_JCALTAGS_READMORE_TIPS;
  1225. $title = _ACA_JCALTAGS_READMORE ;
  1226. $read = "<span class=\"editlinktip\">" . compa::toolTip( $tip, '', 280, 'tooltip.png', $title, '', 0 ) . "</span>";
  1227. $query = "SELECT `cat_id`,`cat_name` FROM #__jcalpro2_categories";
  1228. $database->setQuery($query);
  1229. $jcalcats = $database->loadObjectList();
  1230. $events = array();
  1231. $year = intval(date('Y'));
  1232. if(!empty($jcalcats)){
  1233. foreach($jcalcats as $jcalcat){
  1234. $query = "SELECT `extid`, `title` ,`start_date` FROM #__jcalpro2_events where `cat` = ".$jcalcat->cat_id." AND (`start_date` >= '".$year."' OR `end_date` >= '".$year."' ) ORDER BY `start_date` DESC";
  1235. $database->setQuery($query);
  1236. $events[$jcalcat->cat_id] = $database->loadObjectList();
  1237. }
  1238. }
  1239. ?>
  1240. <script type="text/javascript">
  1241. <!--
  1242. var events = new Array;
  1243. <?php
  1244. if(!empty($events)){
  1245. $i = 0;
  1246. foreach($events as $cat => $eventcat){
  1247. if(!empty($eventcat)){
  1248. foreach ($eventcat as $event){
  1249. echo 'events['.$i.'] = new Array(\''.$cat.'\',\''.$event->extid.'\',\''.addslashes($event->title).' ('.$event->start_date.')\');'."\n";
  1250. $i++;
  1251. }
  1252. }
  1253. }
  1254. }
  1255. ?>
  1256. var formname = 'adminForm';
  1257. if(!document.adminForm){
  1258. formname = 'mosForm';
  1259. }
  1260. function updatejCalCat(){
  1261. var catid = eval('document.'+formname+'.jcal_cat.value');
  1262. var list = eval( 'document.'+formname+'.jcal_event');
  1263. var i = 0;
  1264. // empty the list
  1265. for (i in list.options.length) {
  1266. list.options[i] = null;
  1267. }
  1268. i = 0;
  1269. for (a in events) {
  1270. if (events[a][0] == catid) {
  1271. opt = new Option();
  1272. opt.value = events[a][1];
  1273. opt.text = events[a][2];
  1274. list.options[i++] = opt;
  1275. }
  1276. }
  1277. list.length = i;
  1278. }
  1279. function updatejCaltag(){
  1280. var eventid = eval('document.'+formname+'.jcal_event.value');
  1281. var start = eval('document.'+formname+'.jcal_start');
  1282. var desc = eval('document.'+formname+'.jcal_desc');
  1283. var read = eval('document.'+formname+'.jcal_read');
  1284. var tag = eval('document.'+formname+'.jcal_tag');
  1285. for (i=0;i<start.length;i++) {
  1286. if (start[i].checked) {
  1287. var start_value = start[i].value;
  1288. }
  1289. }
  1290. for (i=0;i<desc.length;i++) {
  1291. if (desc[i].checked) {
  1292. var desc_value = desc[i].value;
  1293. }
  1294. }
  1295. for (i=0;i<read.length;i++) {
  1296. if (read[i].checked) {
  1297. var read_value = r

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