예제 #1
0
 function atomCreatedBy($resource)
 {
     return htmlspecialchars(html_entity_decode(ditto::getAuthor($resource['createdby']), ENT_QUOTES));
 }
예제 #2
0
            include $filevalue;
        } else {
            if ($filename == "language") {
                $modx->logEvent(1, 3, "Language file does not exist Please check: " . $filevalue, "Ditto " . $ditto_version);
                return "Language file does not exist Please check: " . $filevalue;
            } else {
                $modx->logEvent(1, 3, $filevalue . " " . $_lang['file_does_not_exist'], "Ditto " . $ditto_version);
                return $filevalue . " " . $_lang['file_does_not_exist'];
            }
        }
    }
}
//---Initiate Class-------------------------------------------------- //
if (class_exists('ditto')) {
    $dbg_templates = isset($dbg_templates) ? $dbg_templates : NULL;
    $ditto = new ditto($dittoID, $format, $_lang, $dbg_templates);
    // create a new Ditto instance in the specified format and language with the requested debug level
} else {
    $modx->logEvent(1, 3, $_lang['invalid_class'], "Ditto " . $ditto_version);
    return $_lang['invalid_class'];
}
//---Initiate Extenders---------------------------------------------- //
if (isset($tagData)) {
    $extenders[] = "tagging";
}
if (count($extenders) > 0) {
    $extenders = array_unique($extenders);
    foreach ($extenders as $extender) {
        if (substr($extender, 0, 5) != "@FILE") {
            $extender_path = $ditto_base . "extenders/" . $extender . ".extender.inc.php";
        } else {
 function tagLinks($tags, $tagDelimiter, $tagID = false, $format = "html")
 {
     global $ditto_lang, $modx;
     if (count($tags) == 0 && $format == "html") {
         return $ditto_lang['none'];
     } else {
         if (count($tags) == 0 && ($format == "rss" || $format == "xml" || $format == "xml")) {
             return "<category>" . $ditto_lang['none'] . "</category>";
         }
     }
     $output = "";
     if ($this->sort) {
         ksort($tags);
     }
     // set templates array
     $tplRss = "\r\n" . "\t\t\t\t<category>[+tag+]</category>";
     $tpl = $this->tpl == false ? '<a href="[+url+]" class="ditto_tag" rel="tag">[+tag+]</a>' : $this->tpl;
     $tpl = ($format == "rss" || $format == "xml" || $format == "atom") && $templates['user'] == false ? $tplRss : $tpl;
     if ($this->displayMode == 1) {
         foreach ($tags as $tag) {
             $tagDocID = !$tagID ? $modx->documentObject['id'] : $tagID;
             $url = ditto::buildURL("tags={$tag}&start=0", $tagDocID);
             $output .= template::replace(array('url' => $url, 'tag' => $tag), $tpl);
             $output .= $format != "rss" && $format != "xml" && $format != "atom" ? $this->displayDelimiter : '';
         }
     } else {
         if ($format != "rss" && $format != "xml" && $format != "atom" && $this->displayMode == 2) {
             $tagList = array();
             foreach ($tags as $tag) {
                 $tagDocID = !$tagID ? $modx->documentObject['id'] : $tagID;
                 $url = ditto::buildURL("tags={$tag}&start=0", $tagDocID);
                 $tagList[] = template::replace(array('url' => $url, 'tag' => $tag), $tpl);
             }
             $output = $modx->makeList($tagList, $ulroot = 'ditto_tag_list', $ulprefix = 'ditto_tag_', $type = '', $ordered = false, $tablevel = 0);
         }
     }
     return $format != "rss" && $format != "xml" && $format != "atom" ? substr($output, 0, -1 * strlen($this->displayDelimiter)) : $output;
 }