/**
  * Constructor
  */
 public function __construct($container_selector)
 {
     parent::ilBlockGUI();
     $this->container_selector = $container_selector;
     $this->plugin = new ilContainerFilterPlugin();
     $this->setTitle($this->plugin->txt('title'));
 }
 /**
  * Get bloch HTML code.
  */
 function getHTML($a_export = false)
 {
     global $ilCtrl, $lng, $ilUser, $ilAccess;
     $this->export = $a_export;
     if (!$this->export && $ilAccess->checkAccess("write", "", $_GET["ref_id"])) {
         $this->addBlockCommand($ilCtrl->getLinkTargetByClass("ilobjwikigui", "editImportantPages"), $lng->txt("edit"), "_top");
     }
     return parent::getHTML();
 }
 /**
  * @return string
  */
 public function getHTML()
 {
     ilYuiUtil::initJson();
     $chatSetting = new ilSetting('chatroom');
     if ($this->getCurrentDetailLevel() == 0 || !$chatSetting->get('chat_enabled', 0) || !(bool) @ilChatroomServerConnector::checkServerConnection()) {
         return '';
     } else {
         return parent::getHTML();
     }
 }
 public function getHTML()
 {
     global $tpl, $ilCtrl;
     if (!$ilCtrl->isAsynch()) {
         unset($_SESSION[self::getBlockType()]);
     }
     $this->initProviders();
     if (!$this->validate()) {
         return "";
     }
     $tpl->addJavaScript("Services/Classification/js/ilClassification.js");
     return parent::getHTML();
 }
 /**
  * Get block HTML code.
  */
 function getHTML($a_export = false)
 {
     global $ilCtrl, $lng, $ilAccess;
     $this->export = $a_export;
     $has_write = $ilAccess->checkAccess("write", "", $this->ref_id);
     if ($this->isHidden()) {
         #16029 - hide completely
         return;
     }
     if (!$this->export && $has_write) {
         $this->addBlockCommand($ilCtrl->getLinkTargetByClass("ilwikipagegui", "editAdvancedMetaData"), $lng->txt("edit"), "_top");
         if (!$this->isHidden()) {
             $this->addBlockCommand($ilCtrl->getLinkTargetByClass("ilwikipagegui", "hideAdvancedMetaData"), $lng->txt("hide"), "_top");
         }
         /* #16029 - moved to page actions
         			else
         			{
         				$this->addBlockCommand(
         					$ilCtrl->getLinkTargetByClass("ilwikipagegui", "unhideAdvancedMetaData"),
         					$lng->txt("show"), "_top");		
         			}			 
         			*/
     }
     return parent::getHTML();
 }
 /**
  * Fill data section
  */
 public function fillDataSection()
 {
     $this->getMails();
     $this->setData($this->mails);
     if ($this->getCurrentDetailLevel() > 1 && count($this->mails) > 0) {
         $this->setRowTemplate("tpl.pd_mail_row.html", "Services/Mail");
         if ($this->getCurrentDetailLevel() > 2) {
             $this->setColSpan(2);
         }
         parent::fillDataSection();
     } else {
         $this->setEnableNumInfo(false);
         if (count($this->mails) == 0) {
             $this->setEnableDetailRow(false);
         }
         $this->setDataSection($this->getOverview());
     }
 }
 function getHTML()
 {
     return parent::getHTML();
 }
 /**
  * block footer
  */
 function fillFooter()
 {
     global $ilCtrl, $lng, $ilUser;
     parent::fillFooter();
     if ($this->show_view_selection) {
         $this->showViewFooter();
     }
 }
 /**
  * Fill data section
  */
 function fillDataSection()
 {
     global $ilUser;
     include_once "./Services/Bookmarks/classes/class.ilBookmarkFolder.php";
     $bm_items = ilBookmarkFolder::_getNumberOfObjects();
     $this->num_bookmarks = $bm_items["bookmarks"];
     $this->num_folders = $bm_items["folders"];
     if ($this->getCurrentDetailLevel() > 1 && ($this->num_bookmarks > 0 || $this->num_folders > 0)) {
         if ($ilUser->getPref("il_pd_bkm_mode") == 'tree') {
             $this->setDataSection($this->getPDBookmarkListHTMLTree());
         } else {
             $this->setRowTemplate("tpl.bookmark_pd_list.html", "Services/Bookmarks");
             $this->getListRowData();
             $this->setColSpan(2);
             parent::fillDataSection();
         }
     } else {
         if ($this->num_bookmarks == 0 && $this->num_folders == 0) {
             $this->setEnableDetailRow(false);
         }
         $this->setDataSection($this->getOverview());
     }
 }
