Rev 876 | Rev 1050 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 876 | Rev 984 | ||
---|---|---|---|
Line 93... | Line 93... | ||
93 | 93 | ||
94 | $out['text'] .= '<h2>'._L('Example for adding OID 2.999.123 using JavaScript').'</h2>'; |
94 | $out['text'] .= '<h2>'._L('Example for adding OID 2.999.123 using JavaScript').'</h2>'; |
95 | $cont = file_get_contents(__DIR__.'/examples/example_js.html'); |
95 | $cont = file_get_contents(__DIR__.'/examples/example_js.html'); |
96 | $cont = str_replace('<url>', OIDplus::webpath(null,OIDplus::PATH_ABSOLUTE_CANONICAL).'ajax.php', $cont); |
96 | $cont = str_replace('<url>', OIDplus::webpath(null,OIDplus::PATH_ABSOLUTE_CANONICAL).'ajax.php', $cont); |
97 | $cont = str_replace('<token>', $token, $cont); |
97 | $cont = str_replace('<token>', $token, $cont); |
98 | $out['text'] .= '<pre>'.htmlentities($cont).'</pre>'; |
98 | $out['text'] .= '<pre id="example_js">'.htmlentities($cont).'</pre>'; |
- | 99 | $out['text'] .= '<p><input type="button" value="'._L('Copy to clipboard').'" onClick="copyToClipboard(example_js)"></p>'; |
|
99 | 100 | ||
100 | $out['text'] .= '<h2>'._L('Example for adding OID 2.999.123 using PHP (located at a foreign server)').'</h2>'; |
101 | $out['text'] .= '<h2>'._L('Example for adding OID 2.999.123 using PHP (located at a foreign server)').'</h2>'; |
101 | $cont = file_get_contents(__DIR__.'/examples/example_php.phps'); |
102 | $cont = file_get_contents(__DIR__.'/examples/example_php.phps'); |
102 | $cont = str_replace('<url>', OIDplus::webpath(null,OIDplus::PATH_ABSOLUTE_CANONICAL).'ajax.php', $cont); |
103 | $cont = str_replace('<url>', OIDplus::webpath(null,OIDplus::PATH_ABSOLUTE_CANONICAL).'ajax.php', $cont); |
103 | $cont = str_replace('<token>', $token, $cont); |
104 | $cont = str_replace('<token>', $token, $cont); |
104 | $out['text'] .= '<pre>'.preg_replace("@<br.*>@ismU","",highlight_string($cont,true)).'</pre>'; |
105 | $out['text'] .= '<pre id="example_php">'.preg_replace("@<br.*>@ismU","",highlight_string($cont,true)).'</pre>'; |
- | 106 | $out['text'] .= '<p><input type="button" value="'._L('Copy to clipboard').'" onClick="copyToClipboard(example_php)"></p>'; |
|
105 | 107 | ||
106 | $out['text'] .= '<h2>'._L('Example for adding OID 2.999.123 using Python').'</h2>'; |
108 | $out['text'] .= '<h2>'._L('Example for adding OID 2.999.123 using Python').'</h2>'; |
107 | $cont = file_get_contents(__DIR__.'/examples/example_python.py'); |
109 | $cont = file_get_contents(__DIR__.'/examples/example_python.py'); |
108 | $cont = str_replace('<url>', OIDplus::webpath(null,OIDplus::PATH_ABSOLUTE_CANONICAL).'ajax.php', $cont); |
110 | $cont = str_replace('<url>', OIDplus::webpath(null,OIDplus::PATH_ABSOLUTE_CANONICAL).'ajax.php', $cont); |
109 | $cont = str_replace('<token>', $token, $cont); |
111 | $cont = str_replace('<token>', $token, $cont); |
110 | $out['text'] .= '<pre>'.htmlentities($cont).'</pre>'; |
112 | $out['text'] .= '<pre id="example_python">'.htmlentities($cont).'</pre>'; |
- | 113 | $out['text'] .= '<p><input type="button" value="'._L('Copy to clipboard').'" onClick="copyToClipboard(example_python)"></p>'; |
|
111 | 114 | ||
112 | $out['text'] .= '<h2>'._L('Example for adding OID 2.999.123 using VBScript').'</h2>'; |
115 | $out['text'] .= '<h2>'._L('Example for adding OID 2.999.123 using VBScript').'</h2>'; |
113 | $cont = file_get_contents(__DIR__.'/examples/example_vbs.vbs'); |
116 | $cont = file_get_contents(__DIR__.'/examples/example_vbs.vbs'); |
114 | $cont = str_replace('<url>', OIDplus::webpath(null,OIDplus::PATH_ABSOLUTE_CANONICAL).'ajax.php', $cont); |
117 | $cont = str_replace('<url>', OIDplus::webpath(null,OIDplus::PATH_ABSOLUTE_CANONICAL).'ajax.php', $cont); |
115 | $cont = str_replace('<token>', $token, $cont); |
118 | $cont = str_replace('<token>', $token, $cont); |
116 | $out['text'] .= '<pre>'.htmlentities($cont).'</pre>'; |
119 | $out['text'] .= '<pre id="example_vbs">'.htmlentities($cont).'</pre>'; |
- | 120 | $out['text'] .= '<p><input type="button" value="'._L('Copy to clipboard').'" onClick="copyToClipboard(example_vbs)"></p>'; |
|
117 | } |
121 | } |
118 | } |
122 | } |
119 | 123 | ||
120 | public function tree(&$json, $ra_email=null, $nonjs=false, $req_goto='') { |
124 | public function tree(&$json, $ra_email=null, $nonjs=false, $req_goto='') { |
121 | if (!OIDplus::authUtils()->isAdminLoggedIn()) return false; |
125 | if (!OIDplus::authUtils()->isAdminLoggedIn()) return false; |