19declare(strict_types=1);
31 public function init(): void
33 $this->copy_enabled =
true;
34 $this->delete_enabled =
true;
35 $this->cut_enabled =
true;
36 $this->subscribe_enabled =
true;
37 $this->link_enabled =
true;
38 $this->info_screen_enabled =
true;
40 $this->gui_class_name =
"ilobjbloggui";
51 $permissions = array();
53 if ($item[
"lang_var"] ===
"edit" && $item[
"granted"]) {
54 $permissions[$item[
"permission"]] = $idx;
57 if (count($permissions) === 2) {
58 unset(
$commands[$permissions[
"contribute"]]);
74 $tpl = $this->
ui->mainTemplate();
78 && (
bool) $this->
settings->get(
'item_cmd_asynch')) {
80 $cmd =
"forwardExport";
84 parent::insertCommand($href,
$text, $frame, $img, $cmd, $onclick);
89 $chksum = md5($href .
$text);
91 !in_array($chksum, $this->prevent_duplicate_commands)) {
93 $this->prevent_duplicate_commands[] = $chksum;
96 $prevent_background_click =
false;
101 $signal = $modal[
"show"];
102 $tpl->addJavaScript(
'assets/js/blog.js');
103 $tpl->addOnLoadCode(
'il.blog.setModalTemplate("' . $signal .
'", "' . addslashes(json_encode($modal[
"template"])) .
'");');
106 $action = $this->
ui->factory()
110 $action = $action->withOnLoadCode(
function (
$id) use ($onclick, $signal):
string {
111 return "document.getElementById('$id').addEventListener('click', (event) => {event.preventDefault(); il.blog.showModal('$signal');});";
113 $this->current_actions[] = $action;
124 $comment_export_helper = new \ILIAS\Notes\Export\ExportHelperGUI();
125 $this->
lng->loadLanguageModule(
"note");
126 $modal = $comment_export_helper->getCommentIncludeModalDialog(
128 $this->
lng->txt(
"note_html_export_include_comments"),
129 $ctrl->getLinkTargetByClass([ilRepositoryGUI::class, ilObjBlogGUI::class],
"export"),
130 $ctrl->getLinkTargetByClass([ilRepositoryGUI::class, ilObjBlogGUI::class],
"exportWithComments")
133 $modalt[
"show"] = $modal->getShowSignal()->getId();
134 $modalt[
"close"] = $modal->getCloseSignal()->getId();
135 $modalt[
"template"] = $ui->renderer()->renderAsync($modal);
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
static _getCommands()
get commands
static isCommentsExportPossible(int $blog_id)
insertCommand(string $href, string $text, string $frame="", string $img="", string $cmd="", string $onclick="")
insert command button
getCommands()
get all current commands for a specific ref id (in the permission context of the current user)
getCommandLink(string $cmd)
Get command link url.
This describes commonalities between the different modals.