Esempio n. 1
0
    /**
     * LazyestAdminFolder::descriptiondiv()
     * div holding the description
     * 
     * @since 1.1.0 
     * @return void
     */
    function descriptiondiv()
    {
        $explain = esc_html__('You may use these HTML tags and attributes: <a href=""> <strong> <em> <ul> <li> <br />', 'lazyest-gallery');
        $description = lg_esc_description($this->description);
        ?>
    <div id="folder_description" class="postbox">
      <div class="handlediv"><br /></div><h3 class='hndle'><span><?php 
        esc_html_e('Description', 'lazyest-gallery');
        ?>
</span></h3>
      <div class="inside">
        <label class="screen-reader-text" for="fdescription"><?php 
        esc_html_e('Description', 'lazyest-gallery');
        ?>
</label>
        <textarea name="fdescription" id="fdescription"><?php 
        echo $description;
        ?>
</textarea>
        <p><?php 
        echo $explain;
        ?>
</p>
      </div>
    </div>
    <?php 
    }
Esempio n. 2
0
 /**
  * LazyestImageTable::body_cell()
  * 
  * @param mixed $key
  * @param mixed $value
  * @param mixed $i
  * @return
  */
 function body_cell($key, $value, $i)
 {
     global $lg_gallery;
     $image = $this->items[$i];
     $folder = $image->folder;
     $onclick = $image->on_click();
     $form_name = $image->form_name();
     $caption = lg_esc_caption($image->caption);
     $description = lg_esc_description($image->description);
     $tabstop = $i + 2;
     switch ($key) {
         case 'draghandle':
             $title = $this->sortit ? esc_attr__('Click and Hold to Drag', 'lazyest-gallery') : '';
             $cell = $this->sortit ? sprintf('<td class="dragHandle" title="%s"></td>', $title) : '';
             break;
         case 'image':
             $class = 'thumb';
             if ('TRUE' != $lg_gallery->get_option('enable_cache') || 'TRUE' == $lg_gallery->get_option('async_cache') && !file_exists($image->loc())) {
                 $class .= ' lg_ajax';
             }
             $cell = '<td class="column-icon media-icon" width="80">';
             $cell .= sprintf('<a target="_blank" href="%s" class="alignleft %s">', $onclick['href'], $onclick['class']);
             $cell .= sprintf('<img width="60" height="60" class="attachment-80x60 %s" src="%s" alt="%s"  title="%s" /></a></td>', $class, $image->src(), $image->alt(), $image->title());
             break;
         case 'file':
             $delete_warning = sprintf(__("'You are about to delete \\'%s\\' \\n \\'Cancel\\' to stop \\'OK\\' to delete'", 'lazyest-gallery'), htmlentities($image->image, ENT_QUOTES));
             $cell = sprintf('<td class="media column-media" sorttable_customkey="%s">', $form_name);
             $cell .= sprintf('<p style="cursor:default"><strong>%s</strong></p>', htmlentities($image->image));
             $cell .= sprintf('<input type="hidden" class="_index" id="index_%s" name="index_%s" value="%d" />', $form_name, $form_name, $i + 1);
             $cell .= '<div class="row-actions" style="cursor:default"><p>';
             $cell .= $this->can_save ? sprintf('<span class="delete"><a class="submitdelete" onclick="if(confirm(%s)){return true;}return false;" href="%s" >%s</a> |</span>', $delete_warning, admin_url(sprintf('admin.php?page=lazyest-filemanager&amp;folder=%s&amp;file_to_delete=%s', lg_nice_link($folder->curdir), lg_nice_link($image->image))), __('Delete Permanently', 'lazyest-gallery')) : '';
             $cell .= sprintf('<span class="view"> <a title="%s %s" target="_blank" href="%s" class="%s">%s</a> |</span>', __('View', 'lazyest-gallery'), htmlentities("\"{$image->image}\"", ENT_QUOTES), $onclick['href'], $onclick['class'], __('View ', 'lazyest-gallery'));
             if ($this->can_save) {
                 $cell .= '<br />';
                 if ($this->sortit) {
                     $cell .= sprintf('<span style="display:none;" class="view hide-if-no-js"> <a class="to_top" id="to_top_%s" href="#" title="%s">%s &uarr;</a> |</span>', $form_name, __('Move image to top of the list', 'lazyest-gallery'), __('to Top', 'lazyest-gallery'));
                     $cell .= sprintf('<span style="display:none;" class="view hide-if-no-js"> <a class="to_bottom" id="to_bottom_%s" href="#" title="%s">%s &darr;</a></span>', $form_name, __('Move image to bottom of the list', 'lazyest-gallery'), __(' to Bottom', 'lazyest-gallery'));
                 }
                 $cell .= sprintf('| <span style="display:none;" class="view hide-if-no-folders"> <a rel="%s" class="move_to" id="mt%s" href="#" title="%s">%s&hellip;</a> |</span>', urlencode($image->folder->curdir . $image->image), $image->id, __('Right click to select folder', 'lazyest-gallery'), __('Move to', 'lazyest-gallery'));
                 $cell .= sprintf('<span style="display:none;" class="view hide-if-no-folders"> <a rel="%s" class="copy_to" id="ct%s" href="#" title="%s">%s&hellip;</a> |</span>', urlencode($image->folder->curdir . $image->image), $image->id, __('Right click to select folder', 'lazyest-gallery'), __('Copy to', 'lazyest-gallery'));
             }
             $cell .= '</p></div>';
             $extra_html = '';
             $cell .= apply_filters('lazyest_gallery_edit_image', $extra_html, $image);
             $cell .= '</td>';
             break;
         case 'content':
             $imagefields = $lg_gallery->get_fields('image');
             $readonly = !$this->can_save ? 'readonly="readonly"' : '';
             $cell = sprintf('<td class="column-caption" sorttable_customkey="%s"><a name="%s"></a>', esc_attr($caption), $form_name, $readonly);
             $cell .= sprintf('<strong>%s</strong><br /><input class="caption-text" type="text" tabindex="%s" name="%s" value="%s" size="50" %s />', __('Caption', 'lazyest-gallery'), $tabstop, $form_name, $caption, $readonly);
             $cell .= sprintf('<div id="descdiv_%s" class="descdiv hide_in_list">', $form_name);
             $cell .= sprintf('<strong>%s</strong><br />', __('Description', 'lazyest-gallery'));
             $cell .= sprintf('<textarea class="desc codepress" name="desc_%s" id="desc_%s" %s tabindex="%d" cols="50" >%s</textarea>', $form_name, $form_name, $readonly, $tabstop + 1, $description);
             if ($this->extrafields) {
                 $cell .= sprintf('<div id="xtradiv_%s" class="xtradiv hide_in_list">', $form_name);
                 foreach ($this->imagefields as $field) {
                     if ($field['edit']) {
                         $value = htmlspecialchars(stripslashes($image->extra_fields[$field['name']]), ENT_QUOTES);
                         $cell .= sprintf('<strong>%s</strong><br />', $field['display']);
                         $cell .= sprintf('<input id="%s_%s" name="%s_%s" type="text" style="width:100%s" value="%s" />', $form_name, $field['name'], $form_name, $field['name'], '%', $value);
                     }
                 }
                 $cell .= '</div>';
             }
             $cell .= '</div></td>';
             break;
         case 'date':
             $cell = sprintf('<td sorttable_customkey="%s">%s</td>', $image->datetime, date(get_option('date_format'), $image->datetime));
             break;
         case 'comments':
             if ('TRUE' == $lg_gallery->get_option('allow_comments')) {
                 $cell = '<td class="num"><div class="post-com-count-wrapper">';
                 $cell .= sprintf('<a class="post-com-count" href="%s"><span class="comment-count">%s</span></a>', admin_url(sprintf('admin.php?page=lazyest-filemanager&amp;edit=comments&amp;file=%s', lg_nice_link(path_join($image->folder->curdir, $image->image)))), $lg_gallery->commentor->count_comments($image->id));
                 $cell .= '</div></td>';
             } else {
                 $cell = '';
             }
             break;
     }
     return $cell;
 }