当前位置: 首页>>代码示例>>PHP>>正文


PHP media_printicon函数代码示例

本文整理汇总了PHP中media_printicon函数的典型用法代码示例。如果您正苦于以下问题:PHP media_printicon函数的具体用法?PHP media_printicon怎么用?PHP media_printicon使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了media_printicon函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: html_recent

/**
 * display recent changes
 *
 * @author Andreas Gohr <andi@splitbrain.org>
 * @author Matthias Grimm <matthiasgrimm@users.sourceforge.net>
 * @author Ben Coburn <btcoburn@silicodon.net>
 * @author Kate Arzamastseva <pshns@ukr.net>
 */
function html_recent($first = 0, $show_changes = 'both')
{
    global $conf;
    global $lang;
    global $ID;
    /* we need to get one additionally log entry to be able to
     * decide if this is the last page or is there another one.
     * This is the cheapest solution to get this information.
     */
    $flags = 0;
    if ($show_changes == 'mediafiles' && $conf['mediarevisions']) {
        $flags = RECENTS_MEDIA_CHANGES;
    } elseif ($show_changes == 'pages') {
        $flags = 0;
    } elseif ($conf['mediarevisions']) {
        $show_changes = 'both';
        $flags = RECENTS_MEDIA_PAGES_MIXED;
    }
    $recents = getRecents($first, $conf['recent'] + 1, getNS($ID), $flags);
    if (count($recents) == 0 && $first != 0) {
        $first = 0;
        $recents = getRecents($first, $conf['recent'] + 1, getNS($ID), $flags);
    }
    $hasNext = false;
    if (count($recents) > $conf['recent']) {
        $hasNext = true;
        array_pop($recents);
        // remove extra log entry
    }
    print p_locale_xhtml('recent');
    if (getNS($ID) != '') {
        print '<div class="level1"><p>' . sprintf($lang['recent_global'], getNS($ID), wl('', 'do=recent')) . '</p></div>';
    }
    $form = new Doku_Form(array('id' => 'dw__recent', 'method' => 'GET'));
    $form->addHidden('sectok', null);
    $form->addHidden('do', 'recent');
    $form->addHidden('id', $ID);
    if ($conf['mediarevisions']) {
        $form->addElement(form_makeListboxField('show_changes', array('pages' => $lang['pages_changes'], 'mediafiles' => $lang['media_changes'], 'both' => $lang['both_changes']), $show_changes, $lang['changes_type'], '', '', array('class' => 'quickselect')));
        $form->addElement(form_makeButton('submit', 'recent', $lang['btn_apply']));
    }
    $form->addElement(form_makeOpenTag('ul'));
    foreach ($recents as $recent) {
        $date = dformat($recent['date']);
        if ($recent['type'] === DOKU_CHANGE_TYPE_MINOR_EDIT) {
            $form->addElement(form_makeOpenTag('li', array('class' => 'minor')));
        } else {
            $form->addElement(form_makeOpenTag('li'));
        }
        $form->addElement(form_makeOpenTag('div', array('class' => 'li')));
        if ($recent['media']) {
            $form->addElement(media_printicon($recent['id']));
        } else {
            $icon = DOKU_BASE . 'lib/images/fileicons/file.png';
            $form->addElement('<img src="' . $icon . '" alt="' . $filename . '" class="icon" />');
        }
        $form->addElement(form_makeOpenTag('span', array('class' => 'date')));
        $form->addElement($date);
        $form->addElement(form_makeCloseTag('span'));
        if ($recent['media']) {
            $diff = count(getRevisions($recent['id'], 0, 1, 8192, true)) && @file_exists(mediaFN($recent['id']));
            if ($diff) {
                $href = media_managerURL(array('tab_details' => 'history', 'mediado' => 'diff', 'image' => $recent['id'], 'ns' => getNS($recent['id'])), '&');
            }
        } else {
            $href = wl($recent['id'], "do=diff", false, '&');
        }
        if ($recent['media'] && !$diff) {
            $form->addElement('<img src="' . DOKU_BASE . 'lib/images/blank.gif" width="15" height="11" alt="" />');
        } else {
            $form->addElement(form_makeOpenTag('a', array('class' => 'diff_link', 'href' => $href)));
            $form->addElement(form_makeTag('img', array('src' => DOKU_BASE . 'lib/images/diff.png', 'width' => 15, 'height' => 11, 'title' => $lang['diff'], 'alt' => $lang['diff'])));
            $form->addElement(form_makeCloseTag('a'));
        }
        if ($recent['media']) {
            $href = media_managerURL(array('tab_details' => 'history', 'image' => $recent['id'], 'ns' => getNS($recent['id'])), '&');
        } else {
            $href = wl($recent['id'], "do=revisions", false, '&');
        }
        $form->addElement(form_makeOpenTag('a', array('class' => 'revisions_link', 'href' => $href)));
        $form->addElement(form_makeTag('img', array('src' => DOKU_BASE . 'lib/images/history.png', 'width' => 12, 'height' => 14, 'title' => $lang['btn_revs'], 'alt' => $lang['btn_revs'])));
        $form->addElement(form_makeCloseTag('a'));
        if ($recent['media']) {
            $href = media_managerURL(array('tab_details' => 'view', 'image' => $recent['id'], 'ns' => getNS($recent['id'])), '&');
            $class = file_exists(mediaFN($recent['id'])) ? 'wikilink1' : ($class = 'wikilink2');
            $form->addElement(form_makeOpenTag('a', array('class' => $class, 'href' => $href)));
            $form->addElement($recent['id']);
            $form->addElement(form_makeCloseTag('a'));
        } else {
            $form->addElement(html_wikilink(':' . $recent['id'], useHeading('navigation') ? null : $recent['id']));
        }
        $form->addElement(form_makeOpenTag('span', array('class' => 'sum')));
//.........这里部分代码省略.........
开发者ID:nefercheprure,项目名称:dokuwiki,代码行数:101,代码来源:html.php

示例2: _mod_media_printfile_thumbs

 /**
  * Formats and prints one file in the list in the thumbnails view
  *
  * @see media_printfile_thumbs()
  */
 function _mod_media_printfile_thumbs($item, $auth, $jump = false, $display_namespace = false)
 {
     global $lang;
     global $conf;
     // Prepare filename
     $file = $this->_getOriginalFileName($item['id']);
     if ($file === false) {
         $file = utf8_decodeFN($item['file']);
     }
     // build fake media id
     $ns = getNS($item['id']);
     $fakeId = $ns === false ? $file : "{$ns}:{$file}";
     $fakeId_escaped = hsc($fakeId);
     // output
     echo '<li><dl title="' . $fakeId_escaped . '">' . NL;
     echo '<dt>';
     if ($item['isimg']) {
         media_printimgdetail($item, true);
     } else {
         echo '<a name="d_:' . $item['id'] . '" class="image" title="' . $fakeId_escaped . '" href="' . media_managerURL(array('image' => $fakeId, 'ns' => $ns, 'tab_details' => 'view')) . '">';
         echo media_printicon($fakeId_escaped);
         echo '</a>';
     }
     echo '</dt>' . NL;
     if (!$display_namespace) {
         $name = hsc($file);
     } else {
         $name = $fakeId_escaped;
     }
     echo '<dd class="name"><a href="' . media_managerURL(array('image' => $fakeId, 'ns' => $ns, 'tab_details' => 'view')) . '" name="h_:' . $item['id'] . '">' . $name . '</a></dd>' . NL;
     if ($item['isimg']) {
         $size = '';
         $size .= (int) $item['meta']->getField('File.Width');
         $size .= '&#215;';
         $size .= (int) $item['meta']->getField('File.Height');
         echo '<dd class="size">' . $size . '</dd>' . NL;
     } else {
         echo '<dd class="size">&#160;</dd>' . NL;
     }
     $date = dformat($item['mtime']);
     echo '<dd class="date">' . $date . '</dd>' . NL;
     $filesize = filesize_h($item['size']);
     echo '<dd class="filesize">' . $filesize . '</dd>' . NL;
     echo '</dl></li>' . NL;
 }
开发者ID:kazmiya,项目名称:dokuwiki-plugin-preservefilenames,代码行数:50,代码来源:action_angua.php

示例3: media_printfile_thumbs

/**
 * Formats and prints one file in the list in the thumbnails view
 *
 * @author Kate Arzamastseva <pshns@ukr.net>
 */
function media_printfile_thumbs($item, $auth, $jump = false, $display_namespace = false)
{
    // Prepare filename
    $file = utf8_decodeFN($item['file']);
    // output
    echo '<li><dl title="' . hsc($item['id']) . '">' . NL;
    echo '<dt>';
    if ($item['isimg']) {
        media_printimgdetail($item, true);
    } else {
        echo '<a id="d_:' . $item['id'] . '" class="image" title="' . $item['id'] . '" href="' . media_managerURL(array('image' => hsc($item['id']), 'ns' => getNS($item['id']), 'tab_details' => 'view')) . '">';
        echo media_printicon($item['id'], '32x32');
        echo '</a>';
    }
    echo '</dt>' . NL;
    if (!$display_namespace) {
        $name = hsc($file);
    } else {
        $name = hsc($item['id']);
    }
    echo '<dd class="name"><a href="' . media_managerURL(array('image' => hsc($item['id']), 'ns' => getNS($item['id']), 'tab_details' => 'view')) . '" id="h_:' . $item['id'] . '">' . $name . '</a></dd>' . NL;
    if ($item['isimg']) {
        $size = '';
        $size .= (int) $item['meta']->getField('File.Width');
        $size .= '&#215;';
        $size .= (int) $item['meta']->getField('File.Height');
        echo '<dd class="size">' . $size . '</dd>' . NL;
    } else {
        echo '<dd class="size">&#160;</dd>' . NL;
    }
    $date = dformat($item['mtime']);
    echo '<dd class="date">' . $date . '</dd>' . NL;
    $filesize = filesize_h($item['size']);
    echo '<dd class="filesize">' . $filesize . '</dd>' . NL;
    echo '</dl></li>' . NL;
}
开发者ID:yjliugit,项目名称:dokuwiki,代码行数:41,代码来源:media.php


注:本文中的media_printicon函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。