PageRenderTime 50ms CodeModel.GetById 18ms RepoModel.GetById 0ms app.codeStats 1ms

/manager/actions/mutate_content.dynamic.php

https://github.com/dreeman/modx106
PHP | 1220 lines | 1055 code | 101 blank | 64 comment | 307 complexity | 254eb8009a5616c69346141a7c09a71a MD5 | raw file
Possible License(s): AGPL-1.0, GPL-2.0, LGPL-2.1, BSD-3-Clause

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

  1. <?php
  2. if (IN_MANAGER_MODE != 'true') die('<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the MODx Content Manager instead of accessing this file directly.');
  3. // check permissions
  4. switch ($_REQUEST['a']) {
  5. case 27:
  6. if (!$modx->hasPermission('edit_document')) {
  7. $e->setError(3);
  8. $e->dumpError();
  9. }
  10. break;
  11. case 85:
  12. case 72:
  13. case 4:
  14. if (!$modx->hasPermission('new_document')) {
  15. $e->setError(3);
  16. $e->dumpError();
  17. } elseif(isset($_REQUEST['pid']) && $_REQUEST['pid'] != '0') {
  18. // check user has permissions for parent
  19. include_once(MODX_MANAGER_PATH.'processors/user_documents_permissions.class.php');
  20. $udperms = new udperms();
  21. $udperms->user = $modx->getLoginUserID();
  22. $udperms->document = empty($_REQUEST['pid']) ? 0 : $_REQUEST['pid'];
  23. $udperms->role = $_SESSION['mgrRole'];
  24. if (!$udperms->checkPermissions()) {
  25. $e->setError(3);
  26. $e->dumpError();
  27. }
  28. }
  29. break;
  30. default:
  31. $e->setError(3);
  32. $e->dumpError();
  33. }
  34. if (isset($_REQUEST['id']))
  35. $id = (int)$_REQUEST['id'];
  36. else $id = 0;
  37. if ($manager_theme)
  38. $manager_theme .= '/';
  39. else $manager_theme = '';
  40. // Get table names (alphabetical)
  41. $tbl_active_users = $modx->getFullTableName('active_users');
  42. $tbl_categories = $modx->getFullTableName('categories');
  43. $tbl_document_group_names = $modx->getFullTableName('documentgroup_names');
  44. $tbl_member_groups = $modx->getFullTableName('member_groups');
  45. $tbl_membergroup_access = $modx->getFullTableName('membergroup_access');
  46. $tbl_document_groups = $modx->getFullTableName('document_groups');
  47. $tbl_keyword_xref = $modx->getFullTableName('keyword_xref');
  48. $tbl_site_content = $modx->getFullTableName('site_content');
  49. $tbl_site_content_metatags = $modx->getFullTableName('site_content_metatags');
  50. $tbl_site_keywords = $modx->getFullTableName('site_keywords');
  51. $tbl_site_metatags = $modx->getFullTableName('site_metatags');
  52. $tbl_site_templates = $modx->getFullTableName('site_templates');
  53. $tbl_site_tmplvar_access = $modx->getFullTableName('site_tmplvar_access');
  54. $tbl_site_tmplvar_contentvalues = $modx->getFullTableName('site_tmplvar_contentvalues');
  55. $tbl_site_tmplvar_templates = $modx->getFullTableName('site_tmplvar_templates');
  56. $tbl_site_tmplvars = $modx->getFullTableName('site_tmplvars');
  57. if ($action == 27) {
  58. //editing an existing document
  59. // check permissions on the document
  60. include_once(MODX_MANAGER_PATH.'processors/user_documents_permissions.class.php');
  61. $udperms = new udperms();
  62. $udperms->user = $modx->getLoginUserID();
  63. $udperms->document = $id;
  64. $udperms->role = $_SESSION['mgrRole'];
  65. if (!$udperms->checkPermissions()) {
  66. ?>
  67. <br /><br />
  68. <div class="sectionHeader"><?php echo $_lang['access_permissions']?></div>
  69. <div class="sectionBody">
  70. <p><?php echo $_lang['access_permission_denied']?></p>
  71. </div>
  72. <?php
  73. include(MODX_MANAGER_PATH.'includes/footer.inc.php');
  74. exit;
  75. }
  76. }
  77. // Check to see the document isn't locked
  78. $sql = 'SELECT internalKey, username FROM '.$tbl_active_users.' WHERE action=27 AND id=\''.$id.'\'';
  79. $rs = mysql_query($sql);
  80. $limit = mysql_num_rows($rs);
  81. if ($limit > 1) {
  82. for ($i = 0; $i < $limit; $i++) {
  83. $lock = mysql_fetch_assoc($rs);
  84. if ($lock['internalKey'] != $modx->getLoginUserID()) {
  85. $msg = sprintf($_lang['lock_msg'], $lock['username'], 'document');
  86. $e->setError(5, $msg);
  87. $e->dumpError();
  88. }
  89. }
  90. }
  91. // get document groups for current user
  92. if ($_SESSION['mgrDocgroups']) {
  93. $docgrp = implode(',', $_SESSION['mgrDocgroups']);
  94. }
  95. if (!empty ($id)) {
  96. $access = "1='" . $_SESSION['mgrRole'] . "' OR sc.privatemgr=0" .
  97. (!$docgrp ? '' : " OR dg.document_group IN ($docgrp)");
  98. $sql = 'SELECT DISTINCT sc.* '.
  99. 'FROM '.$tbl_site_content.' AS sc '.
  100. 'LEFT JOIN '.$tbl_document_groups.' AS dg ON dg.document=sc.id '.
  101. 'WHERE sc.id=\''.$id.'\' AND ('.$access.')';
  102. $rs = mysql_query($sql);
  103. $limit = mysql_num_rows($rs);
  104. if ($limit > 1) {
  105. $e->setError(6);
  106. $e->dumpError();
  107. }
  108. if ($limit < 1) {
  109. $e->setError(3);
  110. $e->dumpError();
  111. }
  112. $content = mysql_fetch_assoc($rs);
  113. } else {
  114. $content = array();
  115. }
  116. // restore saved form
  117. $formRestored = false;
  118. if ($modx->manager->hasFormValues()) {
  119. $modx->manager->loadFormValues();
  120. $formRestored = true;
  121. }
  122. // retain form values if template was changed
  123. // edited to convert pub_date and unpub_date
  124. // sottwell 02-09-2006
  125. if ($formRestored == true || isset ($_REQUEST['newtemplate'])) {
  126. $content = array_merge($content, $_POST);
  127. $content['content'] = $_POST['ta'];
  128. if (empty ($content['pub_date'])) {
  129. unset ($content['pub_date']);
  130. } else {
  131. $content['pub_date'] = $modx->toTimeStamp($content['pub_date']);
  132. }
  133. if (empty ($content['unpub_date'])) {
  134. unset ($content['unpub_date']);
  135. } else {
  136. $content['unpub_date'] = $modx->toTimeStamp($content['unpub_date']);
  137. }
  138. }
  139. // increase menu index if this is a new document
  140. if (!isset ($_REQUEST['id'])) {
  141. if (!isset ($auto_menuindex) || $auto_menuindex) {
  142. $pid = intval($_REQUEST['pid']);
  143. $sql = 'SELECT count(*) FROM '.$tbl_site_content.' WHERE parent=\''.$pid.'\'';
  144. $content['menuindex'] = $modx->db->getValue($sql);
  145. } else {
  146. $content['menuindex'] = 0;
  147. }
  148. }
  149. if (isset ($_POST['which_editor'])) {
  150. $which_editor = $_POST['which_editor'];
  151. }
  152. ?>
  153. <script type="text/javascript" src="media/calendar/datepicker.js"></script>
  154. <script type="text/javascript">
  155. /* <![CDATA[ */
  156. window.addEvent('domready', function(){
  157. var dpOffset = <?php echo $modx->config['datepicker_offset']; ?>;
  158. var dpformat = "<?php echo $modx->config['datetime_format']; ?>" + ' hh:mm:00';
  159. new DatePicker($('pub_date'), {'yearOffset': dpOffset,'format':dpformat});
  160. new DatePicker($('unpub_date'), {'yearOffset': dpOffset,'format':dpformat});
  161. if( !window.ie6 ) {
  162. $$('img[src=<?php echo $_style["icons_tooltip_over"]?>]').each(function(help_img) {
  163. help_img.removeProperty('onclick');
  164. help_img.removeProperty('onmouseover');
  165. help_img.removeProperty('onmouseout');
  166. help_img.setProperty('title', help_img.getProperty('alt') );
  167. help_img.setProperty('class', 'tooltip' );
  168. if (window.ie) help_img.removeProperty('alt');
  169. });
  170. new Tips($$('.tooltip'),{className:'custom'} );
  171. }
  172. });
  173. // save tree folder state
  174. if (parent.tree) parent.tree.saveFolderState();
  175. function changestate(element) {
  176. currval = eval(element).value;
  177. if (currval==1) {
  178. eval(element).value=0;
  179. } else {
  180. eval(element).value=1;
  181. }
  182. documentDirty=true;
  183. }
  184. function deletedocument() {
  185. if (confirm("<?php echo $_lang['confirm_delete_resource']?>")==true) {
  186. document.location.href="index.php?id=" + document.mutate.id.value + "&a=6";
  187. }
  188. }
  189. function duplicatedocument(){
  190. if(confirm("<?php echo $_lang['confirm_resource_duplicate']?>")==true) {
  191. document.location.href="index.php?id=<?php echo $_REQUEST['id']?>&a=94";
  192. }
  193. }
  194. var allowParentSelection = false;
  195. var allowLinkSelection = false;
  196. function enableLinkSelection(b) {
  197. parent.tree.ca = "link";
  198. var closed = "<?php echo $_style["tree_folder"] ?>";
  199. var opened = "<?php echo $_style["icons_set_parent"] ?>";
  200. if (b) {
  201. document.images["llock"].src = opened;
  202. allowLinkSelection = true;
  203. }
  204. else {
  205. document.images["llock"].src = closed;
  206. allowLinkSelection = false;
  207. }
  208. }
  209. function setLink(lId) {
  210. if (!allowLinkSelection) {
  211. window.location.href="index.php?a=3&id="+lId;
  212. return;
  213. }
  214. else {
  215. documentDirty=true;
  216. document.mutate.ta.value=lId;
  217. }
  218. }
  219. function enableParentSelection(b) {
  220. parent.tree.ca = "parent";
  221. var closed = "<?php echo $_style["tree_folder"] ?>";
  222. var opened = "<?php echo $_style["icons_set_parent"] ?>";
  223. if (b) {
  224. document.images["plock"].src = opened;
  225. allowParentSelection = true;
  226. }
  227. else {
  228. document.images["plock"].src = closed;
  229. allowParentSelection = false;
  230. }
  231. }
  232. function setParent(pId, pName) {
  233. if (!allowParentSelection) {
  234. window.location.href="index.php?a=3&id="+pId;
  235. return;
  236. }
  237. else {
  238. if (pId==0 || checkParentChildRelation(pId, pName)) {
  239. documentDirty=true;
  240. document.mutate.parent.value=pId;
  241. var elm = document.getElementById('parentName');
  242. if (elm) {
  243. elm.innerHTML = (pId + " (" + pName + ")");
  244. }
  245. }
  246. }
  247. }
  248. // check if the selected parent is a child of this document
  249. function checkParentChildRelation(pId, pName) {
  250. var sp;
  251. var id = document.mutate.id.value;
  252. var tdoc = parent.tree.document;
  253. var pn = (tdoc.getElementById) ? tdoc.getElementById("node"+pId) : tdoc.all["node"+pId];
  254. if (!pn) return;
  255. if (pn.id.substr(4)==id) {
  256. alert("<?php echo $_lang['illegal_parent_self']?>");
  257. return;
  258. }
  259. else {
  260. while (pn.getAttribute("p")>0) {
  261. pId = pn.getAttribute("p");
  262. pn = (tdoc.getElementById) ? tdoc.getElementById("node"+pId) : tdoc.all["node"+pId];
  263. if (pn.id.substr(4)==id) {
  264. alert("<?php echo $_lang['illegal_parent_child']?>");
  265. return;
  266. }
  267. }
  268. }
  269. return true;
  270. }
  271. function clearKeywordSelection() {
  272. var opt = document.mutate.elements["keywords[]"].options;
  273. for (i = 0; i < opt.length; i++) {
  274. opt[i].selected = false;
  275. }
  276. }
  277. function clearMetatagSelection() {
  278. var opt = document.mutate.elements["metatags[]"].options;
  279. for (i = 0; i < opt.length; i++) {
  280. opt[i].selected = false;
  281. }
  282. }
  283. var curTemplate = -1;
  284. var curTemplateIndex = 0;
  285. function storeCurTemplate() {
  286. var dropTemplate = document.getElementById('template');
  287. if (dropTemplate) {
  288. for (var i=0; i<dropTemplate.length; i++) {
  289. if (dropTemplate[i].selected) {
  290. curTemplate = dropTemplate[i].value;
  291. curTemplateIndex = i;
  292. }
  293. }
  294. }
  295. }
  296. function templateWarning() {
  297. var dropTemplate = document.getElementById('template');
  298. if (dropTemplate) {
  299. for (var i=0; i<dropTemplate.length; i++) {
  300. if (dropTemplate[i].selected) {
  301. newTemplate = dropTemplate[i].value;
  302. break;
  303. }
  304. }
  305. }
  306. if (curTemplate == newTemplate) {return;}
  307. if (confirm('<?php echo $_lang['tmplvar_change_template_msg']?>')) {
  308. documentDirty=false;
  309. document.mutate.a.value = <?php echo $action?>;
  310. document.mutate.newtemplate.value = newTemplate;
  311. document.mutate.submit();
  312. } else {
  313. dropTemplate[curTemplateIndex].selected = true;
  314. }
  315. }
  316. // Added for RTE selection
  317. function changeRTE() {
  318. var whichEditor = document.getElementById('which_editor');
  319. if (whichEditor) {
  320. for (var i = 0; i < whichEditor.length; i++) {
  321. if (whichEditor[i].selected) {
  322. newEditor = whichEditor[i].value;
  323. break;
  324. }
  325. }
  326. }
  327. var dropTemplate = document.getElementById('template');
  328. if (dropTemplate) {
  329. for (var i = 0; i < dropTemplate.length; i++) {
  330. if (dropTemplate[i].selected) {
  331. newTemplate = dropTemplate[i].value;
  332. break;
  333. }
  334. }
  335. }
  336. documentDirty=false;
  337. document.mutate.a.value = <?php echo $action?>;
  338. document.mutate.newtemplate.value = newTemplate;
  339. document.mutate.which_editor.value = newEditor;
  340. document.mutate.submit();
  341. }
  342. /**
  343. * Snippet properties
  344. */
  345. var snippetParams = {}; // Snippet Params
  346. var currentParams = {}; // Current Params
  347. var lastsp, lastmod = {};
  348. function showParameters(ctrl) {
  349. var c,p,df,cp;
  350. var ar,desc,value,key,dt;
  351. cp = {};
  352. currentParams = {}; // reset;
  353. if (ctrl) {
  354. f = ctrl.form;
  355. } else {
  356. f= document.forms['mutate'];
  357. ctrl = f.snippetlist;
  358. }
  359. // get display format
  360. df = "";//lastsp = ctrl.options[ctrl.selectedIndex].value;
  361. // load last modified param values
  362. if (lastmod[df]) cp = lastmod[df].split("&");
  363. for (p = 0; p < cp.length; p++) {
  364. cp[p]=(cp[p]+'').replace(/^\s|\s$/,""); // trim
  365. ar = cp[p].split("=");
  366. currentParams[ar[0]]=ar[1];
  367. }
  368. // setup parameters
  369. dp = (snippetParams[df]) ? snippetParams[df].split("&"):[""];
  370. if (dp) {
  371. t='<table width="100%" style="margin-bottom:3px;margin-left:14px;background-color:#EEEEEE" cellpadding="2" cellspacing="1"><thead><tr><td width="50%"><?php echo $_lang['parameter']?><\/td><td width="50%"><?php echo $_lang['value']?><\/td><\/tr><\/thead>';
  372. for (p = 0; p < dp.length; p++) {
  373. dp[p]=(dp[p]+'').replace(/^\s|\s$/,""); // trim
  374. ar = dp[p].split("=");
  375. key = ar[0] // param
  376. ar = (ar[1]+'').split(";");
  377. desc = ar[0]; // description
  378. dt = ar[1]; // data type
  379. value = decode((currentParams[key]) ? currentParams[key]:(dt=='list') ? ar[3] : (ar[2])? ar[2]:'');
  380. if (value!=currentParams[key]) currentParams[key] = value;
  381. value = (value+'').replace(/^\s|\s$/,""); // trim
  382. if (dt) {
  383. switch(dt) {
  384. case 'int':
  385. c = '<input type="text" name="prop_'+key+'" value="'+value+'" size="30" onchange="setParameter(\''+key+'\',\''+dt+'\',this)" \/>';
  386. break;
  387. case 'list':
  388. c = '<select name="prop_'+key+'" height="1" style="width:168px" onchange="setParameter(\''+key+'\',\''+dt+'\',this)">';
  389. ls = (ar[2]+'').split(",");
  390. if (currentParams[key]==ar[2]) currentParams[key] = ls[0]; // use first list item as default
  391. for (i=0;i<ls.length;i++) {
  392. c += '<option value="'+ls[i]+'"'+((ls[i]==value)? ' selected="selected"':'')+'>'+ls[i]+'<\/option>';
  393. }
  394. c += '<\/select>';
  395. break;
  396. default: // string
  397. c = '<input type="text" name="prop_'+key+'" value="'+value+'" size="30" onchange="setParameter(\''+key+'\',\''+dt+'\',this)" \/>';
  398. break;
  399. }
  400. t +='<tr><td bgcolor="#FFFFFF" width="50%">'+desc+'<\/td><td bgcolor="#FFFFFF" width="50%">'+c+'<\/td><\/tr>';
  401. };
  402. }
  403. t+='<\/table>';
  404. td = (document.getElementById) ? document.getElementById('snippetparams'):document.all['snippetparams'];
  405. td.innerHTML = t;
  406. }
  407. implodeParameters();
  408. }
  409. function setParameter(key,dt,ctrl) {
  410. var v;
  411. if (!ctrl) return null;
  412. switch (dt) {
  413. case 'int':
  414. ctrl.value = parseInt(ctrl.value);
  415. if (isNaN(ctrl.value)) ctrl.value = 0;
  416. v = ctrl.value;
  417. break;
  418. case 'list':
  419. v = ctrl.options[ctrl.selectedIndex].value;
  420. break;
  421. default:
  422. v = ctrl.value+'';
  423. break;
  424. }
  425. currentParams[key] = v;
  426. implodeParameters();
  427. }
  428. function resetParameters() {
  429. document.mutate.params.value = "";
  430. lastmod[lastsp]="";
  431. showParameters();
  432. }
  433. // implode parameters
  434. function implodeParameters() {
  435. var v, p, s = '';
  436. for (p in currentParams) {
  437. v = currentParams[p];
  438. if (v) s += '&'+p+'='+ encode(v);
  439. }
  440. //document.forms['mutate'].params.value = s;
  441. if (lastsp) lastmod[lastsp] = s;
  442. }
  443. function encode(s) {
  444. s = s+'';
  445. s = s.replace(/\=/g,'%3D'); // =
  446. s = s.replace(/\&/g,'%26'); // &
  447. return s;
  448. }
  449. function decode(s) {
  450. s = s+'';
  451. s = s.replace(/\%3D/g,'='); // =
  452. s = s.replace(/\%26/g,'&'); // &
  453. return s;
  454. }
  455. /* ]]> */
  456. </script>
  457. <form name="mutate" id="mutate" class="content" method="post" enctype="multipart/form-data" action="index.php">
  458. <?php
  459. // invoke OnDocFormPrerender event
  460. $evtOut = $modx->invokeEvent('OnDocFormPrerender', array(
  461. 'id' => $id
  462. ));
  463. if (is_array($evtOut))
  464. echo implode('', $evtOut);
  465. ?>
  466. <input type="hidden" name="a" value="5" />
  467. <input type="hidden" name="id" value="<?php echo $content['id']?>" />
  468. <input type="hidden" name="mode" value="<?php echo (int) $_REQUEST['a']?>" />
  469. <input type="hidden" name="MAX_FILE_SIZE" value="<?php echo isset($upload_maxsize) ? $upload_maxsize : 1048576?>" />
  470. <input type="hidden" name="refresh_preview" value="0" />
  471. <input type="hidden" name="newtemplate" value="" />
  472. <fieldset id="create_edit">
  473. <h1><?php if ($_REQUEST['id']){ echo $_lang['edit_resource_title']; } else { echo $_lang['create_resource_title'];}?></h1>
  474. <div id="actions">
  475. <ul class="actionButtons">
  476. <li id="Button1">
  477. <a href="#" onclick="documentDirty=false; document.mutate.save.click();">
  478. <img alt="icons_save" src="<?php echo $_style["icons_save"]?>" /> <?php echo $_lang['save']?>
  479. </a><span class="and"> + </span>
  480. <select id="stay" name="stay">
  481. <?php if ($modx->hasPermission('new_document')) { ?>
  482. <option id="stay1" value="1" <?php echo $_REQUEST['stay']=='1' ? ' selected=""' : ''?> ><?php echo $_lang['stay_new']?></option>
  483. <?php } ?>
  484. <option id="stay2" value="2" <?php echo $_REQUEST['stay']=='2' ? ' selected="selected"' : ''?> ><?php echo $_lang['stay']?></option>
  485. <option id="stay3" value="" <?php echo $_REQUEST['stay']=='' ? ' selected=""' : ''?> ><?php echo $_lang['close']?></option>
  486. </select>
  487. </li>
  488. <?php
  489. if ($_REQUEST['a'] == '4' || $_REQUEST['a'] == '72') { ?>
  490. <li id="Button2" class="disabled"><a href="#" onclick="deletedocument();"><img src="<?php echo $_style["icons_delete_document"] ?>" alt="icons_delete_document" /> <?php echo $_lang['delete']?></a></li>
  491. <?php } else { ?>
  492. <li id="Button6"><a href="#" onclick="duplicatedocument();"><img src="<?php echo $_style["icons_resource_duplicate"] ?>" alt="icons_resource_duplicate" /> <?php echo $_lang['duplicate']?></a></li>
  493. <li id="Button3"><a href="#" onclick="deletedocument();"><img src="<?php echo $_style["icons_delete_document"] ?>" alt="icons_delete_document" /> <?php echo $_lang['delete']?></a></li>
  494. <?php } ?>
  495. <li id="Button4"><a href="#" onclick="documentDirty=false;<?php echo $id==0 ? "document.location.href='index.php?a=2';" : "document.location.href='index.php?a=3&amp;id=$id';"?>"><img alt="icons_cancel" src="<?php echo $_style["icons_cancel"] ?>" /> <?php echo $_lang['cancel']?></a></li>
  496. <li id="Button5"><a href="#" onclick="window.open('<?php echo $modx->makeUrl($id); ?>','previeWin');"><img alt="icons_preview_resource" src="<?php echo $_style["icons_preview_resource"] ?>" /> <?php echo $_lang['preview']?></a></li>
  497. </ul>
  498. </div>
  499. <!-- start main wrapper -->
  500. <div class="sectionBody">
  501. <script type="text/javascript" src="media/script/tabpane.js"></script>
  502. <div class="tab-pane" id="documentPane">
  503. <script type="text/javascript">
  504. tpSettings = new WebFXTabPane( document.getElementById( "documentPane" ), <?php echo $modx->config['remember_last_tab'] == 1 ? 'true' : 'false'; ?> );
  505. </script>
  506. <!-- General -->
  507. <div class="tab-page" id="tabGeneral">
  508. <h2 class="tab"><?php echo $_lang['settings_general']?></h2>
  509. <script type="text/javascript">tpSettings.addTabPage( document.getElementById( "tabGeneral" ) );</script>
  510. <table width="99%" border="0" cellspacing="5" cellpadding="0">
  511. <tr style="height: 24px;"><td width="100" align="left"><span class="warning"><?php echo $_lang['resource_title']?></span></td>
  512. <td><input name="pagetitle" type="text" maxlength="255" value="<?php echo htmlspecialchars(stripslashes($content['pagetitle']))?>" class="inputBox" onchange="documentDirty=true;" spellcheck="true" />
  513. &nbsp;&nbsp;<img src="<?php echo $_style["icons_tooltip_over"]?>" onmouseover="this.src='<?php echo $_style["icons_tooltip"]?>';" onmouseout="this.src='<?php echo $_style["icons_tooltip_over"]?>';" alt="<?php echo $_lang['resource_title_help']?>" onclick="alert(this.alt);" style="cursor:help;" /></td></tr>
  514. <tr style="height: 24px;"><td align="left"><span class="warning"><?php echo $_lang['long_title']?></span></td>
  515. <td><input name="longtitle" type="text" maxlength="255" value="<?php echo htmlspecialchars(stripslashes($content['longtitle']))?>" class="inputBox" onchange="documentDirty=true;" spellcheck="true" />
  516. &nbsp;&nbsp;<img src="<?php echo $_style["icons_tooltip_over"]?>" onmouseover="this.src='<?php echo $_style["icons_tooltip"]?>';" onmouseout="this.src='<?php echo $_style["icons_tooltip_over"]?>';" alt="<?php echo $_lang['resource_long_title_help']?>" onclick="alert(this.alt);" style="cursor:help;" /></td></tr>
  517. <tr style="height: 24px;"><td><span class="warning"><?php echo $_lang['resource_description']?></span></td>
  518. <td><input name="description" type="text" maxlength="255" value="<?php echo htmlspecialchars(stripslashes($content['description']))?>" class="inputBox" onchange="documentDirty=true;" spellcheck="true" />
  519. &nbsp;&nbsp;<img src="<?php echo $_style["icons_tooltip_over"]?>" onmouseover="this.src='<?php echo $_style["icons_tooltip"]?>';" onmouseout="this.src='<?php echo $_style["icons_tooltip_over"]?>';" alt="<?php echo $_lang['resource_description_help']?>" onclick="alert(this.alt);" style="cursor:help;" /></td></tr>
  520. <tr style="height: 24px;"><td><span class="warning"><?php echo $_lang['resource_alias']?></span></td>
  521. <td><input name="alias" type="text" maxlength="100" value="<?php echo stripslashes($content['alias'])?>" class="inputBox" onchange="documentDirty=true;" />
  522. &nbsp;&nbsp;<img src="<?php echo $_style["icons_tooltip_over"]?>" onmouseover="this.src='<?php echo $_style["icons_tooltip"]?>';" onmouseout="this.src='<?php echo $_style["icons_tooltip_over"]?>';" alt="<?php echo $_lang['resource_alias_help']?>" onclick="alert(this.alt);" style="cursor:help;" /></td></tr>
  523. <tr style="height: 24px;"><td><span class="warning"><?php echo $_lang['link_attributes']?></span></td>
  524. <td><input name="link_attributes" type="text" maxlength="255" value="<?php echo htmlspecialchars(stripslashes($content['link_attributes']))?>" class="inputBox" onchange="documentDirty=true;" />
  525. &nbsp;&nbsp;<img src="<?php echo $_style["icons_tooltip_over"]?>" onmouseover="this.src='<?php echo $_style["icons_tooltip"]?>';" onmouseout="this.src='<?php echo $_style["icons_tooltip_over"]?>';" alt="<?php echo $_lang['link_attributes_help']?>" onclick="alert(this.alt);" style="cursor:help;" /></td></tr>
  526. <?php if ($content['type'] == 'reference' || $_REQUEST['a'] == '72') { // Web Link specific ?>
  527. <tr style="height: 24px;"><td><span class="warning"><?php echo $_lang['weblink']?></span> <img name="llock" src="<?php echo $_style["tree_folder"] ?>" alt="tree_folder" onclick="enableLinkSelection(!allowLinkSelection);" style="cursor:pointer;" /></td>
  528. <td><input name="ta" type="text" maxlength="255" value="<?php echo !empty($content['content']) ? stripslashes($content['content']) : "http://"?>" class="inputBox" onchange="documentDirty=true;" />
  529. &nbsp;&nbsp;<img src="<?php echo $_style["icons_tooltip_over"]?>" onmouseover="this.src='<?php echo $_style["icons_tooltip"]?>';" onmouseout="this.src='<?php echo $_style["icons_tooltip_over"]?>';" alt="<?php echo $_lang['resource_weblink_help']?>" onclick="alert(this.alt);" style="cursor:help;" /></td></tr>
  530. <?php } ?>
  531. <tr style="height: 24px;"><td valign="top" width="100" align="left"><span class="warning"><?php echo $_lang['resource_summary']?></span></td>
  532. <td valign="top"><textarea name="introtext" class="inputBox" rows="3" cols="" onchange="documentDirty=true;"><?php echo htmlspecialchars(stripslashes($content['introtext']))?></textarea>
  533. &nbsp;&nbsp;<img src="<?php echo $_style["icons_tooltip_over"]?>" onmouseover="this.src='<?php echo $_style["icons_tooltip"]?>';" onmouseout="this.src='<?php echo $_style["icons_tooltip_over"]?>';" alt="<?php echo $_lang['resource_summary_help']?>" onclick="alert(this.alt);" style="cursor:help;" spellcheck="true"/></td></tr>
  534. <tr style="height: 24px;"><td><span class="warning"><?php echo $_lang['page_data_template']?></span></td>
  535. <td><select id="template" name="template" class="inputBox" onchange="templateWarning();" style="width:308px">
  536. <option value="0">(blank)</option>
  537. <?php
  538. $sql = 'SELECT t.templatename, t.id, c.category FROM '.$tbl_site_templates.' t LEFT JOIN '.$tbl_categories.' c ON t.category = c.id ORDER BY c.category, t.templatename ASC';
  539. $rs = mysql_query($sql);
  540. $currentCategory = '';
  541. while ($row = mysql_fetch_assoc($rs)) {
  542. $thisCategory = $row['category'];
  543. if($thisCategory == null) {
  544. $thisCategory = $_lang["no_category"];
  545. }
  546. if($thisCategory != $currentCategory) {
  547. if($closeOptGroup) {
  548. echo "\t\t\t\t\t</optgroup>\n";
  549. }
  550. echo "\t\t\t\t\t<optgroup label=\"$thisCategory\">\n";
  551. $closeOptGroup = true;
  552. } else {
  553. $closeOptGroup = false;
  554. }
  555. if (isset($_REQUEST['newtemplate'])) {
  556. $selectedtext = $row['id'] == $_REQUEST['newtemplate'] ? ' selected="selected"' : '';
  557. } else {
  558. if (isset ($content['template'])) {
  559. $selectedtext = $row['id'] == $content['template'] ? ' selected="selected"' : '';
  560. } else {
  561. switch($auto_template_logic) {
  562. case 'sibling':
  563. if ($sibl = $modx->getDocumentChildren($_REQUEST['pid'], 1, 0, 'template', '', 'menuindex', 'ASC', 1)) {
  564. $default_template = $sibl[0]['template'];
  565. break;
  566. } else if ($sibl = $modx->getDocumentChildren($_REQUEST['pid'], 0, 0, 'template', '', 'menuindex', 'ASC', 1)) {
  567. $default_template = $sibl[0]['template'];
  568. break;
  569. }
  570. case 'parent':
  571. if ($parent = $modx->getPageInfo($_REQUEST['pid'], 0, 'template')) {
  572. $default_template = $parent['template'];
  573. break;
  574. }
  575. case 'system':
  576. default:
  577. // default_template is already set
  578. }
  579. $selectedtext = $row['id'] == $default_template ? ' selected="selected"' : '';
  580. }
  581. }
  582. echo "\t\t\t\t\t".'<option value="'.$row['id'].'"'.$selectedtext.'>'.$row['templatename']."</option>\n";
  583. $currentCategory = $thisCategory;
  584. }
  585. if($thisCategory != '') {
  586. echo "\t\t\t\t\t</optgroup>\n";
  587. }
  588. ?>
  589. </select> &nbsp;&nbsp;<img src="<?php echo $_style["icons_tooltip_over"]?>" onmouseover="this.src='<?php echo $_style["icons_tooltip"]?>';" onmouseout="this.src='<?php echo $_style["icons_tooltip_over"]?>';" alt="<?php echo $_lang['page_data_template_help']?>" onclick="alert(this.alt);" style="cursor:help;" /></td></tr>
  590. <tr style="height: 24px;"><td align="left" style="width:100px;"><span class="warning"><?php echo $_lang['resource_opt_menu_title']?></span></td>
  591. <td><input name="menutitle" type="text" maxlength="255" value="<?php echo htmlspecialchars(stripslashes($content['menutitle']))?>" class="inputBox" onchange="documentDirty=true;" />
  592. &nbsp;&nbsp;<img src="<?php echo $_style["icons_tooltip_over"]?>" onmouseover="this.src='<?php echo $_style["icons_tooltip"]?>';" onmouseout="this.src='<?php echo $_style["icons_tooltip_over"]?>';" alt="<?php echo $_lang['resource_opt_menu_title_help']?>" onclick="alert(this.alt);" style="cursor:help;" /></td></tr>
  593. <tr style="height: 24px;"><td align="left" style="width:100px;"><span class="warning"><?php echo $_lang['resource_opt_menu_index']?></span></td>
  594. <td><table border="0" cellspacing="0" cellpadding="0" style="width:333px;"><tr>
  595. <td><input name="menuindex" type="text" maxlength="3" value="<?php echo $content['menuindex']?>" class="inputBox" style="width:30px;" onchange="documentDirty=true;" /><input type="button" value="&lt;" onclick="var elm = document.mutate.menuindex;var v=parseInt(elm.value+'')-1;elm.value=v>0? v:0;elm.focus();documentDirty=true;" /><input type="button" value="&gt;" onclick="var elm = document.mutate.menuindex;var v=parseInt(elm.value+'')+1;elm.value=v>0? v:0;elm.focus();documentDirty=true;" />
  596. &nbsp;&nbsp;<img src="<?php echo $_style["icons_tooltip_over"]?>" onmouseover="this.src='<?php echo $_style["icons_tooltip"]?>';" onmouseout="this.src='<?php echo $_style["icons_tooltip_over"]?>';" alt="<?php echo $_lang['resource_opt_menu_index_help']?>" onclick="alert(this.alt);" style="cursor:help;" /></td>
  597. <td align="right" style="text-align:right;"><span class="warning"><?php echo $_lang['resource_opt_show_menu']?></span>&nbsp;<input name="hidemenucheck" type="checkbox" class="checkbox" <?php echo $content['hidemenu']!=1 ? 'checked="checked"':''?> onclick="changestate(document.mutate.hidemenu);" /><input type="hidden" name="hidemenu" class="hidden" value="<?php echo ($content['hidemenu']==1) ? 1 : 0?>" />
  598. &nbsp;<img src="<?php echo $_style["icons_tooltip_over"]?>" onmouseover="this.src='<?php echo $_style["icons_tooltip"]?>';" onmouseout="this.src='<?php echo $_style["icons_tooltip_over"]?>';" alt="<?php echo $_lang['resource_opt_show_menu_help']?>" onclick="alert(this.alt);" style="cursor:help;" /></td>
  599. </tr></table></td></tr>
  600. <tr><td colspan="2"><div class="split"></div></td></tr>
  601. <tr style="height: 24px;"><td valign="top"><span class="warning"><?php echo $_lang['resource_parent']?></span></td>
  602. <td valign="top">
  603. <?php
  604. $parentlookup = false;
  605. if (isset ($_REQUEST['id'])) {
  606. if ($content['parent'] == 0) {
  607. $parentname = $site_name;
  608. } else {
  609. $parentlookup = $content['parent'];
  610. }
  611. } elseif (isset ($_REQUEST['pid'])) {
  612. if ($_REQUEST['pid'] == 0) {
  613. $parentname = $site_name;
  614. } else {
  615. $parentlookup = $_REQUEST['pid'];
  616. }
  617. } elseif (isset($_POST['parent'])) {
  618. if ($_POST['parent'] == 0) {
  619. $parentname = $site_name;
  620. } else {
  621. $parentlookup = $_POST['parent'];
  622. }
  623. } else {
  624. $parentname = $site_name;
  625. $content['parent'] = 0;
  626. }
  627. if($parentlookup !== false && is_numeric($parentlookup)) {
  628. $sql = 'SELECT pagetitle FROM '.$tbl_site_content.' WHERE id=\''.$parentlookup.'\'';
  629. $rs = mysql_query($sql);
  630. $limit = mysql_num_rows($rs);
  631. if ($limit != 1) {
  632. $e->setError(8);
  633. $e->dumpError();
  634. }
  635. $parentrs = mysql_fetch_assoc($rs);
  636. $parentname = $parentrs['pagetitle'];
  637. }
  638. ?>&nbsp;<img alt="tree_folder" name="plock" src="<?php echo $_style["tree_folder"] ?>" onclick="enableParentSelection(!allowParentSelection);" style="cursor:pointer;" /> <b><span id="parentName"><?php echo isset($_REQUEST['pid']) ? $_REQUEST['pid'] : $content['parent']?> (<?php echo $parentname?>)</span></b>
  639. &nbsp;<img src="<?php echo $_style["icons_tooltip_over"]?>" onmouseover="this.src='<?php echo $_style["icons_tooltip"]?>';" onmouseout="this.src='<?php echo $_style["icons_tooltip_over"]?>';" alt="<?php echo $_lang['resource_parent_help']?>" onclick="alert(this.alt);" style="cursor:help;" />
  640. <input type="hidden" name="parent" value="<?php echo isset($_REQUEST['pid']) ? $_REQUEST['pid'] : $content['parent']?>" onchange="documentDirty=true;" />
  641. </td></tr>
  642. </table>
  643. <?php if ($content['type'] == 'document' || $_REQUEST['a'] == '4') { ?>
  644. <!-- Content -->
  645. <div class="sectionHeader" id="content_header"><?php echo $_lang['resource_content']?></div>
  646. <div class="sectionBody" id="content_body">
  647. <?php
  648. if (($content['richtext'] == 1 || $_REQUEST['a'] == '4') && $use_editor == 1) {
  649. $htmlContent = $content['content'];
  650. ?>
  651. <div style="width:100%">
  652. <textarea id="ta" name="ta" cols="" rows="" style="width:100%; height: 400px;" onchange="documentDirty=true;"><?php echo htmlspecialchars($htmlContent)?></textarea>
  653. <span class="warning"><?php echo $_lang['which_editor_title']?></span>
  654. <select id="which_editor" name="which_editor" onchange="changeRTE();">
  655. <option value="none"><?php echo $_lang['none']?></option>
  656. <?php
  657. // invoke OnRichTextEditorRegister event
  658. $evtOut = $modx->invokeEvent("OnRichTextEditorRegister");
  659. if (is_array($evtOut)) {
  660. for ($i = 0; $i < count($evtOut); $i++) {
  661. $editor = $evtOut[$i];
  662. echo "\t\t\t",'<option value="',$editor,'"',($which_editor == $editor ? ' selected="selected"' : ''),'>',$editor,"</option>\n";
  663. }
  664. }
  665. ?>
  666. </select>
  667. </div>
  668. <?php
  669. $replace_richtexteditor = array(
  670. 'ta',
  671. );
  672. } else {
  673. echo "\t".'<div style="width:100%"><textarea class="phptextarea" id="ta" name="ta" style="width:100%; height: 400px;" onchange="documentDirty=true;">',htmlspecialchars($content['content']),'</textarea></div>'."\n";
  674. }
  675. ?>
  676. </div><!-- end .sectionBody -->
  677. <?php } ?>
  678. <?php if (($content['type'] == 'document' || $_REQUEST['a'] == '4') || ($content['type'] == 'reference' || $_REQUEST['a'] == 72)) { ?>
  679. <!-- Template Variables -->
  680. <div class="sectionHeader" id="tv_header"><?php echo $_lang['settings_templvars']?></div>
  681. <div class="sectionBody tmplvars" id="tv_body">
  682. <?php
  683. $template = $default_template;
  684. if (isset ($_REQUEST['newtemplate'])) {
  685. $template = $_REQUEST['newtemplate'];
  686. } else {
  687. if (isset ($content['template']))
  688. $template = $content['template'];
  689. }
  690. $sql = 'SELECT DISTINCT tv.*, IF(tvc.value!=\'\',tvc.value,tv.default_text) as value '.
  691. 'FROM '.$tbl_site_tmplvars.' AS tv '.
  692. 'INNER JOIN '.$tbl_site_tmplvar_templates.' AS tvtpl ON tvtpl.tmplvarid = tv.id '.
  693. 'LEFT JOIN '.$tbl_site_tmplvar_contentvalues.' AS tvc ON tvc.tmplvarid=tv.id AND tvc.contentid=\''.$id.'\' '.
  694. 'LEFT JOIN '.$tbl_site_tmplvar_access.' AS tva ON tva.tmplvarid=tv.id '.
  695. 'WHERE tvtpl.templateid=\''.$template.'\' AND (1=\''.$_SESSION['mgrRole'].'\' OR ISNULL(tva.documentgroup)'.
  696. (!$docgrp ? '' : ' OR tva.documentgroup IN ('.$docgrp.')').
  697. ') ORDER BY tvtpl.rank,tv.rank, tv.id';
  698. $rs = mysql_query($sql);
  699. $limit = mysql_num_rows($rs);
  700. if ($limit > 0) {
  701. echo "\t".'<table style="position:relative;" border="0" cellspacing="0" cellpadding="3" width="96%">'."\n";
  702. require_once(MODX_MANAGER_PATH.'includes/tmplvars.inc.php');
  703. require_once(MODX_MANAGER_PATH.'includes/tmplvars.commands.inc.php');
  704. for ($i = 0; $i < $limit; $i++) {
  705. // Go through and display all Template Variables
  706. $row = mysql_fetch_assoc($rs);
  707. if ($row['type'] == 'richtext' || $row['type'] == 'htmlarea') {
  708. // Add richtext editor to the list
  709. if (is_array($replace_richtexteditor)) {
  710. $replace_richtexteditor = array_merge($replace_richtexteditor, array(
  711. "tv" . $row['id'],
  712. ));
  713. } else {
  714. $replace_richtexteditor = array(
  715. "tv" . $row['id'],
  716. );
  717. }
  718. }
  719. // splitter
  720. if ($i > 0 && $i < $limit)
  721. echo "\t\t",'<tr><td colspan="2"><div class="split"></div></td></tr>',"\n";
  722. // post back value
  723. if(array_key_exists('tv'.$row['id'], $_POST)) {
  724. if($row['type'] == 'listbox-multiple') {
  725. $tvPBV = implode('||', $_POST['tv'.$row['id']]);
  726. } else {
  727. $tvPBV = $_POST['tv'.$row['id']];
  728. }
  729. } else {
  730. $tvPBV = $row['value'];
  731. }
  732. $zindex = $row['type'] == 'date' ? '100' : '500';
  733. echo "\t\t",'<tr style="height: 24px;"><td align="left" valign="top" width="150"><span class="warning">',$row['caption'],"</span>\n",
  734. "\t\t\t",'<br /><span class="comment">',$row['description'],"</span></td>\n",
  735. "\t\t\t",'<td valign="top" style="position:relative;',($row['type'] == 'date' ? 'z-index:{$zindex};' : ''),'">',"\n",
  736. "\t\t\t",renderFormElement($row['type'], $row['id'], $row['default_text'], $row['elements'], $tvPBV, '', $row),"\n",
  737. "\t\t</td></tr>\n";
  738. }
  739. echo "\t</table>\n";
  740. } else {
  741. // There aren't any Template Variables
  742. echo "\t<p>".$_lang['tmplvars_novars']."</p>\n";
  743. }
  744. ?>
  745. </div>
  746. <!-- end .sectionBody .tmplvars -->
  747. <?php } ?>
  748. </div><!-- end #tabGeneral -->
  749. <!-- Settings -->
  750. <div class="tab-page" id="tabSettings">
  751. <h2 class="tab"><?php echo $_lang['settings_page_settings']?></h2>
  752. <script type="text/javascript">tpSettings.addTabPage( document.getElementById( "tabSettings" ) );</script>
  753. <table width="99%" border="0" cellspacing="5" cellpadding="0">
  754. <?php $mx_can_pub = $modx->hasPermission('publish_document') ? '' : 'disabled="disabled" '; ?>
  755. <tr style="height: 24px;">
  756. <td><span class="warning"><?php echo $_lang['resource_opt_published']?></span></td>
  757. <td><input <?php echo $mx_can_pub ?>name="publishedcheck" type="checkbox" class="checkbox" <?php echo (isset($content['published']) && $content['published']==1) || (!isset($content['published']) && $publish_default==1) ? "checked" : ''?> onclick="changestate(document.mutate.published);" />
  758. <input type="hidden" name="published" value="<?php echo (isset($content['published']) && $content['published']==1) || (!isset($content['published']) && $publish_default==1) ? 1 : 0?>" />
  759. &nbsp;&nbsp;<img src="<?php echo $_style["icons_tooltip_over"]?>" onmouseover="this.src='<?php echo $_style["icons_tooltip"]?>';" onmouseout="this.src='<?php echo $_style["icons_tooltip_over"]?>';" alt="<?php echo $_lang['resource_opt_published_help']?>" onclick="alert(this.alt);" style="cursor:help;" /></td>
  760. </tr>
  761. <tr style="height: 24px;">
  762. <td><span class="warning"><?php echo $_lang['page_data_publishdate']?></span></td>
  763. <td><input id="pub_date" <?php echo $mx_can_pub ?>name="pub_date" class="DatePicker" value="<?php echo $content['pub_date']=="0" || !isset($content['pub_date']) ? '' : $modx->toDateFormat($content['pub_date'])?>" onblur="documentDirty=true;" />
  764. <a href="javascript:void(0);" onclick="javascript:document.mutate.pub_date.value=''; return true;" onmouseover="window.status='<?php echo $_lang['remove_date']?>'; return true;" onmouseout="window.status=''; return true;" style="cursor:pointer; cursor:hand;">
  765. <img src="<?php echo $_style["icons_cal_nodate"] ?>" width="16" height="16" border="0" alt="<?php echo $_lang['remove_date']?>" /></a>
  766. &nbsp;&nbsp;<img src="<?php echo $_style["icons_tooltip_over"]?>" onmouseover="this.src='<?php echo $_style["icons_tooltip"]?>';" onmouseout="this.src='<?php echo $_style["icons_tooltip_over"]?>';" alt="<?php echo $_lang['page_data_publishdate_help']?>" onclick="alert(this.alt);" style="cursor:help;" />
  767. </td>
  768. </tr>
  769. <tr>
  770. <td></td>
  771. <td style="color: #555;font-size:10px"><em> <?php echo $modx->config['datetime_format']; ?> HH:MM:SS</em></td>
  772. </tr>
  773. <tr style="height: 24px;">
  774. <td><span class="warning"><?php echo $_lang['page_data_unpublishdate']?></span></td>
  775. <td><input id="unpub_date" <?php echo $mx_can_pub ?>name="unpub_date" class="DatePicker" value="<?php echo $content['unpub_date']=="0" || !isset($content['unpub_date']) ? '' : $modx->toDateFormat($content['unpub_date'])?>" onblur="documentDirty=true;" />
  776. <a onclick="document.mutate.unpub_date.value=''; return true;" onmouseover="window.status='<?php echo $_lang['remove_date']?>'; return true;" onmouseout="window.status=''; return true;" style="cursor:pointer; cursor:hand">
  777. <img src="<?php echo $_style["icons_cal_nodate"] ?>" width="16" height="16" border="0" alt="<?php echo $_lang['remove_date']?>" /></a>
  778. &nbsp;&nbsp;<img src="<?php echo $_style["icons_tooltip_over"]?>" onmouseover="this.src='<?php echo $_style["icons_tooltip"]?>';" onmouseout="this.src='<?php echo $_style["icons_tooltip_over"]?>';" alt="<?php echo $_lang['page_data_unpublishdate_help']?>" onclick="alert(this.alt);" style="cursor:help;" />
  779. </td>
  780. </tr>
  781. <tr>
  782. <td></td>
  783. <td style="color: #555;font-size:10px"><em> <?php echo $modx->config['datetime_format']; ?> HH:MM:SS</em></td>
  784. </tr>
  785. <tr>
  786. <td colspan="2"><div class='split'></div></td>
  787. </tr>
  788. <?php
  789. if ($_SESSION['mgrRole'] == 1 || $_REQUEST['a'] != '27' || $_SESSION['mgrInternalKey'] == $content['createdby']) {
  790. ?>
  791. <tr style="height: 24px;"><td><span class="warning"><?php echo $_lang['resource_type']?></span></td>
  792. <td><select name="type" class="inputBox" onchange="documentDirty=true;" style="width:200px">
  793. <option value="document"<?php echo (($content['type'] == "document" || $_REQUEST['a'] == '85' || $_REQUEST['a'] == '4') ? ' selected="selected"' : "");?> ><?php echo $_lang["resource_type_webpage"];?></option>
  794. <option value="reference"<?php echo (($content['type'] == "reference" || $_REQUEST['a'] == '72') ? ' selected="selected"' : "");?> ><?php echo $_lang["resource_type_weblink"];?></option>
  795. </select>
  796. &nbsp;&nbsp;<img src="<?php echo $_style["icons_tooltip_over"]?>" onmouseover="this.src='<?php echo $_style["icons_tooltip"]?>';" onmouseout="this.src='<?php echo $_style["icons_tooltip_over"]?>';" alt="<?php echo $_lang['resource_type_message']?>" onclick="alert(this.alt);" style="cursor:help;" /></td></tr>
  797. <tr style="height: 24px;"><td><span class="warning"><?php echo $_lang['page_data_contentType']?></span></td>
  798. <td><select name="contentType" class="inputBox" onchange="documentDirty=true;" style="width:200px">
  799. <?php
  800. if (!$content['contentType'])
  801. $content['contentType'] = 'text/html';
  802. $custom_contenttype = (isset ($custom_contenttype) ? $custom_contenttype : "text/html,text/plain,text/xml");
  803. $ct = explode(",", $custom_contenttype);
  804. for ($i = 0; $i < count($ct); $i++) {
  805. echo "\t\t\t\t\t".'<option value="'.$ct[$i].'"'.($content['contentType'] == $ct[$i] ? ' selected="selected"' : '').'>'.$ct[$i]."</option>\n";
  806. }
  807. ?>
  808. </select>
  809. &nbsp;&nbsp;<img src="<?php echo $_style["icons_tooltip_over"]?>" onmouseover="this.src='<?php echo $_style["icons_tooltip"]?>';" onmouseout="this.src='<?php echo $_style["icons_tooltip_over"]?>';" alt="<?php echo $_lang['page_data_contentType_help']?>" onclick="alert(this.alt);" style="cursor:help;" /></td></tr>
  810. <tr style="height: 24px;"><td><span class="warning"><?php echo $_lang['resource_opt_contentdispo']?></span></td>
  811. <td><select name="content_dispo" size="1" onchange="documentDirty=true;" style="width:200px">
  812. <option value="0"<?php echo !$content['content_dispo'] ? ' selected="selected"':''?>><?php echo $_lang['inline']?></option>
  813. <option value="1"<?php echo $content['content_dispo']==1 ? ' selected="selected"':''?>><?php echo $_lang['attachment']?></option>
  814. </select>
  815. &nbsp;&nbsp;<img src="<?php echo $_style["icons_tooltip_over"]?>" onmouseover="this.src='<?php echo $_style["icons_tooltip"]?>';" onmouseout="this.src='<?php echo $_style["icons_tooltip_over"]?>';" alt="<?php echo $_lang['resource_opt_contentdispo_help']?>" onclick="alert(this.alt);" style="cursor:help;" /></td></tr>
  816. <tr>
  817. <td colspan="2"><div class='split'></div></td>
  818. </tr>
  819. <?php
  820. } else {
  821. if ($content['type'] != 'reference' && $_REQUEST['a'] != '72') {
  822. // non-admin managers creating or editing a document resource
  823. ?>
  824. <input type="hidden" name="contentType" value="<?php echo isset($content['contentType']) ? $content['contentType'] : "text/html"?>" />
  825. <input type="hidden" name="type" value="document" />
  826. <input type="hidden" name="content_dispo" value="<?php echo isset($content['content_dispo']) ? $content['content_dispo'] : '0'?>" />
  827. <?php
  828. } else {
  829. // non-admin managers creating or editing a reference (weblink) resource
  830. ?>
  831. <input type="hidden" name="type" value="reference" />
  832. <input type="hidden" name="contentType" value="text/html" />
  833. <?php
  834. }
  835. }//if mgrRole
  836. ?>
  837. <tr style="height: 24px;">
  838. <td width="150"><span class="warning"><?php echo $_lang['resource_opt_folder']?></span></td>
  839. <td><input name="isfoldercheck" type="checkbox" class="checkbox" <?php echo ($content['isfolder']==1||$_REQUEST['a']=='85') ? "checked" : ''?> onclick="changestate(document.mutate.isfolder);" />
  840. <input type="hidden" name="isfolder" value="<?php echo ($content['isfolder']==1||$_REQUEST['a']=='85') ? 1 : 0?>" onchange="documentDirty=true;" />
  841. &nbsp;&nbsp;<img src="<?php echo $_style["icons_tooltip_over"]?>" onmouseover="this.src='<?php echo $_style["icons_tooltip"]?>';" onmouseout="this.src='<?php echo $_style["icons_tooltip_over"]?>';" alt="<?php echo $_lang['resource_opt_folder_help']?>" onclick="alert(this.alt);" style="cursor:help;" /></td>
  842. </tr>
  843. <tr style="height: 24px;">
  844. <td><span class="warning"><?php echo $_lang['resource_opt_richtext']?></span></td>
  845. <td><input name="richtextcheck" type="checkbox" class="checkbox" <?php echo $content['richtext']==0 && $_REQUEST['a']=='27' ? '' : "checked"?> onclick="changestate(document.mutate.richtext);" />
  846. <input type="hidden" name="richtext" value="<?php echo $content['richtext']==0 && $_REQUEST['a']=='27' ? 0 : 1?>" onchange="documentDirty=true;" />
  847. &nbsp;&nbs

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