Exemplo n.º 10
0
 /**
  * Get bloch HTML code.
  */
 function getHTML()
 {
     global $ilCtrl, $lng, $ilUser;
     return parent::getHTML();
 }
Exemplo n.º 11
0
 /**
  * Get block HTML code.
  */
 function getHTML()
 {
     global $ilCtrl, $lng, $ilAccess, $ilUser;
     $this->poll_block->setRefId($this->getRefId());
     $this->may_write = $ilAccess->checkAccess("write", "", $this->getRefId());
     $this->has_content = $this->poll_block->hasAnyContent($ilUser->getId(), $this->getRefId());
     if (!$this->may_write && !$this->has_content) {
         return "";
     }
     $poll_obj = $this->poll_block->getPoll();
     $this->setTitle($poll_obj->getTitle());
     $this->setData(array($poll_obj));
     $ilCtrl->setParameterByClass($this->getRepositoryObjectGUIName(), "ref_id", $this->getRefId());
     if (!$this->poll_block->getMessage($ilUser->getId())) {
         // notification
         include_once "./Services/Notification/classes/class.ilNotification.php";
         if (ilNotification::hasNotification(ilNotification::TYPE_POLL, $ilUser->getId(), $this->poll_block->getPoll()->getId())) {
             $this->addBlockCommand($ilCtrl->getLinkTargetByClass(array("ilrepositorygui", $this->getRepositoryObjectGUIName()), "unsubscribe"), $lng->txt("poll_notification_unsubscribe"));
         } else {
             $this->addBlockCommand($ilCtrl->getLinkTargetByClass(array("ilrepositorygui", $this->getRepositoryObjectGUIName()), "subscribe"), $lng->txt("poll_notification_subscribe"));
         }
     }
     if ($this->may_write) {
         // edit
         $this->addBlockCommand($ilCtrl->getLinkTargetByClass(array("ilrepositorygui", $this->getRepositoryObjectGUIName()), "render"), $lng->txt("edit_content"));
         $this->addBlockCommand($ilCtrl->getLinkTargetByClass(array("ilrepositorygui", $this->getRepositoryObjectGUIName()), "edit"), $lng->txt("settings"));
         /* delete (#10993 - see ilBlockGUI)
         			$parent_id = $tree->getParentId($this->getRefId());			
         			$type = ilObject::_lookupType($parent_id, true);
         			$class = $objDefinition->getClassName($type);
         			if($class)
         			{
         				$class = "ilobj".strtolower($class)."gui";
         				$ilCtrl->setParameterByClass($class, "ref_id", $parent_id);		
         				$ilCtrl->setParameterByClass($class, "item_ref_id", $this->getRefId());	
         				$this->addBlockCommand(
         					$ilCtrl->getLinkTargetByClass($class, "delete"),
         					$lng->txt("delete"));	
         			}			 
         			*/
     }
     $ilCtrl->clearParametersByClass($this->getRepositoryObjectGUIName());
     return parent::getHTML();
 }
 /**
  * Get block HTML code.
  */
 function getHTML()
 {
     global $ilCtrl, $lng, $ilAccess, $ilUser, $tree, $objDefinition;
     $this->poll_block->setRefId($this->getRefId());
     $this->may_write = $ilAccess->checkAccess("write", "", $this->getRefId());
     $this->has_content = $this->poll_block->hasAnyContent($ilUser->getId(), $this->getRefId());
     if (!$this->may_write && !$this->has_content) {
         return "";
     }
     $poll_obj = $this->poll_block->getPoll();
     $this->setTitle($poll_obj->getTitle());
     $this->setData(array($poll_obj));
     if ($this->may_write) {
         // edit
         $ilCtrl->setParameterByClass("ilobjpollgui", "ref_id", $this->getRefId());
         $this->addBlockCommand($ilCtrl->getLinkTargetByClass(array("ilrepositorygui", "ilobjpollgui"), "render"), $lng->txt("edit_content"));
         $this->addBlockCommand($ilCtrl->getLinkTargetByClass(array("ilrepositorygui", "ilobjpollgui"), "edit"), $lng->txt("settings"));
         /* delete (#10993 - see ilBlockGUI)			
         			$parent_id = $tree->getParentId($this->getRefId());			
         			$type = ilObject::_lookupType($parent_id, true);
         			$class = $objDefinition->getClassName($type);
         			if($class)
         			{
         				$class = "ilobj".strtolower($class)."gui";
         				$ilCtrl->setParameterByClass($class, "ref_id", $parent_id);		
         				$ilCtrl->setParameterByClass($class, "item_ref_id", $this->getRefId());	
         				$this->addBlockCommand(
         					$ilCtrl->getLinkTargetByClass($class, "delete"),
         					$lng->txt("delete"));	
         			}			 
         			*/
         $ilCtrl->clearParametersByClass("ilobjpollgui");
     }
     return parent::getHTML();
 }
 /**
  * Fill data section
  */
 function fillDataSection()
 {
     global $ilUser;
     include_once "Services/Notes/classes/class.ilNote.php";
     $this->notes = ilNote::_getLastNotesOfUser();
     if ($this->getCurrentDetailLevel() > 1 && count($this->notes) > 0) {
         $this->setRowTemplate("tpl.pd_notes_overview.html", "Services/Notes");
         $this->getListRowData();
         //$this->setColSpan(2);
         parent::fillDataSection();
     } else {
         $this->setEnableNumInfo(false);
         if (count($this->notes) == 0) {
             $this->setEnableDetailRow(false);
         }
         $this->setDataSection($this->getOverview());
     }
 }
