Beispiel #1
0
 public static function adminPostFormItems($main, $sidebar, $post)
 {
     if ($post !== null) {
         $core =& $GLOBALS['core'];
         $post_media = $core->media->getPostMedia($post->post_id);
         $nb_media = count($post_media);
         $title = !$nb_media ? __('Attachments') : sprintf(__('Attachments (%d)'), $nb_media);
         $item = '<h5 class="clear s-attachments">' . $title . '</h5>';
         foreach ($post_media as $f) {
             $ftitle = $f->media_title;
             if (strlen($ftitle) > 18) {
                 $ftitle = substr($ftitle, 0, 16) . '...';
             }
             $item .= '<div class="media-item s-attachments">' . '<a class="media-icon" href="' . $core->adminurl->get('admin.media.item', array('id' => $f->media_id)) . '">' . '<img src="' . $f->media_icon . '" alt="" title="' . $f->basename . '" /></a>' . '<ul>' . '<li><a class="media-link" href="' . $core->adminurl->get('admin.media.item', array('id' => $f->media_id)) . '" ' . 'title="' . $f->basename . '">' . $ftitle . '</a></li>' . '<li>' . $f->media_dtstr . '</li>' . '<li>' . files::size($f->size) . ' - ' . '<a href="' . $f->file_url . '">' . __('open') . '</a>' . '</li>' . '<li class="media-action"><a class="attachment-remove" id="attachment-' . $f->media_id . '" ' . 'href="' . $core->adminurl->get('admin.post.media', array('post_id' => $post->post_id, 'media_id' => $f->media_id, 'remove' => '1')) . '">' . '<img src="images/trash.png" alt="' . __('remove') . '" /></a>' . '</li>' . '</ul>' . '</div>';
         }
         unset($f);
         if (empty($post_media)) {
             $item .= '<p class="form-note s-attachments">' . __('No attachment.') . '</p>';
         }
         $item .= '<p class="s-attachments"><a class="button" href="' . $core->adminurl->get('admin.media', array('post_id' => $post->post_id)) . '">' . __('Add files to this entry') . '</a></p>';
         $sidebar['metas-box']['items']['attachments'] = $item;
     }
 }
