From 63a6db6f98d8a52392edc0b7c006b08f5f2fa929 Mon Sep 17 00:00:00 2001 From: Nate Date: Mon, 9 Sep 2019 10:20:54 -0600 Subject: [PATCH] Dialplan XML: Integrate editor. --- app/dialplans/dialplan_xml.php | 187 +++++++++++++++++- app/dialplans/resources/images/blank.gif | Bin 0 -> 49 bytes app/dialplans/resources/images/icon_file.png | Bin 0 -> 257 bytes .../resources/images/icon_folder.png | Bin 0 -> 224 bytes app/dialplans/resources/images/icon_gear.png | Bin 0 -> 726 bytes app/dialplans/resources/images/icon_goto.png | Bin 0 -> 417 bytes .../resources/images/icon_indenting.png | Bin 0 -> 324 bytes .../resources/images/icon_invisibles.png | Bin 0 -> 821 bytes .../resources/images/icon_numbering.png | Bin 0 -> 521 bytes .../resources/images/icon_replace.png | Bin 0 -> 504 bytes app/edit/app_config.php | 8 - app/edit/index.php | 12 +- app/exec/exec.php | 18 +- 13 files changed, 193 insertions(+), 32 deletions(-) create mode 100644 app/dialplans/resources/images/blank.gif create mode 100644 app/dialplans/resources/images/icon_file.png create mode 100644 app/dialplans/resources/images/icon_folder.png create mode 100644 app/dialplans/resources/images/icon_gear.png create mode 100644 app/dialplans/resources/images/icon_goto.png create mode 100644 app/dialplans/resources/images/icon_indenting.png create mode 100644 app/dialplans/resources/images/icon_invisibles.png create mode 100644 app/dialplans/resources/images/icon_numbering.png create mode 100644 app/dialplans/resources/images/icon_replace.png diff --git a/app/dialplans/dialplan_xml.php b/app/dialplans/dialplan_xml.php index 780c7f9aed..a66c5e17d6 100644 --- a/app/dialplans/dialplan_xml.php +++ b/app/dialplans/dialplan_xml.php @@ -101,21 +101,94 @@ $language = new text; $text = $language->get(); +// load editor preferences/defaults + $setting_size = $_SESSION["editor"]["font_size"]["text"] != '' ? $_SESSION["editor"]["font_size"]["text"] : '12px'; + $setting_theme = $_SESSION["editor"]["theme"]["text"] != '' ? $_SESSION["editor"]["theme"]["text"] : 'cobalt'; + $setting_invisibles = $_SESSION["editor"]["invisibles"]["boolean"] != '' ? $_SESSION["editor"]["invisibles"]["boolean"] : 'false'; + $setting_indenting = $_SESSION["editor"]["indent_guides"]["boolean"] != '' ? $_SESSION["editor"]["indent_guides"]["boolean"] : 'false'; + $setting_numbering = $_SESSION["editor"]["line_numbers"]["boolean"] != '' ? $_SESSION["editor"]["line_numbers"]["boolean"] : 'true'; + //show the header require_once "resources/header.php"; + $document['title'] = $text['title-dialplan_edit'].' XML'; + +//scripts and styles + echo "\n"; + + echo "\n"; //show the content - echo "
\n"; + echo "\n"; echo " \n"; echo " \n"; + echo " "; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; @@ -125,9 +198,115 @@ echo " \n"; echo "
\n"; - echo " ".$text['title-dialplan_edit']."
\n"; + echo " ".$text['title-dialplan_edit']." XML
\n"; echo "
\n"; echo " \n"; - echo " \n"; + echo " \n"; echo "
"; echo "
\n"; - echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; +// echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo "
\n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo "
\n"; + echo "
\n"; + echo "
\n"; + + echo "\n"; + echo "\n"; + //show the footer require_once "resources/footer.php"; diff --git a/app/dialplans/resources/images/blank.gif b/app/dialplans/resources/images/blank.gif new file mode 100644 index 0000000000000000000000000000000000000000..75b945d2553848b8b6f41fe5e24599c0687b8472 GIT binary patch literal 49 zcmZ?wbhEHbWMp7unE0RJ|Ns9C3=9Vj8~~DvKUo+V7?>DzfNY>Fh|Ltj$Y2csQN9XW literal 0 HcmV?d00001 diff --git a/app/dialplans/resources/images/icon_file.png b/app/dialplans/resources/images/icon_file.png new file mode 100644 index 0000000000000000000000000000000000000000..c8d71de0c4ad9a7a8f4349f7b5afecf4d97e0bb7 GIT binary patch literal 257 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`EX7WqAsj$Z!;#Vf4nJ za0`PlBg3pY55O6*3aqU4E)2*A_r%sCn&Dx^)?Ph~mWJ}XY zrZ<;%OrBu7XQP2rM}k|9&Yrt9?;aW%FbSys6x+fwGkHS0-;^IU8mk^$ydLQcFw|Q4~G%p-ze-6lZA1 zk{YU&jWJLtl2luXAT35+s4IzP5wP1Qy|jX>NX zY6>kWouRP6I1Di30+9*7jc4`Vz2}|#?#Ti62XR1ef0A%dsJ7Yj1aToT9Sj6(0HC3< zp@U;{^1lC=>F8|l?9ub-odUVm+!B9frB{^1Vm`-e093Nj<-B3aG8uopSosRzU;%=r z2!bHMv0QqEul%mQN6{3y=L&)#RGW{ROAH2vC_Gnio9FlpS(c$F3IM=hFo0ngBPkRaFf14>|yB3P=fQT3VEfIhIS8Wf|e{$ng82AzvsIS_c4+$Mb}w$YGz~?*RZw zl2*iIVg>*~0ze=TsF{pRJqG|qQ4o(s`?ekfKqwSikHupzx9*c)CVGQy!TSI-ohj<} zd1I$l00nBBspC=rh}yc^r`}5!ZyAloG)>d6n34`@8(L2^8dU+n>2#*KT&|Xrj#D-O zIC3<@!Db(`jgE}IrU7Uc-g3f}WikQ)!!U5W-DNaI59Oc9e?@@;Z{e?(x=Sx?O=Yv$ zbhE{52maV#R zCP+CDZ^t6%2E?zR@=4fI%UvKo1jHObya0&viF9!|5U&AZQ6Rnw#FucTb6y}`1$6-k zHv=&v9+&4pQx8b|01(Tdn29A5u>{5oRzWBO_IdaS&iZ5;Fs0WvJJ&>H*@vK+KFS z5}^Pj{tSo@qGzI2Xpu%PJ_$1u+2x0!>Gdy#1>sq^H->Bl4G>@e&gR^+SeU!>00000 LNkvXXu0mjfF9@U- literal 0 HcmV?d00001 diff --git a/app/dialplans/resources/images/icon_indenting.png b/app/dialplans/resources/images/icon_indenting.png new file mode 100644 index 0000000000000000000000000000000000000000..c6d4c733f126b55a393fb5c1550b66340c69a6f2 GIT binary patch literal 324 zcmV-K0lWT*P)%Q5972jAIQ4=e6olE>*nR--6DJ1a(#ry~j}({V(u-_( zBapHN;y;XxjPpq}9IIYNV$->>u<$V^CZ-4=e)RI?OX{W;W@ctfpsO|mnF3T#EkGB8 zupZEYQ^ckgxZ(f){qqN6DIk^uVi&9~fmoml3L<22TzZL4Ei5c>rMKU{eQQP4)B+51 z5OoQd0PLxrS`-x(K|v7#H0Ti!5T%EaE=4Xh#-9Q4BQnbtOueIJ3q`4AWL0wj0R{l= WHTrvIz+7Yi0000}#2@UW1Hq1KuRbX2Ya?I0C@d))q#Fd-wWOxz zs4;o~bLVgxU6G37y$MXB6L4py%7uEqH$HhuyduZcNUZwEOEYr2pRl$q5Py)BzJNNX zQKF7aDt!lQnV)LTB4-ic@U-eM4MeHPNknUiTo2gL0Oz|{*=v=G(A0HY-axH(gT3)Y z>$J?1LC}v3#>>Icz$9weq?Gi+ju~@124(`VN+39X%98>0KaGy|{#+K3CrDx&%;B=R zE#m1J%zD^e(0#BYWi&35UI=^ZcOd4md_Lbg_VvrnnHu`SiEPC96pAZK)kwb<4Zh)> z-w!@Jl!BbK3!-B2I>OhXFXX*{9XZ9Dfi_r(tczXBAj*Eyd|$VH6&c zgpaq>18@&EuYmoLy}n{{=5iQhb6`v5w?!sZl_P?j6JFdRxQE#I zMv0vAERRX_2zXzj){GC=q^w8qevBC$VZ+FvCG zU*Nt}bKABRP1BS#O=;%}_tM_DNYGrO*=*)_?)$!p2U9Rk@%4pUGX^Fl%F+R!#j@N` z`p_792+qJbxCM(6<}O&tmBq5G08(WW8ektx7qSqEq}6Iwayv(@L(bf1-9iTx0bRm8 zDs>CY_h7aO(=KSRjM~s$=mzVSOrTrtO5IYc)qZCcx=N zjTA4gl%K$9#tuu^ywoi)uR~U;EU4Q#Yel+S>at}S{>=@HZvh4XFCx-qlh}c#00000 LNkvXXu0mjfcthUG literal 0 HcmV?d00001 diff --git a/app/dialplans/resources/images/icon_replace.png b/app/dialplans/resources/images/icon_replace.png new file mode 100644 index 0000000000000000000000000000000000000000..4b2ec2178852b59198baa3ae49a0eb6f321fa83c GIT binary patch literal 504 zcmVz$>{0~W;E)ZWv)(8#}5COwTKnRGZ0r3}*IxP4E)KU;= z2jbP}uEJ%w0@M{SgFr6r1L9_=As?XPKY(~Wl)ao7!?}R?6jZ}~Aojo#l(IlP7tJS2 zuo=#RCYAxjra=4>YVb`ghCc@42Smjvn#&(RU6PGMIXe(fz!C?miE;UPXt1ooVYoFA zYXb2msG+bFcMO|iM&wk2B`IR4M>3RPh@iXN6v+@64Z^2^_%9ZN<$+iX8b^-^g*mn~ zT@J*|I2?EeswSV9q=;29)st-xCe;8BdM8=6h{ONPXOW+ApVSG0LZY9Xck{YV$VXi0Gr_{Nb+jXGUXD~a8PP_ z0xeH`ftU@5TaYZ6iyZOzN=0PA3d9o7VByCi-;89z0$3eEtl`9fdL#=#C8P*74F`c5 usNtZX)1bEDAdm^ImB8jP4%rGCAix0otSfUDlILLn0000 $label) { $selected = ($value == $mode) ? 'selected' : null; - echo "\n"; + echo "\n"; } ?> @@ -250,14 +248,13 @@ @@ -299,12 +296,11 @@ $themes['Dark']['tomorrow_night_eighties']= 'Tomorrow Night 80s'; $themes['Dark']['twilight']= 'Twilight'; $themes['Dark']['vibrant_ink']= 'Vibrant Ink'; - $preview = ($setting_preview == 'true') ? "onmouseover=\"editor.setTheme('ace/theme/' + this.value);\"" : null; foreach ($themes as $optgroup => $theme) { echo "\n"; foreach ($theme as $value => $label) { $selected = (strtolower($label) == strtolower($setting_theme)) ? 'selected' : null; - echo "\n"; + echo "\n"; } echo "\n"; } diff --git a/app/exec/exec.php b/app/exec/exec.php index ee821bb1e1..763d360b7e 100644 --- a/app/exec/exec.php +++ b/app/exec/exec.php @@ -49,7 +49,6 @@ $setting_invisibles = ($_SESSION["editor"]["invisibles"]["boolean"] != '') ? $_SESSION["editor"]["invisibles"]["boolean"] : 'false'; $setting_indenting = ($_SESSION["editor"]["indent_guides"]["boolean"] != '') ? $_SESSION["editor"]["indent_guides"]["boolean"] : 'false'; $setting_numbering = ($_SESSION["editor"]["line_numbers"]["boolean"] != '') ? $_SESSION["editor"]["line_numbers"]["boolean"] : 'true'; - $setting_preview = ($_SESSION["editor"]["live_preview"]["boolean"] != '') ? $_SESSION["editor"]["live_preview"]["boolean"] : 'true'; //get the html values and set them as variables $handler = ($_REQUEST["handler"] != '') ? trim($_REQUEST["handler"]) : ((permission_exists('exec_switch')) ? 'switch' : null); @@ -340,11 +339,8 @@ $modes['xml'] = 'XML'; $modes['sql'] = 'SQL'; foreach ($modes as $value => $label) { - if ($setting_preview == 'true') { - $preview = "onmouseover=\"editor.getSession().setMode(".(($value == 'php') ? "{path:'ace/mode/php', inline:true}" : "'ace/mode/' + this.value").");\""; - } - $selected = ($value == $mode) ? 'selected' : null; - echo "\n"; + $selected = $value == $mode ? 'selected' : null; + echo "\n"; } ?> @@ -353,14 +349,13 @@ @@ -402,12 +397,11 @@ $themes['Dark']['tomorrow_night_eighties']= 'Tomorrow Night 80s'; $themes['Dark']['twilight']= 'Twilight'; $themes['Dark']['vibrant_ink']= 'Vibrant Ink'; - $preview = ($setting_preview == 'true') ? "onmouseover=\"editor.setTheme('ace/theme/' + this.value);\"" : null; foreach ($themes as $optgroup => $theme) { echo "\n"; foreach ($theme as $value => $label) { - $selected = (strtolower($label) == strtolower($setting_theme)) ? 'selected' : null; - echo "\n"; + $selected = strtolower($label) == strtolower($setting_theme) ? 'selected' : null; + echo "\n"; } echo "\n"; }