Exemple #1
0
function GetDocHTML($doc_id)
{
    $objResponse = new xajaxResponse();
    if (hasPermissions('docs')) {
        $doc = docs::getDoc($doc_id);
        $sec = docs_sections::getSection($doc['docs_sections_id']);
        $doc['section_name'] = $sec['name'];
        $page = $_SERVER['DOCUMENT_ROOT'] . '/service/docs/admin_docs_line.php';
        ob_start();
        include $page;
        $html = ob_get_contents();
        ob_end_clean();
        $html = str_replace("\n", '', $html);
        $objResponse->script('$("doc_line_' . $doc_id . '").set("html", "' . addslashes($html) . '")');
        $objResponse->script("\$('doc_line_{$doc_id}').removeClass('orng')");
    }
    return $objResponse;
}
Exemple #2
0
     if ($is_category = is_array($categories) && count($categories)) {
         $block = $i = 0;
         foreach ($categories as $cat) {
             $cat_blocks[$block][] = $cat;
             ++$i;
             if ($i >= 4) {
                 $i = 0;
                 ++$block;
             }
         }
     }
     $last_docs = docs::getLast(10);
     break;
 case 'section':
     $content = 'section.php';
     $section = docs_sections::getSection((int) $request['id']);
     $docs = docs::getDocs((int) $request['id']);
     break;
 case 'document':
     $content = 'document.php';
     $doc = docs::getDoc($request['id']);
     break;
 case 'search':
     $content = 'search.php';
     $text_for_search = !empty($request['text']) ? $request['text'] : false;
     if ($text_for_search) {
         $text_for_search = stripslashes($text_for_search);
         $text_for_search = preg_replace('/"/', '', $text_for_search);
         $text_for_search = preg_replace("/'/", '', $text_for_search);
         $text_for_search = ereg_replace(' +', ' ', $text_for_search);
         $text_for_search = trim($text_for_search);