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

/modules/settings/AspDownloads.tpl

https://bitbucket.org/jstechnologies/cats
Smarty Template | 181 lines | 169 code | 12 blank | 0 comment | 15 complexity | a2a0bbe38e811927913de9aaea00804a MD5 | raw file
  1. <?php /* $Id: AspDownloads.tpl 3367 2007-10-31 22:24:34Z brian $ */ ?>
  2. <?php TemplateUtility::printHeader('Settings', array('modules/settings/validator.js', 'modules/settings/downloads.css')); ?>
  3. <?php TemplateUtility::printHeaderBlock(); ?>
  4. <?php TemplateUtility::printTabs($this->active, $this->subActive); ?>
  5. <?php // <---------------------------------- FIXME: Move to ASP Hook? ?>
  6. <script>
  7. function sendNotificationEmail()
  8. {
  9. var ajaxObj;
  10. try
  11. {
  12. // Firefox, Opera 8.0+, Safari
  13. ajaxObj = new XMLHttpRequest();
  14. }
  15. catch (e)
  16. {
  17. // Internet Explorer
  18. try
  19. {
  20. ajaxObj = new ActiveXObject("Msxml2.XMLHTTP");
  21. }
  22. catch (e)
  23. {
  24. try
  25. {
  26. ajaxObj = new ActiveXObject("Microsoft.XMLHTTP");
  27. }
  28. catch (e)
  29. {
  30. alert("Your browser does not support AJAX!");
  31. return false;
  32. }
  33. }
  34. }
  35. ajaxObj.onreadystatechange = function()
  36. {
  37. // no response necessary
  38. }
  39. ajaxObj.open("GET","<?php echo CATSUtility::getIndexName(); ?>?m=settings&a=downloads&sendDevEmail=true",true);
  40. ajaxObj.send(null);
  41. }
  42. </script>
  43. <?php
  44. if (isset($_GET['sendDevEmail']) && !strcmp($_GET['sendDevEmail'], 'true') && file_exists('modules/asp') &&
  45. $_SESSION['CATS'] && $_SESSION['CATS']->isLoggedIn())
  46. {
  47. if (isset($_COOKIE['CATS_firefoxToolbar']) && !strcmp($_COOKIE['CATS_firefoxToolbar'], 'true')) exit(0);
  48. include_once('./modules/asp/lib/ASPUtility.php');
  49. ASPUtility::sendDevEmail(
  50. 'Firefox Download',
  51. sprintf(
  52. 'User(<b>%s</b>) @ Site(<b>%s</b>) has clicked to download the Firefox toolbar.',
  53. ucwords($_SESSION['CATS']->getUsername()),
  54. ucwords($_SESSION['CATS']->getSiteName())
  55. )
  56. );
  57. // Set a cookie so we don't get multiple e-mails from the same computer
  58. setcookie('CATS_firefoxToolbar', 'true', time()+(60*60*24*7*15), null, null, null, null);
  59. exit(0);
  60. }
  61. // End Move to Asp Hook ---------------------------------->
  62. ?>
  63. <div id="main">
  64. <?php TemplateUtility::printQuickSearch(); ?>
  65. <div id="contents">
  66. <table>
  67. <tr>
  68. <td width="3%">
  69. <img src="images/settings.gif" width="24" height="24" border="0" alt="Settings" style="margin-top: 3px;" />&nbsp;
  70. </td>
  71. <td><h2>Settings: Downloads</h2></td>
  72. </tr>
  73. </table>
  74. <table width="100%">
  75. <tr>
  76. <td width="100%">
  77. <p class="noteUnsized">Additional tools to enhance your productivity.</p>
  78. <table class="searchTable" width="100%">
  79. <tr>
  80. <td width="230" valign="top">
  81. <img src="images/i-firefox-small.gif" class="absmiddle" alt="" />
  82. <a href="javascript:void(0);" onclick="tryInstall();">
  83. Install CATS Firefox Toolbar
  84. </a>
  85. </td>
  86. <td>
  87. Integrate CATS with Monster, Hotjobs and more through the Firefox Web Browser.&nbsp;&nbsp;<a href="index.php?a=addons">Learn More</a>
  88. <div id="settingsDownloads">
  89. <h4>Internet Browsers</h4>
  90. <table class="downloadSupportedGrid" cellpadding="0" cellspacing="0">
  91. <tr class="headers">
  92. <td>&nbsp;</td>
  93. <td><img src="images/i-firefox.gif" /> <span>Firefox</span></td>
  94. <td class="medGrid"><img src="images/i-ie.gif" /> <span>Internet Explorer</span></td>
  95. <td><img src="images/i-opera-grayed.gif" /> <span>Opera</span></td>
  96. <td><img src="images/i-safari-grayed.gif" /> <span>Safari</span></td>
  97. </tr>
  98. <tr>
  99. <td class="category">CATS Toolbar</td>
  100. <td><img src="images/blue_check.gif" /></td>
  101. <td>coming soon</td>
  102. <td><img src="images/gray_x.gif" /></td>
  103. <td><img src="images/gray_x.gif" /></td>
  104. </tr>
  105. </table>
  106. <h4>Email Clients</h4>
  107. <table class="downloadSupportedGrid" cellpadding="0" cellspacing="0">
  108. <tr class="headers">
  109. <td>&nbsp;</td>
  110. <td colspan="2"><img src="images/i-thunderbird.gif" /> <span>Thunderbird</span></td>
  111. <td colspan="2"><img src="images/i-outlook.gif" /> <span>Outlook</span></td>
  112. </tr>
  113. <tr>
  114. <td class="category">CATS Plug-in</td>
  115. <td colspan="2">coming soon</td>
  116. <td colspan="2">coming soon</td>
  117. </tr>
  118. </table>
  119. </div>
  120. <span id="notFirefox" style="display:none;">
  121. </span>
  122. <script type="text/javascript">
  123. <?php if (false): ?>
  124. function tryInstall()
  125. {
  126. showPopWin('<?php echo(CATSUtility::getIndexName()); ?>?m=settings&a=getPaidModal', 400, 270, null); return false;
  127. }
  128. <?php else: ?>
  129. function tryInstall()
  130. {
  131. var isFirefox = false;
  132. /* Browser Detection */
  133. if(navigator.userAgent.indexOf("Firefox")!=-1) {
  134. var versionindex=navigator.userAgent.indexOf("Firefox")+8
  135. if (parseInt(navigator.userAgent.charAt(versionindex))>=1) {
  136. isFirefox = true;
  137. }
  138. }
  139. if (!isFirefox) {
  140. showPopWin('<?php echo(CATSUtility::getIndexName()); ?>?m=settings&a=getFirefoxModal', 400, 270, null); return false;
  141. }
  142. else {
  143. xpi = new Object();
  144. <?php if(ModuleUtility::moduleExists('asp') && false): ?>
  145. <?php /* TODO: Toolbar generated automatically with username and password. */ ?>
  146. xpi["CATS ToolBar"] = "http://www.catsone.com/extensions/firefox/catstoolbargenerator.php?" +
  147. "username=<?php echo(urlencode($_SESSION['CATS']->getUsername())); ?>&" +
  148. "password="+rot13("<?php echo(str_rot13(urlencode($_SESSION['CATS']->getPassword()))); ?>")+"&" +
  149. "url=<?php echo(urlencode('https://'.$_SESSION['CATS']->getUnixName())); ?>.catsone.com/";
  150. <?php else: ?>
  151. xpi["CATS ToolBar"] = "http://www.catsone.com/extensions/firefox/catstoolbar.xpi";
  152. <?php endif; ?>
  153. InstallTrigger.install(xpi);
  154. if (typeof sendNotificationEmail == 'function') sendNotificationEmail();
  155. }
  156. }
  157. <?php endif; ?>
  158. </script>
  159. </td>
  160. </tr>
  161. </table>
  162. <br />
  163. </td>
  164. </tr>
  165. </table>
  166. </div>
  167. </div>
  168. <div id="bottomShadow"></div>
  169. <?php TemplateUtility::printFooter(); ?>