Example #1
0
 public function getTitleTitle()
 {
     $o = new self();
     return $o->getTitle();
 }
 /**
  * Deliver blog as rss feed
  * 
  * @param int $a_wsp_id
  */
 static function deliverRSS($a_wsp_id)
 {
     global $tpl, $ilSetting;
     if (!$ilSetting->get('enable_global_profiles')) {
         return;
     }
     // #10827
     if (substr($a_wsp_id, -4) != "_cll") {
         include_once "Services/PersonalWorkspace/classes/class.ilWorkspaceTree.php";
         $wsp_id = new ilWorkspaceTree(0);
         $obj_id = $wsp_id->lookupObjectId($a_wsp_id);
         $is_wsp = "_wsp";
     } else {
         $a_wsp_id = substr($a_wsp_id, 0, -4);
         $obj_id = ilObject::_lookupObjId($a_wsp_id);
         $is_wsp = null;
     }
     if (!$obj_id) {
         return;
     }
     $blog = new self($obj_id, false);
     if (!$blog->hasRSS()) {
         return;
     }
     include_once "Services/Feeds/classes/class.ilFeedWriter.php";
     $feed = new ilFeedWriter();
     include_once "Services/Link/classes/class.ilLink.php";
     $url = ilLink::_getStaticLink($a_wsp_id, "blog", true, $is_wsp);
     $url = str_replace("&", "&", $url);
     $feed->setChannelTitle($blog->getTitle());
     $feed->setChannelDescription($blog->getDescription());
     $feed->setChannelLink($url);
     // needed for blogpostinggui / pagegui
     $tpl = new ilTemplate("tpl.main.html", true, true);
     include_once "./Modules/Blog/classes/class.ilBlogPosting.php";
     include_once "./Modules/Blog/classes/class.ilBlogPostingGUI.php";
     foreach (ilBlogPosting::getAllPostings($obj_id) as $item) {
         $id = $item["id"];
         // only published items
         $is_active = ilBlogPosting::_lookupActive($id, "blp");
         if (!$is_active) {
             continue;
         }
         $snippet = strip_tags(ilBlogPostingGUI::getSnippet($id));
         $snippet = str_replace("&", "&", $snippet);
         $url = ilLink::_getStaticLink($a_wsp_id, "blog", true, "_" . $id . $is_wsp);
         $url = str_replace("&", "&", $url);
         $feed_item = new ilFeedItem();
         $feed_item->setTitle($item["title"]);
         $feed_item->setDate($item["created"]->get(IL_CAL_DATETIME));
         $feed_item->setDescription($snippet);
         $feed_item->setLink($url);
         $feed_item->setAbout($url);
         $feed->addItem($feed_item);
     }
     $feed->showFeed();
     exit;
 }
 public function sendFeedbackNotifications($a_ass_id)
 {
     global $ilDB;
     $ass = new self($a_ass_id);
     // valid assignment?
     if (!$ass->hasFeedbackCron() || !$ass->getFeedbackFile()) {
         return false;
     }
     // already done?
     $set = $ilDB->query("SELECT fb_cron_done" . " FROM exc_assignment" . " WHERE id = " . $ilDB->quote($a_ass_id, "integer"));
     $row = $ilDB->fetchAssoc($set);
     if ($row["fb_cron_done"]) {
         return false;
     }
     include_once "./Services/Notification/classes/class.ilSystemNotification.php";
     $ntf = new ilSystemNotification();
     $ntf->setLangModules(array("exc"));
     $ntf->setObjId($ass->getExerciseId());
     $ntf->setSubjectLangId("exc_feedback_notification_subject");
     $ntf->setIntroductionLangId("exc_feedback_notification_body");
     $ntf->addAdditionalInfo("exc_assignment", $ass->getTitle());
     $ntf->setGotoLangId("exc_feedback_notification_link");
     $ntf->setReasonLangId("exc_feedback_notification_reason");
     include_once "./Modules/Exercise/classes/class.ilExerciseMembers.php";
     $ntf->sendMail(ilExerciseMembers::_getMembers($ass->getExerciseId()));
     $ilDB->manipulate("UPDATE exc_assignment" . " SET fb_cron_done = " . $ilDB->quote(1, "integer") . " WHERE id = " . $ilDB->quote($a_ass_id, "integer"));
     return true;
 }
Example #4
0
 public function displayParentName()
 {
     $ret = '';
     $parentId = $this->has('parent') ? $this->getParent() : false;
     if ($parentId) {
         $parent = new self();
         $parent->ignoreAccessControl = true;
         $parent->loadByPK($parentId);
         $ret .= '<span class="badge">' . strtolower($parent->getTitle()) . '</span>';
     }
     $ret .= ' <span class="title">' . clean($this->title) . '</span>';
     return $ret;
 }