Exemplo n.º 14
0
 /**
  * Get bloch HTML code.
  */
 function getHTML()
 {
     global $ilCtrl, $lng, $ilUser, $ilAccess;
     if ($this->getCurrentDetailLevel() == 0) {
         return "";
     }
     // add edit commands
     #if ($this->getEnableEdit())
     if ($this->mode == ilCalendarCategories::MODE_PERSONAL_DESKTOP_ITEMS or $this->mode == ilCalendarCategories::MODE_PERSONAL_DESKTOP_MEMBERSHIP) {
         include_once "./Services/News/classes/class.ilRSSButtonGUI.php";
         $this->addBlockCommand($this->ctrl->getLinkTarget($this, 'showCalendarSubscription'), $lng->txt('ical_export'), "", "", true, false, ilRSSButtonGUI::get(ilRSSButtonGUI::ICON_ICAL));
     }
     if ($this->mode == ilCalendarCategories::MODE_REPOSITORY) {
         if (!isset($_GET["bkid"])) {
             if ($ilAccess->checkAccess('edit_event', '', (int) $_GET['ref_id'])) {
                 $ilCtrl->setParameter($this, "add_mode", "block");
                 $this->addBlockCommand($ilCtrl->getLinkTargetByClass("ilCalendarAppointmentGUI", "add"), $lng->txt("add_appointment"));
                 $ilCtrl->setParameter($this, "add_mode", "");
             }
             global $ilObjDataCache;
             include_once "Modules/Course/classes/class.ilCourseParticipants.php";
             $obj_id = $ilObjDataCache->lookupObjId((int) $_GET['ref_id']);
             $participants = ilCourseParticipants::_getInstanceByObjId($obj_id);
             $users = array_unique(array_merge($participants->getTutors(), $participants->getAdmins()));
             //$users = $participants->getParticipants();
             include_once 'Services/Booking/classes/class.ilBookingEntry.php';
             //$users = ilBookingEntry::isBookable($users, $obj_id);
             $users = ilBookingEntry::lookupBookableUsersForObject($obj_id, $users);
             if ($users) {
                 foreach ($users as $user_id) {
                     if (!isset($_GET["bkid"])) {
                         $ilCtrl->setParameter($this, "bkid", $user_id);
                         $this->addBlockCommand($ilCtrl->getLinkTargetByClass("ilCalendarMonthGUI", ""), $lng->txt("cal_consultation_hours_for") . ' ' . ilObjUser::_lookupFullname($user_id));
                         $this->cal_footer[] = array('link' => $ilCtrl->getLinkTargetByClass('ilCalendarMonthGUI', ''), 'txt' => $lng->txt("cal_consultation_hours_for") . ' ' . ilObjUser::_lookupFullname($user_id));
                     }
                 }
                 $ilCtrl->setParameter($this, "bkid", "");
             }
         } else {
             $ilCtrl->setParameter($this, "bkid", "");
             $this->addBlockCommand($ilCtrl->getLinkTarget($this), $lng->txt("back"));
             $ilCtrl->setParameter($this, "bkid", (int) $_GET["bkid"]);
         }
     }
     if ($this->getProperty("settings") == true) {
         $this->addBlockCommand($ilCtrl->getLinkTarget($this, "editSettings"), $lng->txt("settings"));
     }
     $ilCtrl->setParameterByClass("ilcolumngui", "seed", isset($_GET["seed"]) ? $_GET["seed"] : "");
     $ret = parent::getHTML();
     $ilCtrl->setParameterByClass("ilcolumngui", "seed", "");
     return $ret;
 }
