public static function getHTML_Metadata(EAL_LearnOut $lo)
 {
     // Level-Table
     $res = sprintf("<div>%s</div><br/>", CPT_Object::getLevelHTML("lo" . $lo->id, $lo->level, null, "disabled", 0, ''));
     // Taxonomy Terms: Name of Taxonomy and list of terms (if available)
     $res .= sprintf("<div><b>%s</b>:", RoleTaxonomy::getDomains()[$lo->domain]);
     $terms = wp_get_post_terms($lo->id, $lo->domain, array("fields" => "names"));
     if (count($terms) > 0) {
         $res .= sprintf("<div style='margin-left:1em'>");
         foreach ($terms as $t) {
             $res .= sprintf("%s</br>", $t);
         }
         $res .= sprintf("</div>");
     }
     $res .= sprintf("</div>");
     return $res;
 }
Beispiel #2
0
    public static function getHTML_Metadata(EAL_Item $item, $editable, $namePrefix)
    {
        // Status and Id
        $res = sprintf("<div>%s (%d)</div><br/>", $item->getStatusString(), $item->id);
        // Learning Outcome (Title + Description), if available
        $learnout = $item->getLearnOut();
        if ($editable) {
            $res .= sprintf("<div>%s</div>", EAL_LearnOut::getListOfLearningOutcomes($learnout == null ? 0 : $learnout->id, $namePrefix));
        } else {
            if (!is_null($learnout)) {
                $res .= sprintf("<div><b>%s</b>: %s</div><br/>", $learnout->title, $learnout->description);
            }
        }
        // Level-Table
        $res .= sprintf("<div>%s</div><br/>", CPT_Object::getLevelHTML($namePrefix, $item->level, is_null($learnout) ? null : $learnout->level, $editable ? "" : "disabled", 1, ''));
        // Taxonomy Terms: Name of Taxonomy and list of terms (if available)
        $res .= sprintf("<div><b>%s</b>:", RoleTaxonomy::getDomains()[$item->domain]);
        if ($editable) {
            $res .= sprintf('
				<div class="inside">
					<div class="categorydiv">
						<div id="topic-all" class="tabs-panel"><input type="hidden" name="%1$s_taxonomy[]" value="0">
							<ul id="topicchecklist" data-wp-lists="list:topic" class="categorychecklist form-no-clear">
							%2$s
							</ul>
						</div>
					</div>
				</div>', $namePrefix, CPT_Item::getHTML_TopicHierarchy($namePrefix, get_terms(array('taxonomy' => $item->domain, 'hide_empty' => false)), 0, wp_get_post_terms($item->id, $item->domain, array("fields" => "ids"))));
        } else {
            $terms = wp_get_post_terms($item->id, $item->domain, array("fields" => "names"));
            if (count($terms) > 0) {
                $res .= sprintf("<div style='margin-left:1em'>");
                foreach ($terms as $t) {
                    $res .= sprintf("%s</br>", $t);
                }
                $res .= sprintf("</div>");
            }
        }
        $res .= sprintf("</div>");
        return $res;
    }
Beispiel #3
0
 public static function getHTML_Review(EAL_Review $review)
 {
     // Titel
     $review_html = sprintf("\r\n\t\t\t<div onmouseover=\"this.children[1].style.display='inline';\"  onmouseout=\"this.children[1].style.display='none';\">\r\n\t\t\t\t<h1 style='display:inline'>[%s]</span></h1>\r\n\t\t\t\t<div style='display:none'>\r\n\t\t\t\t\t<span><a href=\"post.php?action=edit&post=%d\">Edit</a></span>\r\n\t\t\t\t</div>\r\n\t\t\t</div>", $review->getItem()->title, $review->id);
     // Scores + Feedback
     $review_html .= sprintf("<div>%s</div>", CPT_Review::getHTML_Score($review, FALSE));
     $review_html .= sprintf("<div>%s</div>", wpautop(stripslashes($review->feedback)));
     // Overall Rating + Level
     $overall_String = "";
     switch ($review->overall) {
         case 1:
             $overall_String = "Item akzeptiert";
             break;
         case 2:
             $overall_String = "Item Item &uuml;berarbeiten";
             break;
         case 3:
             $overall_String = "Item abgelehnt";
             break;
     }
     $review_meta = sprintf("<div><b>%s</b></div><br />", $overall_String);
     $review_meta .= sprintf("<div>%s</div><br/>", CPT_Object::getLevelHTML('review_' . $review->id, $review->level, $review->getItem()->level, "disabled", 1, ''));
     return sprintf("\r\n\t\t\t<div id='poststuff'>\r\n\t\t\t\t<div id='post-body' class='metabox-holder columns-2'>\r\n\t\t\t\t\t<div class='postbox-container' id='postbox-container-2'>\r\n\t\t\t\t\t\t<div class='meta-box-sortables ui-sortable'>\r\n\t\t\t\t\t\t\t%s\r\n\t\t\t\t\t\t</div>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t\t<div class='postbox-container' id='postbox-container-1'>\r\n\t\t\t\t\t\t<div style='background-color:#FFFFFF; margin-top:1em; padding:1em; border-width:1px; border-style:solid; border-color:#CCCCCC;'>\r\n\t\t\t\t\t\t\t%s\r\n\t\t\t\t\t\t</div>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t</div>\r\n\t\t\t</div>", $review_html, $review_meta);
 }