CMS
Version 3.9
snippet_picker.inc
Go to the documentation of this file.
1
<?php
2
Fakoli::using
(
"html_editor"
);
3
4
$snippet_id
= checkNumeric($_GET[
"snippet_id"
]);
5
6
$snippets
= Query::create(
Snippet
,
"WHERE user_id=:u OR shared=1 ORDER BY snippet_name"
)
7
->bind(
":u"
,
$user
->getPrimaryKeyValue())
8
->execute();
9
10
$panel
=
new
Panel
(
"snippet_panel"
,
"/action/html_editor/snippet_panel?snippet_id=$snippet_id"
);
11
12
?>
13
<label
for
=
'snippet_id'
>Select
Snippet
</label>
14
<select
id
=
'snippet_id'
onchange=
"new SnippetManager().updateSnippetPanel(this.value); return false;"
>
15
<option value=
'0'
>Select a
Snippet
...</option>
16
<?
17
foreach
(
$snippets
as
$snippet
)
18
{
19
option(
$snippet
->snippet_id,
$snippet
->snippet_name,
$snippet_id
);
20
}
21
?>
22
</select>
23
<br/>
24
<?
25
$panel
->draw();
26
?>
Fakoli\using
static using()
Import the datamodels, views and manifest for the specified component(s).
Definition:
core.inc:116
Panel
Panel provides a reloadable panel tied to an action handler.
Definition:
panel.inc:51
Snippet
Definition:
snippet.inc:9
$user
global $user
Definition:
comment_form.inc:16
$snippet
$snippet
Definition:
snippet.inc:7
$panel
$panel
Definition:
snippet_picker.inc:10
$snippet_id
$snippet_id
Definition:
snippet_picker.inc:4
$snippets
$snippets
Definition:
snippet_picker.inc:6
code
cms.sonjara.com
cms
components
html_editor
handlers
snippet_picker.inc
Generated on Tue Mar 23 2021 15:36:13 for CMS by
1.9.1