Beispiel #1
0
function category_list($message = "")
{
    global $use_sections, $use_categories;
    pagetop(gTxt('categories'), $message);
    $out = array('<table cellspacing="20" align="center">', '<tr>', $use_categories ? tdtl(article_list(), ' class="categories"') : '', tdtl(link_list(), ' class="categories"'), tdtl(image_list(), ' class="categories"'), '</tr>', endTable());
    echo join(n, $out);
}
Beispiel #2
0
 function thumbnail_insert_post()
 {
     global $img_dir;
     $id = $this->psi('id');
     $file = $_FILES['thefile']['tmp_name'];
     $name = $_FILES['thefile']['name'];
     $file = get_uploaded_file($file);
     list(, , $extension) = @getimagesize($file);
     if ($file !== false && $this->extensions[$extension]) {
         $ext = $this->extensions[$extension];
         $newpath = IMPATH . $id . 't' . $ext;
         if (shift_uploaded_file($file, $newpath) == false) {
             image_list($newpath . sp . gTxt('upload_dir_perms'));
         } else {
             chmod($newpath, 0644);
             safe_update("txp_image", "thumbnail = 1", "id = {$id}");
             update_lastmod();
             $this->_message(gTxt('image_uploaded', array('{name}' => $name)));
             $this->_set_view('edit', $id);
         }
     } else {
         if ($file === false) {
             $this->_error(upload_get_errormsg($_FILES['thefile']['error']));
             $this->_set_view('edit', $id);
         } else {
             $this->_error(gTxt('only_graphic_files_allowed'));
             $this->_set_view('edit', $id);
         }
     }
 }
Beispiel #3
0
function page_template($content)
{
    $image_list = image_list();
    return "\n    <!DOCTYPE html>\n    <html lang=\"en\">\n      <head>\n        <meta charset=\"utf-8\">\n        <meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\">\n        <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n        <!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->\n        <title>Black Ribbon Movement Myanamr 2015</title>\n        <!-- Bootstrap -->\n        <link href=\"https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css\" rel=\"stylesheet\">\n\n        <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->\n        <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->\n        <!--[if lt IE 9]>\n          <script src=\"https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js\"></script>\n          <script src=\"https://oss.maxcdn.com/respond/1.4.2/respond.min.\"></script>\n        <![endif]-->\n      </head>\n      <body>\n        <div class=\"container\">\n            <div class=\"col-md-6 col-md-offset-3\">\n                <h3>Black Ribbon Movement Myanmar 2015</h3>\n                {$content}\n                {$image_list}\n                <hr />\n                Developed for Myanmar People with national spirit and passion at Yangon, Myanmar.<br />\n                Developed by poohspear.\n            </div>\n        </div>\n        <!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->\n        <script src=\"https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js\"></script>\n        <!-- Include all compiled plugins (below), or include individual files as needed -->\n        <script src=\"https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js\"></script>\n      </body>\n    </html>\n    ";
}
Beispiel #4
0
function thumbnail_delete()
{
    global $txp_user;
    $id = assert_int(gps('id'));
    $author = fetch('author', 'txp_image', 'id', $id);
    if (!has_privs('image.edit') && !($author === $txp_user && has_privs('image.edit.own'))) {
        image_list(gTxt('restricted_area'));
        return;
    }
    $t = new txp_thumb($id);
    if ($t->delete()) {
        callback_event('thumbnail_deleted', '', false, $id);
        update_lastmod();
        image_edit(gTxt('thumbnail_deleted'), $id);
    } else {
        image_edit(array(gTxt('thumbnail_delete_failed'), E_ERROR), $id);
    }
}
Beispiel #5
0
function image_change_pageby()
{
    event_change_pageby('image');
    image_list();
}
Beispiel #6
0
function image_change_pageby()
{
    $qty = gps('qty');
    safe_update('txp_prefs', "val={$qty}", "name='image_list_pageby'");
    image_list();
}
Beispiel #7
0
    switch($mod) {
        case 'log':
            image_logs($itemid);
            break;
        case 'edit':
            image_edit($target_uuid, $type, $itemid);
            break;
        case 'convert':
            image_convert();
            break;
        default:
            if (empty($type)) {
                image_list($type, _T("Available images", "imaging"));
            }
            image_list($type, _T("Available masters", "imaging"), false);
            break;
    }
} else {
    /* register the target (computer or profile) */
    $params = array('target_uuid'=>$target_uuid, 'type'=>$type, 'from'=>"services", "target_name"=>$target_name);
    header("Location: " . urlStrRedirect("base/computers/".$type."register_target", $params));
    exit;
}

function image_edit($target_uuid, $type, $item_uuid) {
    $params = getParams();
    $target_uuid = $_GET['target_uuid'];
    $label = urldecode($_GET['itemlabel']);

    list($succed, $image) = xmlrpc_getTargetImage($target_uuid, $type, $item_uuid);