Exemplo n.º 15
0
 function getHTML()
 {
     // workaround to show details row
     $this->setData(array("dummy"));
     if ($this->getCurrentDetailLevel() == 0) {
         return "";
     } else {
         return parent::getHTML();
     }
 }
 /**
  * Fill data section
  */
 function fillDataSection()
 {
     global $ilAccess, $ilUser, $tree;
     include_once 'Services/Feedback/classes/class.ilFeedback.php';
     $feedback = new ilFeedback();
     $feedbacks = $feedback->getAllBarometer(0);
     $this->feedbacks = array();
     foreach ($feedbacks as $feedback) {
         if ($tree->isDeleted($feedback->getRefId())) {
             continue;
         }
         // do not show feedback for tutors/admins
         if (!$ilAccess->checkAccess("write", "", $feedback->getRefId()) && $feedback->canVote($ilUser->getId(), $feedback->getId()) == 1 && !$feedback->getAnonymous()) {
             $this->feedbacks[] = array("id" => $feedback->getId(), "title" => $feedback->getTitle());
         }
     }
     $this->setData($this->feedbacks);
     if ($this->getCurrentDetailLevel() > 1 && count($this->feedbacks) > 0) {
         $this->setRowTemplate("tpl.feedback_pdbox.html", "Services/Feedback");
         parent::fillDataSection();
     } else {
         $this->setEnableNumInfo(false);
         $this->setDataSection($this->getOverview());
     }
 }
 /**
  * Fill data section
  */
 function fillDataSection()
 {
     global $ilUser, $ilSetting, $ilCtrl;
     $pd_set = new ilSetting("pd");
     include_once "Services/Notes/classes/class.ilNote.php";
     if ($this->getCurrentDetailLevel() > 1 && $this->num_users > 0) {
         $this->setRowTemplate("tpl.users_online_row.html", "Services/PersonalDesktop");
         $this->getListRowData();
         if ($this->getCurrentDetailLevel() > 2) {
             $this->setColSpan(2);
         }
         parent::fillDataSection();
     } else {
         $this->setEnableNumInfo(false);
         $this->setDataSection($this->getOverview());
     }
 }
Exemplo n.º 18
0
 /**
  * Get bloch HTML code.
  */
 function getHTML()
 {
     global $ilCtrl, $lng, $ilUser;
     // set footer info
     $this->setFooterInfo($lng->txt("news_block_information"), true);
     $news_set = new ilSetting("news");
     $enable_internal_rss = $news_set->get("enable_rss_for_internal");
     $allow_shorter_periods = $news_set->get("allow_shorter_periods");
     $allow_longer_periods = $news_set->get("allow_longer_periods");
     $enable_private_feed = $news_set->get("enable_private_feed");
     // subscribe/unsibscribe link
     include_once "./Services/News/classes/class.ilNewsSubscription.php";
     // show feed url
     if ($enable_internal_rss) {
         include_once "./Services/News/classes/class.ilRSSButtonGUI.php";
         $this->addBlockCommand($ilCtrl->getLinkTarget($this, "showFeedUrl"), $lng->txt("news_get_feed_url"), "", "", true, false, ilRSSButtonGUI::get(ilRSSButtonGUI::ICON_RSS));
     }
     if ($allow_shorter_periods || $allow_longer_periods || $enable_private_feed) {
         $this->addBlockCommand($ilCtrl->getLinkTarget($this, "editSettings"), $lng->txt("settings"));
     }
     $per = ilNewsItem::_lookupUserPDPeriod($ilUser->getId());
     if ($per > 0) {
         switch ($per) {
             case 2:
             case 3:
             case 5:
                 $per_str = sprintf($lng->txt("news_period_x_days"), $per);
                 break;
             case 7:
                 $per_str = $lng->txt("news_period_1_week");
                 break;
             case 14:
                 $per_str = sprintf($lng->txt("news_period_x_weeks"), 2);
                 break;
             case 30:
                 $per_str = $lng->txt("news_period_1_month");
                 break;
             case 60:
                 $per_str = sprintf($lng->txt("news_period_x_months"), 2);
                 break;
             case 120:
                 $per_str = sprintf($lng->txt("news_period_x_months"), 4);
                 break;
             case 180:
                 $per_str = sprintf($lng->txt("news_period_x_months"), 6);
                 break;
             case 366:
                 $per_str = $lng->txt("news_period_1_year");
                 break;
         }
         if ($per_str != "") {
             $this->setTitle($this->getTitle() . ' <span style="font-weight:normal;">- ' . $per_str . "</span>");
         }
     }
     if ($this->getCurrentDetailLevel() == 0) {
         return "";
     }
     $en = "";
     if ($ilUser->getPref("il_feed_js") == "n") {
         $en = $this->getJSEnabler();
     }
     return ilBlockGUI::getHTML() . $en;
 }
