19declare(strict_types=1);
36 $this->blog_service =
$DIC->blog()->internal();
39 public function init(): void
41 $this->copy_enabled =
true;
42 $this->delete_enabled =
true;
43 $this->cut_enabled =
true;
44 $this->subscribe_enabled =
true;
45 $this->link_enabled =
true;
46 $this->info_screen_enabled =
true;
48 $this->gui_class_name =
"ilobjbloggui";
59 $permissions = array();
61 if ($item[
"lang_var"] ===
"edit" && $item[
"granted"]) {
62 $permissions[$item[
"permission"]] = $idx;
65 if (count($permissions) === 2) {
66 unset(
$commands[$permissions[
"contribute"]]);
82 $tpl = $this->
ui->mainTemplate();
86 ->isCommentsExportPossible($this->obj_id);
89 && (
bool) $this->
settings->get(
'item_cmd_asynch')) {
91 $cmd =
"forwardExport";
94 if ($cmd !==
"export" || !$export_possible) {
95 parent::insertCommand($href,
$text, $frame, $img, $cmd, $onclick);
100 $chksum = md5($href .
$text);
102 !in_array($chksum, $this->prevent_duplicate_commands)) {
104 $this->prevent_duplicate_commands[] = $chksum;
107 $prevent_background_click =
false;
109 if ($export_possible) {
112 $signal = $modal[
"show"];
113 $tpl->addJavaScript(
'assets/js/blog.js');
114 $tpl->addOnLoadCode(
'il.blog.setModalTemplate("' . $signal .
'", "' . addslashes(json_encode($modal[
"template"])) .
'");');
117 $action = $this->
ui->factory()
121 $action = $action->withOnLoadCode(
function (
$id) use ($onclick, $signal):
string {
122 return "document.getElementById('$id').addEventListener('click', (event) => {event.preventDefault(); il.blog.showModal('$signal');});";
124 $this->current_actions[] = $action;
134 $comment_export_helper = new \ILIAS\Notes\Export\ExportHelperGUI();
135 $this->
lng->loadLanguageModule(
"note");
136 $modal = $comment_export_helper->getCommentIncludeModalDialog(
138 $this->
lng->txt(
"note_html_export_include_comments"),
139 $this->getCommandLink(
"export"),
140 $this->getCommandLink(
"exportWithComments")
143 $modalt[
"show"] = $modal->getShowSignal()->getId();
144 $modalt[
"close"] = $modal->getCloseSignal()->getId();
145 $modalt[
"template"] = $ui->renderer()->renderAsync($modal);
152 if ($this->context == self::CONTEXT_REPOSITORY || $this->context == self::CONTEXT_SEARCH) {
159 case "exportWithComments":
160 $this->
ctrl->setParameterByClass(ilObjBlogGUI::class, $id_par, $this->ref_id);
161 return $this->
ctrl->getLinkTargetByClass(
162 [ilObjBlogGUI::class, \
ILIAS\Blog\Export\ExportGUI::class],
166 $this->
ctrl->setParameterByClass(ilObjBlogGUI::class, $id_par, $this->ref_id);
167 return $this->
ctrl->getLinkTargetByClass(
168 [ilObjBlogGUI::class, \
ILIAS\Blog\Editing\EditingGUI::class],
173 $this->
ctrl->setParameterByClass(ilObjBlogGUI::class, $id_par, $this->ref_id);
174 return $this->
ctrl->getLinkTargetByClass(
175 [ilObjBlogGUI::class, \
ILIAS\Blog\Presentation\PresentationGUI::class],
180 return parent::getCommandLink($cmd);
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
static _getCommands()
get commands
insertCommand(string $href, string $text, string $frame="", string $img="", string $cmd="", string $onclick="")
insert command button
__construct(int $context=self::CONTEXT_REPOSITORY)
getCommandLink(string $cmd)
ILIAS Blog InternalService $blog_service
getCommands()
get all current commands for a specific ref id (in the permission context of the current user)
This describes commonalities between the different modals.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
Interface Observer \BackgroundTasks Contains several chained tasks and infos about them.