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


PHP media_managerURL函数代码示例

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


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

示例1: _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

示例2: 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

示例3: getNS

    }
    ?>
                    </dl>
                    <?php 
    //Comment in for Debug// dbg(tpl_img_getTag('Simple.Raw'));
    ?>
                </div>
                <div class="clearer"></div>
            </div><!-- /.content -->

            <p class="back">
                <?php 
    $imgNS = getNS($IMG);
    $authNS = auth_quickaclcheck("{$imgNS}:*");
    if ($authNS >= AUTH_UPLOAD && function_exists('media_managerURL')) {
        $mmURL = media_managerURL(array('ns' => $imgNS, 'image' => $IMG));
        echo '<a href="' . $mmURL . '">' . $lang['img_manager'] . '</a><br />';
    }
    ?>
                &larr; <?php 
    echo $lang['img_backto'];
    ?>
 <?php 
    tpl_pagelink($ID);
    ?>
            </p>

        <?php 
}
?>
    </div>
开发者ID:cpolzer,项目名称:dokutwitterbootstrap,代码行数:31,代码来源:detail.php

示例4: nl2br

    print nl2br(hsc(tpl_img_getTag('simple.title')));
    ?>
      </p>

      <p>&larr; <?php 
    echo $lang['img_backto'];
    ?>
 <?php 
    tpl_pagelink($ID);
    ?>