Beispiel #2
0
echo '<div class="fieldset"><h3>' . __('Customization') . '</h3>' . '<h4>' . __('General') . '</h4>';
if ($can_write_images) {
    echo '<p class="field"><label for="body_bg_c">' . __('Background color:') . '</label> ' . form::field('body_bg_c', 7, 7, $blowup_user['body_bg_c'], 'colorpicker') . '</p>' . '<p class="field"><label for="body_bg_g">' . __('Background color fill:') . '</label> ' . form::combo('body_bg_g', $gradient_types, $blowup_user['body_bg_g']) . '</p>';
}
echo '<p class="field"><label for="body_txt_f">' . __('Main text font:') . '</label> ' . form::combo('body_txt_f', blowupConfig::fontsList(), $blowup_user['body_txt_f']) . '</p>' . '<p class="field"><label for="body_txt_s">' . __('Main text font size:') . '</label> ' . form::field('body_txt_s', 7, 7, $blowup_user['body_txt_s']) . '</p>' . '<p class="field"><label for="body_txt_c">' . __('Main text color:') . '</label> ' . form::field('body_txt_c', 7, 7, $blowup_user['body_txt_c'], 'colorpicker') . '</p>' . '<p class="field"><label for="body_line_height">' . __('Text line height:') . '</label> ' . form::field('body_line_height', 7, 7, $blowup_user['body_line_height']) . '</p>' . '<h4 class="border-top">' . __('Links') . '</h4>' . '<p class="field"><label for="body_link_c">' . __('Links color:') . '</label> ' . form::field('body_link_c', 7, 7, $blowup_user['body_link_c'], 'colorpicker') . '</p>' . '<p class="field"><label for="body_link_v_c">' . __('Visited links color:') . '</label> ' . form::field('body_link_v_c', 7, 7, $blowup_user['body_link_v_c'], 'colorpicker') . '</p>' . '<p class="field"><label for="body_link_f_c">' . __('Focus links color:') . '</label> ' . form::field('body_link_f_c', 7, 7, $blowup_user['body_link_f_c'], 'colorpicker') . '</p>' . '<h4 class="border-top">' . __('Page top') . '</h4>';
if ($can_write_images) {
    echo '<p class="field"><label for="prelude_c">' . __('Prelude color:') . '</label> ' . form::field('prelude_c', 7, 7, $blowup_user['prelude_c'], 'colorpicker') . '</p>';
}
echo '<p class="field"><label for="blog_title_hide">' . __('Hide main title') . '</label> ' . form::checkbox('blog_title_hide', 1, $blowup_user['blog_title_hide']) . '</p>' . '<p class="field"><label for="blog_title_f">' . __('Main title font:') . '</label> ' . form::combo('blog_title_f', blowupConfig::fontsList(), $blowup_user['blog_title_f']) . '</p>' . '<p class="field"><label for="blog_title_s">' . __('Main title font size:') . '</label> ' . form::field('blog_title_s', 7, 7, $blowup_user['blog_title_s']) . '</p>' . '<p class="field"><label for="blog_title_c">' . __('Main title color:') . '</label> ' . form::field('blog_title_c', 7, 7, $blowup_user['blog_title_c'], 'colorpicker') . '</p>' . '<p class="field"><label for="blog_title_a">' . __('Main title alignment:') . '</label> ' . form::combo('blog_title_a', array(__('center') => 'center', __('left') => 'left', __('right') => 'right'), $blowup_user['blog_title_a']) . '</p>' . '<p class="field"><label for="blog_title_p">' . __('Main title position (x:y)') . '</label> ' . form::field('blog_title_p', 7, 7, $blowup_user['blog_title_p']) . '</p>';
if ($can_write_images) {
    if ($blowup_user['top_image'] == 'custom' && $blowup_user['uploaded']) {
        $preview_image = http::concatURL($core->blog->url, blowupConfig::imagesURL() . '/page-t.png');
    } else {
        $preview_image = dcPage::getPF('blowupConfig/alpha-img/page-t/' . $blowup_user['top_image'] . '.png');
    }
    echo '<h5 class="pretty-title">' . __('Top image') . '</h5>' . '<p class="field"><label for="top_image">' . __('Top image') . '</label> ' . form::combo('top_image', $top_images, $blowup_user['top_image'] ? $blowup_user['top_image'] : 'default') . '</p>' . '<p>' . __('Choose "Custom..." to upload your own image.') . '</p>' . '<p id="uploader"><label for="upfile">' . __('Add your image:') . '</label> ' . ' (' . sprintf(__('JPEG or PNG file, 800 pixels wide, maximum size %s'), files::size(DC_MAX_UPLOAD_SIZE)) . ')' . '<input type="file" name="upfile" id="upfile" size="35" />' . '</p>' . '<h5>' . __('Preview') . '</h5>' . '<div class="grid" style="width:800px;border:1px solid #ccc;">' . '<img style="display:block;" src="' . $preview_image . '" alt="" id="image-preview" />' . '</div>';
}
echo '<h4 class="border-top">' . __('Sidebar') . '</h4>' . '<p class="field"><label for="sidebar_position">' . __('Sidebar position:') . '</label> ' . form::combo('sidebar_position', array(__('right') => 'right', __('left') => 'left'), $blowup_user['sidebar_position']) . '</p>' . '<p class="field"><label for="sidebar_text_f">' . __('Sidebar text font:') . '</label> ' . form::combo('sidebar_text_f', blowupConfig::fontsList(), $blowup_user['sidebar_text_f']) . '</p>' . '<p class="field"><label for="sidebar_text_s">' . __('Sidebar text font size:') . '</label> ' . form::field('sidebar_text_s', 7, 7, $blowup_user['sidebar_text_s']) . '</p>' . '<p class="field"><label for="sidebar_text_c">' . __('Sidebar text color:') . '</label> ' . form::field('sidebar_text_c', 7, 7, $blowup_user['sidebar_text_c'], 'colorpicker') . '</p>' . '<p class="field"><label for="sidebar_title_f">' . __('Sidebar titles font:') . '</label> ' . form::combo('sidebar_title_f', blowupConfig::fontsList(), $blowup_user['sidebar_title_f']) . '</p>' . '<p class="field"><label for="sidebar_title_s">' . __('Sidebar titles font size:') . '</label> ' . form::field('sidebar_title_s', 7, 7, $blowup_user['sidebar_title_s']) . '</p>' . '<p class="field"><label for="sidebar_title_c">' . __('Sidebar titles color:') . '</label> ' . form::field('sidebar_title_c', 7, 7, $blowup_user['sidebar_title_c'], 'colorpicker') . '</p>' . '<p class="field"><label for="sidebar_title2_f">' . __('Sidebar 2nd level titles font:') . '</label> ' . form::combo('sidebar_title2_f', blowupConfig::fontsList(), $blowup_user['sidebar_title2_f']) . '</p>' . '<p class="field"><label for="sidebar_title2_s">' . __('Sidebar 2nd level titles font size:') . '</label> ' . form::field('sidebar_title2_s', 7, 7, $blowup_user['sidebar_title2_s']) . '</p>' . '<p class="field"><label for="sidebar_title2_c">' . __('Sidebar 2nd level titles color:') . '</label> ' . form::field('sidebar_title2_c', 7, 7, $blowup_user['sidebar_title2_c'], 'colorpicker') . '</p>' . '<p class="field"><label for="sidebar_line_c">' . __('Sidebar lines color:') . '</label> ' . form::field('sidebar_line_c', 7, 7, $blowup_user['sidebar_line_c'], 'colorpicker') . '</p>' . '<p class="field"><label for="sidebar_link_c">' . __('Sidebar links color:') . '</label> ' . form::field('sidebar_link_c', 7, 7, $blowup_user['sidebar_link_c'], 'colorpicker') . '</p>' . '<p class="field"><label for="sidebar_link_v_c">' . __('Sidebar visited links color:') . '</label> ' . form::field('sidebar_link_v_c', 7, 7, $blowup_user['sidebar_link_v_c'], 'colorpicker') . '</p>' . '<p class="field"><label for="sidebar_link_f_c">' . __('Sidebar focus links color:') . '</label> ' . form::field('sidebar_link_f_c', 7, 7, $blowup_user['sidebar_link_f_c'], 'colorpicker') . '</p>' . '<h4 class="border-top">' . __('Entries') . '</h4>' . '<p class="field"><label for="date_title_f">' . __('Date title font:') . '</label> ' . form::combo('date_title_f', blowupConfig::fontsList(), $blowup_user['date_title_f']) . '</p>' . '<p class="field"><label for="date_title_s">' . __('Date title font size:') . '</label> ' . form::field('date_title_s', 7, 7, $blowup_user['date_title_s']) . '</p>' . '<p class="field"><label for="date_title_c">' . __('Date title color:') . '</label> ' . form::field('date_title_c', 7, 7, $blowup_user['date_title_c'], 'colorpicker') . '</p>' . '<p class="field"><label for="post_title_f">' . __('Entry title font:') . '</label> ' . form::combo('post_title_f', blowupConfig::fontsList(), $blowup_user['post_title_f']) . '</p>' . '<p class="field"><label for="post_title_s">' . __('Entry title font size:') . '</label> ' . form::field('post_title_s', 7, 7, $blowup_user['post_title_s']) . '</p>' . '<p class="field"><label for="post_title_c">' . __('Entry title color:') . '</label> ' . form::field('post_title_c', 7, 7, $blowup_user['post_title_c'], 'colorpicker') . '</p>';
if ($can_write_images) {
    echo '<p class="field"><label for="post_comment_bg_c">' . __('Comment background color:') . '</label> ' . form::field('post_comment_bg_c', 7, 7, $blowup_user['post_comment_bg_c'], 'colorpicker') . '</p>';
}
echo '<p class="field"><label for="post_comment_c">' . __('Comment text color:') . '</label> ' . form::field('post_comment_c', 7, 7, $blowup_user['post_comment_c'], 'colorpicker') . '</p>';
if ($can_write_images) {
    echo '<p class="field"><label for="post_commentmy_bg_c">' . __('My comment background color:') . '</label> ' . form::field('post_commentmy_bg_c', 7, 7, $blowup_user['post_commentmy_bg_c'], 'colorpicker') . '</p>';
}
echo '<p class="field"><label for="post_commentmy_c">' . __('My comment text color:') . '</label> ' . form::field('post_commentmy_c', 7, 7, $blowup_user['post_commentmy_c'], 'colorpicker') . '</p>' . '<h4 class="border-top">' . __('Footer') . '</h4>' . '<p class="field"><label for="footer_f">' . __('Footer font:') . '</label> ' . form::combo('footer_f', blowupConfig::fontsList(), $blowup_user['footer_f']) . '</p>' . '<p class="field"><label for="footer_s">' . __('Footer font size:') . '</label> ' . form::field('footer_s', 7, 7, $blowup_user['footer_s']) . '</p>' . '<p class="field"><label for="footer_c">' . __('Footer color:') . '</label> ' . form::field('footer_c', 7, 7, $blowup_user['footer_c'], 'colorpicker') . '</p>' . '<p class="field"><label for="footer_l_c">' . __('Footer links color:') . '</label> ' . form::field('footer_l_c', 7, 7, $blowup_user['footer_l_c'], 'colorpicker') . '</p>' . '<p class="field"><label for="footer_bg_c">' . __('Footer background color:') . '</label> ' . form::field('footer_bg_c', 7, 7, $blowup_user['footer_bg_c'], 'colorpicker') . '</p>';
echo '<h4 class="border-top">' . __('Additional CSS') . '</h4>' . '<p><label for="extra_css">' . __('Any additional CSS styles (must be written using the CSS syntax):') . '</label> ' . form::textarea('extra_css', 72, 5, html::escapeHTML($blowup_user['extra_css']), 'maximal', '', false, 'title="' . __('Additional CSS') . '"') . '</p>' . '</div>';
// Import / Export configuration
$tmp_array = array();
$tmp_exclude = array('uploaded', 'top_height');
if ($blowup_user['top_image'] == 'custom') {
Beispiel #3
0
}
/* Post form if we can edit post
-------------------------------------------------------- */
if ($can_edit_post) {
    echo '<div class="multi-part" title="' . __('Edit entry') . '" id="edit-entry">';
    echo '<form action="post.php" method="post" id="entry-form">';
    echo '<div id="entry-sidebar">';
    echo '<p><label>' . __('Category:') . form::combo('cat_id', $categories_combo, $cat_id, 'maximal', 3) . '</label></p>' . '<p><label>' . __('Entry status:') . form::combo('post_status', $status_combo, $post_status, '', 3, !$can_publish) . '</label></p>' . '<p><label>' . __('Published on:') . form::field('post_dt', 16, 16, $post_dt, '', 3) . '</label></p>' . '<p><label>' . __('Text formating:') . form::combo('post_format', $formaters_combo, $post_format, '', 3) . ($post_id && $post_format != 'xhtml' ? '<a href="post.php?id=' . $post_id . '&amp;xconv=1">' . __('Convert to XHTML') . '</a>' : '') . '</label></p>' . '<p><label class="classic">' . form::checkbox('post_open_comment', 1, $post_open_comment, '', 3) . ' ' . __('Accept comments') . '</label></p>' . '<p><label class="classic">' . form::checkbox('post_open_tb', 1, $post_open_tb, '', 3) . ' ' . __('Accept trackbacks') . '</label></p>' . '<p><label class="classic">' . form::checkbox('post_selected', 1, $post_selected, '', 3) . ' ' . __('Selected entry') . '</label></p>' . '<p><label>' . __('Entry lang:') . form::combo('post_lang', $lang_combo, $post_lang, '', 5) . '</label></p>' . '<p><label>' . __('Entry password:'******'post_password', 10, 32, html::escapeHTML($post_password), 'maximal', 3) . '</label></p>' . '<div class="lockable">' . '<p><label>' . __('Basename:') . form::field('post_url', 10, 255, html::escapeHTML($post_url), 'maximal', 3) . '</label></p>' . '<p class="form-note warn">' . __('Warning: If you set the URL manually, it may conflict with another entry.') . '</p>' . '</div>';
    if ($post_id) {
        echo '<h3 class="clear">' . __('Attachments') . '</h3>';
        foreach ($post_media as $f) {
            $ftitle = $f->media_title;
            if (strlen($ftitle) > 18) {
                $ftitle = substr($ftitle, 0, 16) . '...';
            }
            echo '<div class="media-item">' . '<a class="media-icon" href="media_item.php?id=' . $f->media_id . '">' . '<img src="' . $f->media_icon . '" alt="" title="' . $f->basename . '" /></a>' . '<ul>' . '<li><a class="media-link" href="media_item.php?id=' . $f->media_id . '"' . 'title="' . $f->basename . '">' . $ftitle . '</a></li>' . '<li>' . $f->media_dtstr . '</li>' . '<li>' . files::size($f->size) . ' - ' . '<a href="' . $f->file_url . '">' . __('open') . '</a>' . '</li>' . '<li class="media-action"><a class="attachment-remove" id="attachment-' . $f->media_id . '" ' . 'href="post_media.php?post_id=' . $post_id . '&amp;media_id=' . $f->media_id . '&amp;remove=1">' . '<img src="images/check-off.png" alt="' . __('remove') . '" /></a>' . '</li>' . '</ul>' . '</div>';
        }
        unset($f);
        if (empty($post_media)) {
            echo '<p>' . __('No attachment.') . '</p>';
        }
        echo '<p><a href="media.php?post_id=' . $post_id . '">' . __('Add files to this entry') . '</a></p>';
    }
    # --BEHAVIOR-- adminPostFormSidebar
    $core->callBehavior('adminPostFormSidebar', isset($post) ? $post : null);
    echo '</div>';
    // End #entry-sidebar
    echo '<div id="entry-content"><fieldset class="constrained">';
    echo '<p class="col"><label class="required" title="' . __('Required field') . '">' . __('Title:') . form::field('post_title', 20, 255, html::escapeHTML($post_title), 'maximal', 2) . '</label></p>' . '<p class="area" id="excerpt-area"><label for="post_excerpt">' . __('Excerpt:') . '</label> ' . form::textarea('post_excerpt', 50, 5, html::escapeHTML($post_excerpt), '', 2) . '</p>' . '<p class="area"><label class="required" title="' . __('Required field') . '" ' . 'for="post_content">' . __('Content:') . '</label> ' . form::textarea('post_content', 50, $core->auth->getOption('edit_size'), html::escapeHTML($post_content), '', 2) . '</p>' . '<p class="area" id="notes-area"><label>' . __('Notes:') . '</label>' . form::textarea('post_notes', 50, 5, html::escapeHTML($post_notes), '', 2) . '</p>';
    # --BEHAVIOR-- adminPostForm
    $core->callBehavior('adminPostForm', isset($post) ? $post : null);
Beispiel #4
0
 private static function debugInfo()
 {
     $global_vars = implode(', ', array_keys($GLOBALS));
     $res = '<div id="debug"><div>' . '<p>memory usage: ' . memory_get_usage() . ' (' . files::size(memory_get_usage()) . ')</p>';
     if (function_exists('xdebug_get_profiler_filename')) {
         $res .= '<p>Elapsed time: ' . xdebug_time_index() . ' seconds</p>';
         $prof_file = xdebug_get_profiler_filename();
         if ($prof_file) {
             $res .= '<p>Profiler file : ' . xdebug_get_profiler_filename() . '</p>';
         } else {
             $prof_url = http::getSelfURI();
             $prof_url .= strpos($prof_url, '?') === false ? '?' : '&';
             $prof_url .= 'XDEBUG_PROFILE';
             $res .= '<p><a href="' . html::escapeURL($prof_url) . '">Trigger profiler</a></p>';
         }
         /* xdebug configuration:
         			zend_extension = /.../xdebug.so
         			xdebug.auto_trace = On
         			xdebug.trace_format = 0
         			xdebug.trace_options = 1
         			xdebug.show_mem_delta = On
         			xdebug.profiler_enable = 0
         			xdebug.profiler_enable_trigger = 1
         			xdebug.profiler_output_dir = /tmp
         			xdebug.profiler_append = 0
         			xdebug.profiler_output_name = timestamp
         			*/
     }
     $res .= '<p>Global vars: ' . $global_vars . '</p>' . '</div></div>';
     return $res;
 }
Beispiel #5
0
        }
    }
    if ($details) {
        echo '<ul>' . $details . '</ul>';
    } else {
        echo '<p>' . __('No detail') . '</p>';
    }
}
echo '</div>';
echo '<h3>' . __('Updates and modifications') . '</h3>';
if ($file->editable && $core_media_writable) {
    if ($file->media_type == 'image') {
        echo '<form class="clear fieldset" action="' . $core->adminurl->get("admin.media.item") . '" method="post">' . '<h4>' . __('Update thumbnails') . '</h4>' . '<p>' . __('This will create or update thumbnails for this image.') . '</p>' . '<p><input type="submit" name="thumbs" value="' . __('Update thumbnails') . '" />' . $core->adminurl->getHiddenFormFields('admin.media', $page_url_params) . $core->formNonce() . '</p>' . '</form>';
    }
    if ($file->type == 'application/zip') {
        $inflate_combo = array(__('Extract in a new directory') => 'new', __('Extract in current directory') => 'current');
        echo '<form class="clear fieldset" id="file-unzip" action="' . $core->adminurl->get("admin.media.item") . '" method="post">' . '<h4>' . __('Extract archive') . '</h4>' . '<ul>' . '<li><strong>' . __('Extract in a new directory') . '</strong> : ' . __('This will extract archive in a new directory that should not exist yet.') . '</li>' . '<li><strong>' . __('Extract in current directory') . '</strong> : ' . __('This will extract archive in current directory and will overwrite existing files or directory.') . '</li>' . '</ul>' . '<p><label for="inflate_mode" class="classic">' . __('Extract mode:') . '</label> ' . form::combo('inflate_mode', $inflate_combo, 'new') . '<input type="submit" name="unzip" value="' . __('Extract') . '" />' . $core->adminurl->getHiddenFormFields('admin.media', $page_url_params) . $core->formNonce() . '</p>' . '</form>';
    }
    echo '<form class="clear fieldset" action="' . $core->adminurl->get("admin.media.item") . '" method="post">' . '<h4>' . __('Change media properties') . '</h4>' . '<p><label for="media_file">' . __('File name:') . '</label>' . form::field('media_file', 30, 255, html::escapeHTML($file->basename)) . '</p>' . '<p><label for="media_title">' . __('File title:') . '</label>' . form::field('media_title', 30, 255, html::escapeHTML($file->media_title)) . '</p>' . '<p><label for="media_dt">' . __('File date:') . '</label>' . form::field('media_dt', 16, 16, html::escapeHTML($file->media_dtstr)) . '</p>' . '<p><label for="media_private" class="classic">' . form::checkbox('media_private', 1, $file->media_priv) . ' ' . __('Private') . '</label></p>' . '<p><label for="media_path">' . __('New directory:') . '</label>' . form::combo('media_path', $dirs_combo, dirname($file->relname)) . '</p>' . '<p><input type="submit" accesskey="s" value="' . __('Save') . '" />' . $core->adminurl->getHiddenFormFields('admin.media.item', $page_url_params) . $core->formNonce() . '</p>' . '</form>';
    echo '<form class="clear fieldset" action="' . $core->adminurl->get("admin.media.item") . '" method="post" enctype="multipart/form-data">' . '<h4>' . __('Change file') . '</h4>' . '<div>' . form::hidden(array('MAX_FILE_SIZE'), DC_MAX_UPLOAD_SIZE) . '</div>' . '<p><label for="upfile">' . __('Choose a file:') . ' (' . sprintf(__('Maximum size %s'), files::size(DC_MAX_UPLOAD_SIZE)) . ') ' . '<input type="file" id="upfile" name="upfile" size="35" />' . '</label></p>' . '<p><input type="submit" value="' . __('Send') . '" />' . $core->adminurl->getHiddenFormFields('admin.media', $page_url_params) . $core->formNonce() . '</p>' . '</form>';
    if ($file->del) {
        echo '<form id="delete-form" method="post" action="' . $core->adminurl->getBase("admin.media") . '">' . '<p><input name="delete" type="submit" class="delete" value="' . __('Delete this media') . '" />' . form::hidden('remove', rawurlencode($file->basename)) . form::hidden('rmyes', 1) . $core->adminurl->getHiddenFormFields('admin.media', $media_page_url_params) . $core->formNonce() . '</p>' . '</form>';
    }
    # --BEHAVIOR-- adminMediaItemForm
    $core->callBehavior('adminMediaItemForm', $file);
}
echo '</div>';
if ($popup || $select) {
    echo '</div>';
}
call_user_func($close_f);
 public function gui()
 {
     if ($this->status == 'single') {
         dcPage::success(__('Single blog successfully imported.'));
         return;
     }
     if ($this->status == 'full') {
         dcPage::success(__('Content successfully imported.'));
         return;
     }
     $public_files = array_merge(array('-' => ''), $this->getPublicFiles());
     $has_files = (bool) (count($public_files) - 1);
     echo '<script type="text/javascript">' . "\n" . "//<![CDATA[\n" . dcPage::jsVar('dotclear.msg.confirm_full_import', __('Are you sure you want to import a full backup file?')) . "\$(function() {" . "\$('#up_single_file').change(function() { " . "if (this.value != '') { \$('#public_single_file').val(''); } " . "}); " . "\$('#public_single_file').change(function() { " . "if (this.value != '') { \$('#up_single_file').val(''); } " . "}); " . "\$('#up_full_file').change(function() { " . "if (this.value != '') { \$('#public_full_file').val(''); } " . "}); " . "\$('#public_full_file').change(function() { " . "if (this.value != '') { \$('#up_full_file').val(''); } " . "}); " . "\$('#formfull').submit(function() { " . "return window.confirm(dotclear.msg.confirm_full_import); " . "}); " . "});\n" . "//]]>\n" . "</script>\n";
     echo '<form action="' . $this->getURL(true) . '" method="post" enctype="multipart/form-data" class="fieldset">' . '<h3>' . __('Single blog') . '</h3>' . '<p>' . sprintf(__('This will import a single blog backup as new content in the current blog: <strong>%s</strong>.'), html::escapeHTML($this->core->blog->name)) . '</p>' . '<p><label for="up_single_file">' . __('Upload a backup file') . ' (' . sprintf(__('maximum size %s'), files::size(DC_MAX_UPLOAD_SIZE)) . ')' . ' </label>' . ' <input type="file" id="up_single_file" name="up_single_file" size="20" />' . '</p>';
     if ($has_files) {
         echo '<p><label for="public_single_file" class="">' . __('or pick up a local file in your public directory') . ' </label> ' . form::combo('public_single_file', $public_files) . '</p>';
     }
     echo '<p>' . $this->core->formNonce() . form::hidden(array('do'), 1) . form::hidden(array('MAX_FILE_SIZE'), DC_MAX_UPLOAD_SIZE) . '<input type="submit" value="' . __('Import') . '" /></p>' . '</form>';
     if ($this->core->auth->isSuperAdmin()) {
         echo '<form action="' . $this->getURL(true) . '" method="post" enctype="multipart/form-data" id="formfull" class="fieldset">' . '<h3>' . __('Multiple blogs') . '</h3>' . '<p class="warning">' . __('This will reset all the content of your database, except users.') . '</p>' . '<p><label for="up_full_file">' . __('Upload a backup file') . ' ' . ' (' . sprintf(__('maximum size %s'), files::size(DC_MAX_UPLOAD_SIZE)) . ')' . ' </label>' . '<input type="file" id="up_full_file" name="up_full_file" size="20" />' . '</p>';
         if ($has_files) {
             echo '<p><label for="public_full_file">' . __('or pick up a local file in your public directory') . ' </label>' . form::combo('public_full_file', $public_files) . '</p>';
         }
         echo '<p><label for="your_pwd" class="required"><abbr title="' . __('Required field') . '">*</abbr> ' . __('Your password:'******'</label>' . form::password('your_pwd', 20, 255) . '</p>' . '<p>' . $this->core->formNonce() . form::hidden(array('do'), 1) . form::hidden(array('MAX_FILE_SIZE'), DC_MAX_UPLOAD_SIZE) . '<input type="submit" value="' . __('Import') . '" /></p>' . '</form>';
     }
 }
Beispiel #7
0
function mediaItemLine($f, $i, $query, $table = false)
{
    global $core, $page_url, $popup, $select, $post_id, $plugin_id, $page_url_params;
    $fname = $f->basename;
    $file = $query ? $f->relname : $f->basename;
    $class = $table ? '' : 'media-item media-col-' . $i % 2;
    if ($f->d) {
        // Folder
        $link = $core->adminurl->get('admin.media', array_merge($page_url_params, array('d' => html::sanitizeURL($f->relname))));
        if ($f->parent) {
            $fname = '..';
            $class .= ' media-folder-up';
        } else {
            $class .= ' media-folder';
        }
    } else {
        // Item
        $params = new ArrayObject(array('id' => $f->media_id, 'plugin_id' => $plugin_id, 'popup' => $popup, 'select' => $select, 'post_id' => $post_id));
        $core->callBehavior('adminMediaURLParams', $params);
        $params = (array) $params;
        $link = $core->adminurl->get('admin.media.item', $params);
    }
    $maxchars = 36;
    if (strlen($fname) > $maxchars) {
        $fname = substr($fname, 0, $maxchars - 4) . '...' . ($f->d ? '' : files::getExtension($fname));
    }
    $act = '';
    if (!$f->d) {
        if ($select > 0) {
            if ($select == 1) {
                // Single media selection button
                $act .= '<a href="' . $link . '"><img src="images/plus.png" alt="' . __('Select this file') . '" ' . 'title="' . __('Select this file') . '" /></a> ';
            } else {
                // Multiple media selection checkbox
                $act .= form::checkbox(array('medias[]', 'media_' . rawurlencode($file)), $file);
            }
        } else {
            // Item
            if ($post_id) {
                // Media attachment button
                $act .= '<a class="attach-media" title="' . __('Attach this file to entry') . '" href="' . $core->adminurl->get("admin.post.media", array('media_id' => $f->media_id, 'post_id' => $post_id, 'attach' => 1)) . '">' . '<img src="images/plus.png" alt="' . __('Attach this file to entry') . '"/>' . '</a>';
            }
            if ($popup) {
                // Media insertion button
                $act .= '<a href="' . $link . '"><img src="images/plus.png" alt="' . __('Insert this file into entry') . '" ' . 'title="' . __('Insert this file into entry') . '" /></a> ';
            }
        }
    }
    if ($f->del) {
        // Deletion button or checkbox
        if (!$popup && !$f->d) {
            if ($select < 2) {
                // Already set for multiple media selection
                $act .= form::checkbox(array('medias[]', 'media_' . rawurlencode($file)), $file);
            }
        } else {
            $act .= '<a class="media-remove" ' . 'href="' . html::escapeURL($page_url) . '&amp;plugin_id=' . $plugin_id . '&amp;d=' . rawurlencode($GLOBALS['d']) . '&amp;q=' . rawurlencode($GLOBALS['q']) . '&amp;remove=' . rawurlencode($file) . '">' . '<img src="images/trash.png" alt="' . __('Delete') . '" title="' . __('delete') . '" /></a>';
        }
    }
    // Render markup
    if (!$table) {
        $res = '<div class="' . $class . '"><p><a class="media-icon media-link" href="' . rawurldecode($link) . '">' . '<img src="' . $f->media_icon . '" alt="" />' . ($query ? $file : $fname) . '</a></p>';
        $lst = '';
        if (!$f->d) {
            $lst .= '<li>' . $f->media_title . '</li>' . '<li>' . $f->media_dtstr . ' - ' . files::size($f->size) . ' - ' . '<a href="' . $f->file_url . '">' . __('open') . '</a>' . '</li>';
        }
        $lst .= $act != '' ? '<li class="media-action">&nbsp;' . $act . '</li>' : '';
        // Show player if relevant
        $file_type = explode('/', $f->type);
        if ($file_type[0] == 'audio') {
            $lst .= '<li>' . dcMedia::audioPlayer($f->type, $f->file_url, $core->adminurl->get("admin.home", array('pf' => 'player_mp3.swf')), null, $core->blog->settings->system->media_flash_fallback) . '</li>';
        }
        $res .= $lst != '' ? '<ul>' . $lst . '</ul>' : '';
        $res .= '</div>';
    } else {
        $res = '<tr class="' . $class . '">';
        $res .= '<td class="media-action">' . $act . '</td>';
        $res .= '<td class="maximal" scope="row"><a class="media-flag media-link" href="' . rawurldecode($link) . '">' . '<img src="' . $f->media_icon . '" alt="" />' . ($query ? $file : $fname) . '</a>' . '<br />' . ($f->d ? '' : $f->media_title) . '</td>';
        $res .= '<td class="nowrap count">' . ($f->d ? '' : $f->media_dtstr) . '</td>';
        $res .= '<td class="nowrap count">' . ($f->d ? '' : files::size($f->size) . ' - ' . '<a href="' . $f->file_url . '">' . __('open') . '</a>') . '</td>';
        $res .= '</tr>';
    }
    return $res;
}
Beispiel #8
0
        }
        echo '</ul>';
    }
}
if ($file->type == 'image/jpeg') {
    echo '<h3>' . __('Image details') . '</h3>';
    if (count($file->media_meta) == 0) {
        echo '<p>' . __('No detail') . '</p>';
    } else {
        echo '<ul>';
        foreach ($file->media_meta as $k => $v) {
            if ((string) $v) {
                echo '<li><strong>' . $k . ':</strong> ' . html::escapeHTML($v) . '</li>';
            }
        }
        echo '</ul>';
    }
}
if ($file->editable && $core_media_writable) {
    if ($file->media_type == 'image') {
        echo '<form class="clear" action="' . html::escapeURL($page_url) . '" method="post">' . '<fieldset><legend>' . __('Update thumbnails') . '</legend>' . '<p>' . __('This will create or update thumbnails for this image.') . '</p>' . '<p><input type="submit" name="thumbs" value="' . __('update thumbnails') . '" />' . form::hidden(array('id'), $id) . $core->formNonce() . '</p>' . '</fieldset></form>';
    }
    if ($file->type == 'application/zip') {
        $inflate_combo = array(__('Extract in a new directory') => 'new', __('Extract in current directory') => 'current');
        echo '<form class="clear" id="file-unzip" action="' . html::escapeURL($page_url) . '" method="post">' . '<fieldset><legend>' . __('Extract archive') . '</legend>' . '<ul>' . '<li><strong>' . __('Extract in a new directory') . '</strong> : ' . __('This will extract archive in a new directory that should not exists yet.') . '</li>' . '<li><strong>' . __('Extract in current directory') . '</strong> : ' . __('This will extract archive in current directory and will overwrite existing files or directory.') . '</li>' . '</ul>' . '<p><label class="classic">' . __('Extract mode:') . ' ' . form::combo('inflate_mode', $inflate_combo, 'new') . '</label> ' . '<input type="submit" name="unzip" value="' . __('extract') . '" />' . form::hidden(array('id'), $id) . $core->formNonce() . '</p>' . '</fieldset></form>';
    }
    echo '<form class="clear" action="' . html::escapeURL($page_url) . '" method="post">' . '<fieldset><legend>' . __('Change media properties') . '</legend>' . '<p><label>' . __('File name:') . form::field('media_file', 30, 255, html::escapeHTML($file->basename)) . '</label></p>' . '<p><label>' . __('File title:') . form::field('media_title', 30, 255, html::escapeHTML($file->media_title)) . '</label></p>' . '<p><label>' . __('File date:') . form::field('media_dt', 16, 16, html::escapeHTML($file->media_dtstr)) . '</label></p>' . '<p><label class="classic">' . form::checkbox('media_private', 1, $file->media_priv) . ' ' . __('Private') . '</label></p>' . '<p><label>' . __('New directory:') . form::combo('media_path', $dirs_combo, dirname($file->relname)) . '</label></p>' . '<p><input type="submit" accesskey="s" value="' . __('save') . '" />' . form::hidden(array('id'), $id) . $core->formNonce() . '</p>' . '</fieldset></form>';
    echo '<form class="clear" action="' . html::escapeURL($page_url) . '" method="post" enctype="multipart/form-data">' . '<fieldset><legend>' . __('Change file') . '</legend>' . '<div>' . form::hidden(array('MAX_FILE_SIZE'), DC_MAX_UPLOAD_SIZE) . '</div>' . '<p><label>' . __('Choose a file:') . ' (' . sprintf(__('Maximum size %s'), files::size(DC_MAX_UPLOAD_SIZE)) . ') ' . '<input type="file" name="upfile" size="35" />' . '</label></p>' . '<p><input type="submit" value="' . __('send') . '" />' . form::hidden(array('id'), $id) . $core->formNonce() . '</p>' . '</fieldset></form>';
}
echo '</div>' . '</div>';
call_user_func($close_f);
Beispiel #9
0
function mediaItemLine($f, $i)
{
    global $core, $page_url, $popup, $post_id;
    $fname = $f->basename;
    if ($f->d) {
        $link = html::escapeURL($page_url) . '&amp;d=' . html::sanitizeURL($f->relname);
        if ($f->parent) {
            $fname = '..';
        }
    } else {
        $link = 'media_item.php?id=' . $f->media_id . '&amp;popup=' . $popup . '&amp;post_id=' . $post_id;
    }
    $class = 'media-item media-col-' . $i % 2;
    $res = '<div class="' . $class . '"><a class="media-icon media-link" href="' . $link . '">' . '<img src="' . $f->media_icon . '" alt="" /></a>' . '<ul>' . '<li><a class="media-link" href="' . $link . '">' . $fname . '</a></li>';
    if (!$f->d) {
        $res .= '<li>' . $f->media_title . '</li>' . '<li>' . $f->media_dtstr . ' - ' . files::size($f->size) . ' - ' . '<a href="' . $f->file_url . '">' . __('open') . '</a>' . '</li>';
    }
    $res .= '<li class="media-action">&nbsp;';
    if ($post_id && !$f->d) {
        $res .= '<form action="post_media.php" method="post">' . '<input type="image" src="images/plus.png" alt="' . __('Attach this file to entry') . '" ' . 'title="' . __('Attach this file to entry') . '" /> ' . form::hidden('media_id', $f->media_id) . form::hidden('post_id', $post_id) . form::hidden('attach', 1) . $core->formNonce() . '</form>';
    }
    if ($popup && !$f->d) {
        $res .= '<a href="' . $link . '"><img src="images/plus.png" alt="' . __('Insert this file into entry') . '" ' . 'title="' . __('Insert this file into entry') . '" /></a> ';
    }
    if ($f->del) {
        $res .= '<a class="media-remove" ' . 'href="' . html::escapeURL($page_url) . '&amp;d=' . rawurlencode($GLOBALS['d']) . '&amp;remove=' . rawurlencode($f->basename) . '">' . '<img src="images/trash.png" alt="' . __('delete') . '" title="' . __('delete') . '" /></a>';
    }
    $res .= '</li>';
    if ($f->type == 'audio/mpeg3') {
        $res .= '<li>' . dcMedia::mp3player($f->file_url, 'index.php?pf=player_mp3.swf') . '</li>';
    }
    $res .= '</ul></div>';
    return $res;
}