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

/webEdition/we/include/we_widgets/dlg/plg.inc.php

https://github.com/drietsch/newcms
PHP | 304 lines | 265 code | 16 blank | 23 comment | 6 complexity | ec034c429d7bdb2da9b9a95515bb796d MD5 | raw file
Possible License(s): AGPL-1.0, LGPL-2.1
  1. <?php
  2. /**
  3. * webEdition CMS
  4. *
  5. * This source is part of webEdition CMS. webEdition CMS is
  6. * free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation; either version 3 of the License, or
  9. * any later version.
  10. *
  11. * The GNU General Public License can be found at
  12. * http://www.gnu.org/copyleft/gpl.html.
  13. * A copy is found in the textfile
  14. * webEdition/licenses/webEditionCMS/License.txt
  15. *
  16. * @category webEdition
  17. * @package webEdition_base
  18. * @copyright Copyright (c) 2008 living-e AG (http://www.living-e.com)
  19. * @license http://www.gnu.org/copyleft/gpl.html GPL
  20. */
  21. include_once ($_SERVER["DOCUMENT_ROOT"] . "/webEdition/we/include/we.inc.php");
  22. include_once ($_SERVER["DOCUMENT_ROOT"] . "/webEdition/we/include/we_classes/html/we_button.inc.php");
  23. include_once ($_SERVER['DOCUMENT_ROOT'] . "/webEdition/we/include/we_classes/html/we_multibox.inc.php");
  24. include_once ($_SERVER['DOCUMENT_ROOT'] . "/webEdition/we/include/we_classes/html/we_htmlSelect.inc.php");
  25. include_once ($_SERVER["DOCUMENT_ROOT"] . "/webEdition/we/include/we_language/" . $GLOBALS["WE_LANGUAGE"] . "/cockpit.inc.php");
  26. include_once ($_SERVER["DOCUMENT_ROOT"] . "/webEdition/we/include/we_widgets/dlg/prefs.inc.php");
  27. protect();
  28. $jsCode = "
  29. var _sPlgInc='plg/plg';
  30. var _oCsv_;
  31. var _sInitCsv_;
  32. var _oSctDns;
  33. var _iSctDnsLen;
  34. var _sLastPrev='';
  35. function init(){
  36. _fo=document.forms[0];
  37. _oCsv_=opener.gel(_sObjId+'_csv');
  38. _sInitCsv_=_oCsv_.value;
  39. _oSctDns=_fo.elements['sct_dns'];
  40. _iSctDnsLen=_oSctDns.length;
  41. var aCsv=_sInitCsv_.split(';');
  42. var sInitBn=aCsv[0];
  43. var oChbxChart=_fo.elements['chbx_chart'];
  44. var iChbxChartLen=oChbxChart.length;
  45. for(var i=iChbxChartLen-1;i>=0;i--){
  46. oChbxChart[i].checked=(parseInt(sInitBn.charAt(i)))?true:false;
  47. }
  48. if(aCsv[1]!=''){
  49. var sInitDn=opener.base64_decode(aCsv[1]);
  50. for(var i=_iSctDnsLen-1;i>=0;i--){
  51. _oSctDns.options[i].selected=(_oSctDns.options[i].text==sInitDn)?true:false;
  52. }
  53. }
  54. initPrefs();
  55. }
  56. function bn(){
  57. var _bn='';
  58. var oChbxChart=_fo.elements['chbx_chart'];
  59. var iChbxChartLen=oChbxChart.length;
  60. for(var i=0;i<iChbxChartLen;i++){
  61. _bn+=(oChbxChart[i].checked)?'1':'0';
  62. }
  63. return _bn;
  64. }
  65. function dn(){
  66. return _oSctDns.options[_oSctDns.selectedIndex].text;
  67. }
  68. function dn64(){
  69. return opener.base64_encode(dn());
  70. }
  71. function cs(){
  72. return bn()+';'+dn64();
  73. }
  74. function updateView(){
  75. var _cs=cs();
  76. if((_sLastPrev!=''&&_sLastPrev!=_cs)||(_sLastPrev==''&&_sInitCsv_!=_cs)){
  77. _sLastPrev=_cs;
  78. opener.rpc(_cs,'','','','',_sObjId,_sPlgInc);
  79. }
  80. }
  81. function resetView(){
  82. if(_sLastPrev!=''&&_sLastPrev!=_sInitCsv_){
  83. opener.rpc(_sInitCsv_,'','','','',_sObjId,_sPlgInc);
  84. }
  85. }
  86. function save(){
  87. updateView();
  88. _oCsv_.value=cs();
  89. savePrefs();
  90. " . we_message_reporting::getShowMessageCall(
  91. $l_cockpit['prefs_saved_successfully'],
  92. WE_MESSAGE_NOTICE) . "
  93. self.close();
  94. }
  95. function preview(){
  96. updateView();
  97. previewPrefs();
  98. }
  99. function exit_close(){
  100. resetView();
  101. exitPrefs();
  102. self.close();
  103. }";
  104. $_userName = $_SESSION['user']['Username'];
  105. @require ($_SERVER["DOCUMENT_ROOT"] . WE_TRACKER_DIR . "/includes/showme.inc.php");
  106. //$_dns = getDomainList($_userName,$_md5passwd);
  107. //if (defined('WE_TRACKER_DIR')) {
  108. include_once ($_SERVER["DOCUMENT_ROOT"] . WE_TRACKER_DIR . "/includes/global.inc.php");
  109. include_once ($_SERVER["DOCUMENT_ROOT"] . WE_TRACKER_DIR . "/includes/db.inc.php");
  110. $pl_db = new stat_db();
  111. $pl_conn = $pl_db->connect();
  112. $pl_tables = new stat_tables();
  113. $pl_tables->build_tables();
  114. @$result = mysql_query("SELECT websites FROM " . mysql_real_escape_string(preg_replace("/\s/","",$pl_tables->accounttable)). " WHERE account_username = '" . mysql_real_escape_string($_userName) . "'");
  115. $pl_object = mysql_fetch_object($result);
  116. $websites = $pl_object->websites;
  117. $websites = str_replace("\r", "", $websites);
  118. $_dns = explode("\n", $websites);
  119. //} else {
  120. //}
  121. $sctDns = htmlFormElementTable(
  122. htmlSelect("sct_dns", $_dns, 1, 0, false, 'onChange="" style="width:300px;"', 'value'),
  123. $l_cockpit["domain"]);
  124. $chbxChart[0] = we_forms::checkbox(
  125. $value = 0,
  126. $checked = 0,
  127. $name = "chbx_chart",
  128. $text = $l_cockpit['visitors_data_today'],
  129. $uniqid = true,
  130. $class = "defaultfont",
  131. $onClick = "",
  132. $disabled = false,
  133. $description = "",
  134. $type = 0,
  135. $width = 0);
  136. $chbxChart[1] = we_forms::checkbox(
  137. $value = 0,
  138. $checked = 0,
  139. $name = "chbx_chart",
  140. $text = $l_cockpit['visitors_data_yesterday'],
  141. $uniqid = true,
  142. $class = "defaultfont",
  143. $onClick = "",
  144. $disabled = false,
  145. $description = "",
  146. $type = 0,
  147. $width = 0);
  148. $chbxChart[2] = we_forms::checkbox(
  149. $value = 0,
  150. $checked = 0,
  151. $name = "chbx_chart",
  152. $text = $l_cockpit['visitors_data_this_month'],
  153. $uniqid = true,
  154. $class = "defaultfont",
  155. $onClick = "",
  156. $disabled = false,
  157. $description = "",
  158. $type = 0,
  159. $width = 0);
  160. $chbxChart[3] = we_forms::checkbox(
  161. $value = 0,
  162. $checked = 0,
  163. $name = "chbx_chart",
  164. $text = $l_cockpit['visitors_behaviour_today'],
  165. $uniqid = true,
  166. $class = "defaultfont",
  167. $onClick = "",
  168. $disabled = false,
  169. $description = "",
  170. $type = 0,
  171. $width = 0);
  172. $chbxChart[4] = we_forms::checkbox(
  173. $value = 0,
  174. $checked = 0,
  175. $name = "chbx_chart",
  176. $text = $l_cockpit['Snapshot'],
  177. $uniqid = true,
  178. $class = "defaultfont",
  179. $onClick = "",
  180. $disabled = false,
  181. $description = "",
  182. $type = 0,
  183. $width = 0);
  184. $chbxChart[5] = we_forms::checkbox(
  185. $value = 0,
  186. $checked = 0,
  187. $name = "chbx_chart",
  188. $text = $l_cockpit['top_visiting_periods'],
  189. $uniqid = true,
  190. $class = "defaultfont",
  191. $onClick = "",
  192. $disabled = false,
  193. $description = "",
  194. $type = 0,
  195. $width = 0);
  196. $chbxChart[6] = we_forms::checkbox(
  197. $value = 0,
  198. $checked = 0,
  199. $name = "chbx_chart",
  200. $text = $l_cockpit['visitors_forecast'],
  201. $uniqid = true,
  202. $class = "defaultfont",
  203. $onClick = "",
  204. $disabled = false,
  205. $description = "",
  206. $type = 0,
  207. $width = 0);
  208. $chbxChart[7] = we_forms::checkbox(
  209. $value = 0,
  210. $checked = 0,
  211. $name = "chbx_chart",
  212. $text = $l_cockpit['avg_amount_visitors'],
  213. $uniqid = true,
  214. $class = "defaultfont",
  215. $onClick = "",
  216. $disabled = false,
  217. $description = "",
  218. $type = 0,
  219. $width = 0);
  220. $chbxChart[8] = we_forms::checkbox(
  221. $value = 0,
  222. $checked = 0,
  223. $name = "chbx_chart",
  224. $text = $l_cockpit['promo_value_tai'],
  225. $uniqid = true,
  226. $class = "defaultfont",
  227. $onClick = "",
  228. $disabled = false,
  229. $description = "",
  230. $type = 0,
  231. $width = 0);
  232. $chart = new we_htmlTable(array(
  233. "cellpadding" => "0", "cellspacing" => "0", "border" => "0"
  234. ), 13, 1);
  235. $chart->setCol(0, 0, null, $sctDns);
  236. $chart->setCol(1, 0, null, getPixel(1, 8));
  237. $chart->setCol(2, 0, null, $chbxChart[0]);
  238. $chart->setCol(3, 0, null, $chbxChart[1]);
  239. $chart->setCol(4, 0, null, $chbxChart[2]);
  240. $chart->setCol(5, 0, null, $chbxChart[3]);
  241. $chart->setCol(6, 0, null, $chbxChart[4]);
  242. $chart->setCol(7, 0, null, $chbxChart[5]);
  243. $chart->setCol(8, 0, null, $chbxChart[6]);
  244. $chart->setCol(9, 0, null, $chbxChart[7]);
  245. $chart->setCol(10, 0, null, $chbxChart[8]);
  246. $_pLog = $chart->getHTMLCode();
  247. $we_button = new we_button();
  248. $parts = array();
  249. array_push($parts, array(
  250. "headline" => $l_cockpit['display'], "html" => $_pLog, "space" => 80
  251. ));
  252. array_push($parts, array(
  253. "headline" => "", "html" => $oSelCls->getHTMLCode(), "space" => 0
  254. ));
  255. $save_button = $we_button->create_button("save", "javascript:save();", false, -1, -1);
  256. $preview_button = $we_button->create_button("preview", "javascript:preview();", false, -1, -1);
  257. $cancel_button = $we_button->create_button("close", "javascript:exit_close();");
  258. $buttons = $we_button->position_yes_no_cancel($save_button, $preview_button, $cancel_button);
  259. $sMultibox = we_multiIconBox::getJS() . we_multiIconBox::getHTML(
  260. "plgProps",
  261. "100%",
  262. $parts,
  263. 30,
  264. $buttons,
  265. -1,
  266. "",
  267. "",
  268. "",
  269. $l_cockpit['pagelogger']);
  270. $_pLogProps = new we_htmlTable(array(
  271. "border" => "0", "cellpadding" => "0", "cellspacing" => "0"
  272. ), 2, 1);
  273. $_pLogProps->setCol(0, 0, null, $sMultibox);
  274. $_pLogProps->setCol(1, 0, null, getPixel(1, 10));
  275. print
  276. we_htmlElement::htmlHtml(
  277. we_htmlElement::htmlHead(
  278. we_htmlElement::htmlTitle($l_cockpit['pagelogger']) . STYLESHEET . we_htmlElement::cssElement(
  279. "select{border:#AAAAAA solid 1px}") . we_htmlElement::jsElement(
  280. "",
  281. array(
  282. "src" => JS_DIR . "we_showMessage.js"
  283. )) . we_htmlElement::jsElement($jsPrefs . $jsCode)) . we_htmlElement::htmlBody(
  284. array(
  285. "class" => "weDialogBody", "onload" => "init();"
  286. ),
  287. we_htmlElement::htmlForm("", $_pLogProps->getHTMLCode())));
  288. ?>