</p>
      <?php 
    $imgNS = getNS($IMG);
    $authNS = auth_quickaclcheck("{$imgNS}:*");
    if ($authNS >= AUTH_UPLOAD) {
        echo '<p><a href="' . media_managerURL(array('ns' => $imgNS, 'image' => $IMG)) . '">' . $lang['img_manager'] . '</a></p>';
    }
    ?>

      <dl class="img_tags">
        <?php 
    $config_files = getConfigFiles('mediameta');
    foreach ($config_files as $config_file) {
        if (@file_exists($config_file)) {
            include $config_file;
        }
    }
    foreach ($fields as $key => $tag) {
        $t = array();
        if (!empty($tag[0])) {
            $t = array($tag[0]);
开发者ID:omusico,项目名称:isle-web-framework,代码行数:31,代码来源:detail.php

示例5: ajax_mediaupload

function ajax_mediaupload()
{
    global $NS, $MSG, $INPUT;
    if ($_FILES['qqfile']['tmp_name']) {
        $id = $INPUT->post->str('mediaid', $_FILES['qqfile']['name']);
    } elseif ($INPUT->get->has('qqfile')) {
        $id = $INPUT->get->str('qqfile');
    }
    $id = cleanID($id);
    $NS = $INPUT->str('ns');
    $ns = $NS . ':' . getNS($id);
    $AUTH = auth_quickaclcheck("{$ns}:*");
    if ($AUTH >= AUTH_UPLOAD) {
        io_createNamespace("{$ns}:xxx", 'media');
    }
    if ($_FILES['qqfile']['error']) {
        unset($_FILES['qqfile']);
    }
    if ($_FILES['qqfile']['tmp_name']) {
        $res = media_upload($NS, $AUTH, $_FILES['qqfile']);
    }
    if ($INPUT->get->has('qqfile')) {
        $res = media_upload_xhr($NS, $AUTH);
    }
    if ($res) {
        $result = array('success' => true, 'link' => media_managerURL(array('ns' => $ns, 'image' => $NS . ':' . $id), '&'), 'id' => $NS . ':' . $id, 'ns' => $NS);
    }
    if (!$result) {
        $error = '';
        if (isset($MSG)) {
            foreach ($MSG as $msg) {
                $error .= $msg['msg'];
            }
        }
        $result = array('error' => $msg['msg'], 'ns' => $NS);
    }
    $json = new JSON();
    echo htmlspecialchars($json->encode($result), ENT_NOQUOTES);
}
开发者ID:AlexanderS,项目名称:Part-DB,代码行数:39,代码来源:ajax.php

示例6: internalmedia

 function internalmedia($src, $title = NULL, $align = NULL, $width = NULL, $height = NULL, $cache = NULL, $linking = NULL)
 {
     global $ID;
     list($src, $hash) = explode('#', $src, 2);
     resolve_mediaid(getNS($ID), $src, $exists);
     $noLink = false;
     $render = $linking == 'linkonly' ? false : true;
     $link = $this->_getMediaLinkConf($src, $title, $align, $width, $height, $cache, $render);
     list($ext, $mime, $dl) = mimetype($src, false);
     if (substr($mime, 0, 5) == 'image' && $render) {
         $link['url'] = ml($src, array('id' => $ID, 'cache' => $cache), $linking == 'direct');
     } elseif ($mime == 'application/x-shockwave-flash' && $render) {
         // don't link flash movies
         $noLink = true;
     } else {
         // add file icons
         $class = preg_replace('/[^_\\-a-z0-9]+/i', '_', $ext);
         $link['class'] .= ' mediafile mf_' . $class;
         $link['url'] = ml($src, array('id' => $ID, 'cache' => $cache), true);
     }
     if ($hash) {
         $link['url'] .= '#' . $hash;
     }
     //markup non existing files
     if (!$exists) {
         $link['class'] .= ' wikilink2';
         $link['url'] = media_managerURL(array('tab_details' => 'view', 'image' => $src, 'ns' => getNS($src)), '&');
     }
     //output formatted
     if ($linking == 'nolink' || $noLink) {
         $this->doc .= $link['name'];
     } else {
         $this->doc .= $this->_formatLink($link);
     }
 }
开发者ID:hlxlplxl,项目名称:dokuwiki,代码行数:35,代码来源:xhtml.php

示例7: bootstrap_media_nstree_item

/**
 * Userfunction for html_buildlist
 *
 * Prints a media namespace tree item
 *
 * @author Andreas Gohr <andi@splitbrain.org>
 */
function bootstrap_media_nstree_item($item)
{
    global $INPUT;
    $pos = strrpos($item['id'], ':');
    $label = substr($item['id'], $pos > 0 ? $pos + 1 : 0);
    if (!$item['label']) {
        $item['label'] = $label;
    }
    $class = 'level' . $item['level'];
    // TODO: only deliver an image if it actually has a subtree...
    if ($item['open']) {
        $class .= ' open';
        $icon = '<i class="glyphicon glyphicon-minus"></i> ';
        $alt = '−';
    } else {
        $class .= ' closed';
        $icon = '<i class="glyphicon glyphicon-plus"></i> ';
        $alt = '+';
    }
    $ret = '<li class="' . $class . '">';
    if (!($INPUT->str('do') == 'media')) {
        $ret .= '<a href="' . DOKU_BASE . 'lib/exe/mediamanager.php?ns=' . idfilter($item['id']) . '" class="idx_dir">';
    } else {
        $ret .= '<a href="' . media_managerURL(array('ns' => idfilter($item['id'], false), 'tab_files' => 'files')) . '>';
    }
    $ret .= $icon;
    $ret .= $item['label'];
    $ret .= '</a>';
    return $ret;
}
开发者ID:projectesIF,项目名称:Ateneu,代码行数:37,代码来源:tpl_functions.php

示例8: media_nstree_item

/**
 * Userfunction for html_buildlist
 *
 * Prints a media namespace tree item
 *
 * @author Andreas Gohr <andi@splitbrain.org>
 */
function media_nstree_item($item)
{
    global $INPUT;
    $pos = strrpos($item['id'], ':');
    $label = substr($item['id'], $pos > 0 ? $pos + 1 : 0);
    if (empty($item['label'])) {
        $item['label'] = $label;
    }
    $ret = '';
    if (!($INPUT->str('do') == 'media')) {
        $ret .= '<a href="' . DOKU_BASE . 'lib/exe/mediamanager.php?ns=' . idfilter($item['id']) . '" class="idx_dir">';
    } else {
        $ret .= '<a href="' . media_managerURL(array('ns' => idfilter($item['id'], false), 'tab_files' => 'files')) . '" class="idx_dir">';
    }
    $ret .= $item['label'];
    $ret .= '</a>';
    return $ret;
}
开发者ID:yjliugit,项目名称:dokuwiki,代码行数:25,代码来源:media.php

示例9: ajax_mediaupload

function ajax_mediaupload()
{
    global $NS, $MSG;
    if ($_FILES['qqfile']['tmp_name']) {
        $id = empty($_POST['mediaid']) ? $_FILES['qqfile']['name'] : $_POST['mediaid'];
    } elseif (isset($_GET['qqfile'])) {
        $id = $_GET['qqfile'];
    }
    $id = cleanID($id, false, true);
    $NS = $_REQUEST['ns'];
    $ns = $NS . ':' . getNS($id);
    $AUTH = auth_quickaclcheck("{$ns}:*");
    if ($AUTH >= AUTH_UPLOAD) {
        io_createNamespace("{$ns}:xxx", 'media');
    }
    if ($_FILES['qqfile']['error']) {
        unset($_FILES['qqfile']);
    }
    if ($_FILES['qqfile']['tmp_name']) {
        $res = media_upload($NS, $AUTH, $_FILES['qqfile']);
    }
    if (isset($_GET['qqfile'])) {
        $res = media_upload_xhr($NS, $AUTH);
    }
    if ($res) {
        $result = array('success' => true, 'link' => media_managerURL(array('ns' => $ns, 'image' => $NS . ':' . $id), '&'), 'id' => $NS . ':' . $id, 'ns' => $NS);
    }
    if (!$result) {
        $error = '';
        if (isset($MSG)) {
            foreach ($MSG as $msg) {
                $error .= $msg['msg'];
            }
        }
        $result = array('error' => $msg['msg'], 'ns' => $NS);
    }
    echo htmlspecialchars(json_encode($result), ENT_NOQUOTES);
}
开发者ID:hlxlplxl,项目名称:dokuwiki,代码行数:38,代码来源:ajax.php

示例10: rss_buildItems

/**
 * Add recent changed pages to a feed object
 *
 * @author Andreas Gohr <andi@splitbrain.org>
 * @param  FeedCreator $rss the FeedCreator Object
 * @param  array       $data the items to add
 * @param  array       $opt  the feed options
 */
function rss_buildItems(&$rss, &$data, $opt)
{
    global $conf;
    global $lang;
    /* @var auth_basic $auth */
    global $auth;
    $eventData = array('rss' => &$rss, 'data' => &$data, 'opt' => &$opt);
    $event = new Doku_Event('FEED_DATA_PROCESS', $eventData);
    if ($event->advise_before(false)) {
        foreach ($data as $ditem) {
            if (!is_array($ditem)) {
                // not an array? then only a list of IDs was given
                $ditem = array('id' => $ditem);
            }
            $item = new FeedItem();
            $id = $ditem['id'];
            if (!$ditem['media']) {
                $meta = p_get_metadata($id);
            } else {
                $meta = array();
            }
            // add date
            if ($ditem['date']) {
                $date = $ditem['date'];
            } elseif ($ditem['media']) {
                $date = @filemtime(mediaFN($id));
            } elseif (@file_exists(wikiFN($id))) {
                $date = @filemtime(wikiFN($id));
            } elseif ($meta['date']['modified']) {
                $date = $meta['date']['modified'];
            } else {
                $date = 0;
            }
            if ($date) {
                $item->date = date('r', $date);
            }
            // add title
            if ($conf['useheading'] && $meta['title']) {
                $item->title = $meta['title'];
            } else {
                $item->title = $ditem['id'];
            }
            if ($conf['rss_show_summary'] && !empty($ditem['sum'])) {
                $item->title .= ' - ' . strip_tags($ditem['sum']);
            }
            // add item link
            switch ($opt['link_to']) {
                case 'page':
                    if ($ditem['media']) {
                        $item->link = media_managerURL(array('image' => $id, 'ns' => getNS($id), 'rev' => $date), '&', true);
                    } else {
                        $item->link = wl($id, 'rev=' . $date, true, '&');
                    }
                    break;
                case 'rev':
                    if ($ditem['media']) {
                        $item->link = media_managerURL(array('image' => $id, 'ns' => getNS($id), 'rev' => $date, 'tab_details' => 'history'), '&', true);
                    } else {
                        $item->link = wl($id, 'do=revisions&rev=' . $date, true, '&');
                    }
                    break;
                case 'current':
                    if ($ditem['media']) {
                        $item->link = media_managerURL(array('image' => $id, 'ns' => getNS($id)), '&', true);
                    } else {
                        $item->link = wl($id, '', true, '&');
                    }
                    break;
                case 'diff':
                default:
                    if ($ditem['media']) {
                        $item->link = media_managerURL(array('image' => $id, 'ns' => getNS($id), 'rev' => $date, 'tab_details' => 'history', 'mediado' => 'diff'), '&', true);
                    } else {
                        $item->link = wl($id, 'rev=' . $date . '&do=diff', true, '&');
                    }
            }
            // add item content
            switch ($opt['item_content']) {
                case 'diff':
                case 'htmldiff':
                    if ($ditem['media']) {
                        $revs = getRevisions($id, 0, 1, 8192, true);
                        $rev = $revs[0];
                        $src_r = '';
                        $src_l = '';
                        if ($size = media_image_preview_size($id, false, new JpegMeta(mediaFN($id)), 300)) {
                            $more = 'w=' . $size[0] . '&h=' . $size[1] . 't=' . @filemtime(mediaFN($id));
                            $src_r = ml($id, $more);
                        }
                        if ($rev && ($size = media_image_preview_size($id, $rev, new JpegMeta(mediaFN($id, $rev)), 300))) {
                            $more = 'rev=' . $rev . '&w=' . $size[0] . '&h=' . $size[1];
                            $src_l = ml($id, $more);
//.........这里部分代码省略.........
开发者ID:omusico,项目名称:isle-web-framework,代码行数:101,代码来源:feed.php


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