Exemplo n.º 19
0
 /**
  * Get block HTML code.
  */
 function getHTML()
 {
     global $ilCtrl, $lng, $ilUser, $ilAccess, $ilSetting;
     return parent::getHTML();
 }
 function getHTML()
 {
     global $ilCtrl, $ilSetting, $tpl, $lng, $ilHelp, $ilDB;
     $ilDB->useSlave(true);
     // both views are activated (show buttons)
     if ($ilSetting->get('disable_my_offers') == 0 && $ilSetting->get('disable_my_memberships') == 0) {
         /*			$ilCtrl->setParameter($this, 'block_type', $this->getBlockType());			
         			$ilCtrl->setParameter($this, 'view', self::VIEW_MY_OFFERS);
         			$this->addHeaderLink($ilCtrl->getLinkTarget($this, 'changeView'), $this->lng->txt('pd_my_offers'),
         				($this->view == self::VIEW_MY_OFFERS ? false : true) 
         			);
         			$ilCtrl->setParameter($this, 'view', self::VIEW_MY_MEMBERSHIPS);
         			$this->addHeaderLink($ilCtrl->getLinkTarget($this, 'changeView'), $this->lng->txt('pd_my_memberships'),
         				($this->view == self::VIEW_MY_MEMBERSHIPS ? false : true) 
         			);
         			$ilCtrl->clearParameters($this);*/
     }
     // workaround to show details row
     $this->setData(array("dummy"));
     include_once "Services/Object/classes/class.ilObjectListGUI.php";
     ilObjectListGUI::prepareJSLinks("", $ilCtrl->getLinkTargetByClass(array("ilcommonactiondispatchergui", "ilnotegui"), "", "", true, false), $ilCtrl->getLinkTargetByClass(array("ilcommonactiondispatchergui", "iltagginggui"), "", "", true, false));
     switch ((int) $this->view) {
         case self::VIEW_MY_MEMBERSHIPS:
             $ilHelp->setDefaultScreenId(ilHelpGUI::ID_PART_SCREEN, "crs_grp");
             if ($ilSetting->get('disable_my_offers') == 0) {
                 $tpl->setTitle($lng->txt("my_courses_groups"));
             }
             $this->setTitle($this->lng->txt('pd_my_memberships'));
             $this->setContent($this->getMembershipItemsBlockHTML());
             break;
         case self::VIEW_MY_OFFERS:
         default:
             $ilHelp->setDefaultScreenId(ilHelpGUI::ID_PART_SCREEN, "sel_items");
             if (!in_array(self::VIEW_MY_MEMBERSHIPS, $this->allowed_views)) {
                 $this->setTitle($this->lng->txt('selected_items'));
             } else {
                 $this->setTitle($this->lng->txt('pd_my_offers'));
             }
             $this->setContent($this->getSelectedItemsBlockHTML());
             break;
     }
     if ($this->getContent() == "") {
         $this->setEnableDetailRow(false);
     }
     $ilCtrl->clearParametersByClass("ilpersonaldesktopgui");
     $ilCtrl->clearParameters($this);
     $ilDB->useSlave(false);
     return parent::getHTML();
 }
 /**
  * Get block HTML code.
  */
 function getHTML()
 {
     global $ilCtrl, $lng, $ilUser, $ilAccess, $ilSetting;
     $this->getCalendars();
     return parent::getHTML();
 }