本文整理汇总了PHP中wpfb_call函数的典型用法代码示例。如果您正苦于以下问题:PHP wpfb_call函数的具体用法?PHP wpfb_call怎么用?PHP wpfb_call使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了wpfb_call函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: ParseHeaderFooter
private function ParseHeaderFooter($str, $uid = null)
{
$str = preg_replace_callback('/%sort_?link:([a-z0-9_]+)%/i', array(__CLASS__, 'GenSortlink'), $str);
if (strpos($str, '%search_form%') !== false) {
wpfb_loadclass('Output');
$str = str_replace('%search_form%', WPFB_Output::GetSearchForm("", $_GET), $str);
}
$str = preg_replace_callback('/%print_?(script|style):([a-z0-9_-]+)%/i', array(__CLASS__, 'PrintScriptCallback'), $str);
if (empty($uid)) {
$uid = uniqid();
}
$str = str_replace('%uid%', $uid, $str);
$count = 0;
$str = preg_replace("/jQuery\\((.+?)\\)\\.dataTable\\s*\\((.*?)\\)(\\.?.*?)\\s*;/", 'jQuery($1).dataTable((function(options){/*%WPFB_DATA_TABLE_OPTIONS_FILTER%*/})($2))$3;', $str, -1, $count);
if ($count > 0) {
$dataTableOptions = array();
list($sort_field, $sort_dir) = wpfb_call('Output', 'ParseSorting', $this->current_list->file_order);
$file_tpl = WPFB_Core::GetTpls('file', $this->file_tpl_tag);
if (($p = strpos($file_tpl, "%{$sort_field}%")) > 0) {
// get the column index of field to sort
$col_index = substr_count($file_tpl, "</t", 0, $p);
$dataTableOptions["aaSorting"] = array(array($col_index, strtolower($sort_dir)));
}
if ($this->current_list->page_limit > 0) {
$dataTableOptions["iDisplayLength"] = $this->current_list->page_limit;
}
$str = str_replace('/*%WPFB_DATA_TABLE_OPTIONS_FILTER%*/', " var wpfbOptions = " . json_encode($dataTableOptions) . "; " . " if('object' == typeof(options)) { for (var v in options) { wpfbOptions[v] = options[v]; } }" . " return wpfbOptions; ", $str);
}
return $str;
}
开发者ID:parsonsc,项目名称:dofe,代码行数:30,代码来源:ListTpl.php
示例2: Display
static function Display()
{
wpfb_loadclass('Output', 'File', 'Category', 'TplLib');
$content = '';
$file_tpls = WPFB_Core::GetTpls('file');
$cat_tpls = WPFB_Core::GetTpls('cat');
if (true || !isset($file_tpls['filebrowser_admin'])) {
$file_tpls['filebrowser_admin'] = '%file_small_icon% ' . '%file_display_name% (<a href="%file_url%">%file_name%</a>, %file_size%) ' . '<!-- IF %file_user_can_edit% --><a href="%file_edit_url%" class="edit" onclick="wpfbFBEditFile(event)">%\'Edit\'%</a><!-- ENDIF -->' . '<!-- IF %file_user_can_edit% --><a href="#" class="delete" onclick="return confirm(\'Sure?\') && wpfbFBDelete(event) && false;">%\'Delete\'%</a><!-- ENDIF -->';
WPFB_Core::SetFileTpls($file_tpls);
//WPFB_Admin::ParseTpls();
}
if (true || !isset($cat_tpls['filebrowser_admin'])) {
$cat_tpls['filebrowser_admin'] = '<span class="cat-icon" style="background-image:url(\'%cat_icon_url%\');"><span class="cat-icon-overlay"></span></span>' . '%cat_name% (%cat_num_files% / %cat_num_files_total%)' . '<!-- IF %cat_user_can_edit% --><a href="%cat_edit_url%" class="edit" onclick="wpfbFBEditCat(event)">%\'Edit\'%</a><!-- ENDIF -->' . '<!-- IF %cat_user_can_edit% --><a href="#" class="delete" onclick="return confirm(\'Sure?\') && wpfbFBDelete(event) && false;">%\'Delete\'%</a><!-- ENDIF -->';
WPFB_Core::SetCatTpls($cat_tpls);
WPFB_Admin::ParseTpls();
}
WPFB_Output::FileBrowser($content, 0, empty($_GET['wpfb_cat']) ? 0 : intval($_GET['wpfb_cat']));
wpfb_call('Output', 'PrintJS');
?>
<div class="wrap filebrowser-admin">
<h2><?php
_e('File Browser', 'wp-filebase');
?>
</h2>
<?php
echo '<div>' . __('You can Drag & Drop (multiple) files directly on Categories to upload them. Dragging a category or an existing file to another category is also possible.', 'wp-filebase') . '</div>';
echo $content;
?>
</div>
<script>
function wpfbFBEditCat(e) {
e.stopPropagation();
}
function wpfbFBEditFile(e) {
e.stopPropagation();
}
function wpfbFBDelete(e) {
e.stopPropagation();
var t = jQuery(e.currentTarget).parents('li').first();
var d = {wpfb_action: 'delete'};
var tid = t.attr('id').split('-');
d[tid[tid.length-2]+'_id'] = +tid[tid.length-1];
jQuery.ajax({type: 'POST', url: wpfbConf.ajurl, data: d,
//async: false,
success: (function (data) {
if (data == '1') {
t.fadeOut(300, function() { t.remove(); });
}
})
});
return false;
}
</script>
<?php
}
开发者ID:noxian,项目名称:WP-Filebase,代码行数:59,代码来源:AdminGuiFileBrowser.php
示例3: CheckTraffic
static function CheckTraffic($file_size)
{
$traffic = wpfb_call('Misc', 'GetTraffic');
$limit_month = WPFB_Core::$settings->traffic_month * 1073741824;
//GiB
$limit_day = WPFB_Core::$settings->traffic_day * 1048576;
// MiB
return ($limit_month == 0 || $traffic['month'] + $file_size < $limit_month) && ($limit_day == 0 || $traffic['today'] + $file_size < $limit_day);
}
开发者ID:uwmadisoncals,项目名称:Cluster-Plugins,代码行数:9,代码来源:Download.php
示例4: PluginsApiFilter
static function PluginsApiFilter($res, $action, $args)
{
global $user_ID;
$res = wpfb_call('ExtensionLib', 'QueryAvailableExtensions');
if ($user_ID && !empty($res->info['tag_time'])) {
update_user_option($user_ID, 'wpfb_ext_tagtime', $res->info['tag_time']);
}
return $res;
}
开发者ID:bruno-barros,项目名称:w.eloquent.light,代码行数:9,代码来源:AdmInstallExt.php
示例5: TplFieldsSelect
static function TplFieldsSelect($input, $short = false, $for_cat = false)
{
$out = __('Add template variable:', WPFB) . ' <select name="_wpfb_tpl_fields" onchange="WPFB_AddTplVar(this, \'' . $input . '\')"><option value="">' . __('Select') . '</option>';
foreach (wpfb_call('Models', 'TplVarsDesc', $for_cat) as $tag => $desc) {
$out .= '<option value="' . $tag . '" title="' . $desc . '">' . $tag . ($short ? '' : ' (' . $desc . ')') . '</option>';
}
$out .= '</select>';
$out .= '<small>(' . __('For some files there are more tags available. You find a list of all tags below the form when editing a file.', WPFB) . '</small>';
return $out;
}
开发者ID:bruno-barros,项目名称:w.eloquent.light,代码行数:10,代码来源:Models.php
示例6: PluginsApiFilter
static function PluginsApiFilter($res, $action, $args)
{
global $user_ID;
$res = wpfb_call('ExtensionLib', 'QueryAvailableExtensions');
if (!$res || empty($res->info)) {
wp_die('WP-Filebase extension directory is currently not available.');
return false;
}
if ($user_ID && !empty($res->info['tag_time'])) {
update_user_option($user_ID, 'wpfb_ext_tagtime', $res->info['tag_time']);
}
return $res;
}
开发者ID:TishoTM,项目名称:WP-Filebase,代码行数:13,代码来源:AdmInstallExt.php
示例7: AdminBar
static function AdminBar()
{
global $wp_admin_bar;
wpfb_call('Output', 'PrintJS');
$wp_admin_bar->add_menu(array('id' => WPFB, 'title' => WPFB_PLUGIN_NAME, 'href' => admin_url('admin.php?page=wpfilebase_manage')));
$wp_admin_bar->add_menu(array('parent' => WPFB, 'id' => WPFB . '-add-file', 'title' => __('Add File', 'wp-filebase'), 'href' => admin_url('admin.php?page=wpfilebase_files#addfile')));
$current_object = get_queried_object();
$is_filebrowser = false;
if (!empty($current_object) && !empty($current_object->post_type) && $current_object->ID > 0) {
if ($current_object->post_type != 'wpfb_filepage') {
$is_filebrowser = $current_object->ID == WPFB_Core::$settings->file_browser_post_id;
$link = esc_attr(admin_url('admin.php?wpfilebase-screen=editor-plugin&manage_attachments=1&post_id=' . $current_object->ID));
$wp_admin_bar->add_menu(array('parent' => WPFB, 'id' => WPFB . '-attachments', 'title' => __('Manage attachments', 'wp-filebase'), 'href' => $link, 'meta' => array('onclick' => 'window.open("' . $link . '", "wpfb-manage-attachments", "width=680,height=400,menubar=no,location=no,resizable=no,status=no,toolbar=no,scrollbars=yes");return false;')));
} else {
$wp_admin_bar->add_menu(array('parent' => WPFB, 'id' => WPFB . '-edit-file', 'title' => __('Edit File', 'wp-filebase'), 'href' => get_edit_post_link($current_object->ID)));
}
}
$wp_admin_bar->add_menu(array('parent' => WPFB, 'id' => WPFB . '-add-file', 'title' => __('Sync Filebase', 'wp-filebase'), 'href' => admin_url('admin.php?page=wpfilebase_manage&action=sync')));
$wp_admin_bar->add_menu(array('parent' => WPFB, 'id' => WPFB . '-toggle-context-menu', 'title' => !empty(WPFB_Core::$settings->file_context_menu) ? __('Disable file context menu', 'wp-filebase') : __('Enable file context menu', 'wp-filebase'), 'href' => 'javascript:;', 'meta' => array('onclick' => 'return wpfb_toggleContextMenu();')));
if ($is_filebrowser) {
$wp_admin_bar->add_menu(array('parent' => WPFB, 'id' => WPFB . '-toggle-drag-drop', 'title' => get_user_option('wpfb_set_fbdd') ? __('Disable file browser Drag & Drop', 'wp-filebase') : __('Enable file browser Drag & Drop', 'wp-filebase'), 'href' => 'javascript:;', 'meta' => array('onclick' => 'jQuery.ajax({url:wpfbConf.ajurl,type:"POST",data:{wpfb_action:"set-user-setting",name:"fbdd",value:' . (get_user_option('wpfb_set_fbdd') ? 0 : 1) . '},async:false});location.reload();return false;')));
}
}
开发者ID:noxian,项目名称:WP-Filebase,代码行数:23,代码来源:AdminBar.php
示例8: Display
public function Display()
{
wpfb_call('Output', 'PrintJS');
wp_print_scripts('utils');
// setUserSetting
?>
<style type="text/css" media="screen">@import url(<?php
echo WPFB_PLUGIN_URI . 'css/batch-uploader.css';
?>
);</style>
<div id="<?php
echo $this->prefix;
?>
-uploader-wrap">
<div id="<?php
echo $this->prefix;
?>
-uploader-interface" class="wpfb-batch-uploader-interface">
<div class="form-wrap uploader-presets" id="<?php
echo $this->prefix;
?>
-uploader-presets">
<form method="POST" action="" class="validate" name="batch_presets">
<h2><?php
_e('Upload Presets', 'wp-filebase');
?>
</h2>
<?php
self::DisplayUploadPresets($this->prefix);
//wp_nonce_field('batch-presets'); // TODO validate this!
?>
</form>
</div>
<div id="<?php
echo $this->prefix;
?>
-drag-drop-uploader" class="drag-drop-uploader">
<h2>Drag & Drop</h2>
<div id="<?php
echo $this->prefix;
?>
-drag-drop-area" class="drag-drop-area">
<div style="margin: 70px auto 0;">
<p class="drag-drop-info"><?php
_e('Drop files here');
?>
</p>
<p><?php
_ex('or', 'Uploader: Drop files here - or - Select Files');
?>
</p>
<p class="drag-drop-buttons"><input id="<?php
echo $this->prefix;
?>
-browse-button" type="button" value="<?php
esc_attr_e('Select Files');
?>
" class="button" /></p>
</div>
</div>
<div id="<?php
echo $this->prefix;
?>
-uploader-errors"></div>
</div>
<div style="clear: both;"></div>
</div>
<div id="<?php
echo $this->prefix;
?>
-uploader-files" style="position:relative;"></div>
</div>
<?php
wp_print_scripts('jquery-color');
wp_print_scripts('jquery-deserialize');
?>
<script type="text/javascript">
var mouseDragPos = [];
var presetData = '';
var morePresets = 0;
jQuery(document).ready( function() {
var form = jQuery('#<?php
echo $this->prefix;
?>
-uploader-presets').find('form');
jQuery('#<?php
echo $this->prefix;
?>
-drag-drop-area').bind('dragover', function(e){
mouseDragPos = [e.originalEvent.pageX, e.originalEvent.pageY];
});
//.........这里部分代码省略.........
开发者ID:noxian,项目名称:WP-Filebase,代码行数:101,代码来源:BatchUploader.php
示例9: GetMemStats
static function GetMemStats()
{
static $limit = -2;
if ($limit == -2) {
$limit = wpfb_call("Misc", "ParseIniFileSize", ini_get('memory_limit'));
}
return array('limit' => $limit, 'used' => max(memory_get_usage(true), memory_get_usage()));
}
开发者ID:bruno-barros,项目名称:w.eloquent.light,代码行数:8,代码来源:Sync.php
示例10: GetTreeItems
static function GetTreeItems($parent_id, $type = 'browser', $args = array())
{
/* $args = array(
* sort_cats
* sort_files
* cats_only
* exclude_attached
* priv
* cat_id_fmt =>
* file_id_fmt =>
* onselect
* );
*/
$parent_id = is_object($parent_id) ? $parent_id->cat_id : intval($parent_id);
$browser = $type === 'browser';
$filesel = $type === 'fileselect';
$catsel = $type === 'catselect';
if ($parent_id > 0 && (is_null($cat = WPFB_Category::GetCat($parent_id)) || !$cat->CurUserCanAccess())) {
return array((object) array('id' => 0, 'text' => WPFB_Core::$settings->cat_inaccessible_msg));
}
$sql_sort_files = $browser ? WPFB_Core::GetSortSql((WPFB_Core::$settings->file_browser_file_sort_dir ? '>' : '<') . WPFB_Core::$settings->file_browser_file_sort_by) : 'file_display_name';
$sql_sort_cats = $browser ? WPFB_Core::GetSortSql((WPFB_Core::$settings->file_browser_cat_sort_dir ? '>' : '<') . WPFB_Core::$settings->file_browser_cat_sort_by, false, true) : 'cat_name';
$cat_id_format = empty($args['cat_id_fmt']) ? 'wpfb-cat-%d' : $args['cat_id_fmt'];
$file_id_format = empty($args['file_id_fmt']) ? 'wpfb-file-%d' : $args['file_id_fmt'];
if ($filesel || $catsel) {
$onselect = $args['onselect'];
}
$files_before_cats = $browser && WPFB_Core::$settings->file_browser_fbc;
$where = " cat_parent = {$parent_id} ";
if ($browser) {
$where .= " AND cat_exclude_browser <> '1' ";
}
$cats = WPFB_Category::GetCats("WHERE {$where} ORDER BY {$sql_sort_cats}");
$cat_items = array();
$i = 0;
foreach ($cats as $c) {
if ($c->CurUserCanAccess(true)) {
$cat_items[$i++] = (object) array('id' => sprintf($cat_id_format, $c->cat_id), 'cat_id' => $c->cat_id, 'text' => $catsel ? '<a href="javascript:' . sprintf($onselect, $c->cat_id, str_replace('\'', '\\\'', htmlspecialchars(stripslashes($c->cat_name)))) . '">' . esc_html($c->GetTitle(24)) . '</a>' : ($filesel ? esc_html($c->cat_name) . " ({$c->cat_num_files} / {$c->cat_num_files_total})" : $c->GenTpl2('filebrowser', false)), 'hasChildren' => $c->HasChildren($catsel), 'classes' => $filesel || $catsel ? 'folder' : null);
}
}
if ($parent_id == 0 && $catsel && $i == 0) {
return array((object) array('id' => sprintf($cat_id_format, 0), 'text' => sprintf(__('You did not create a category. <a href="%s" target="_parent">Click here to create one.</a>', WPFB), admin_url('admin.php?page=wpfilebase_cats#addcat')), 'hasChildren' => false));
}
$file_items = array();
$i = 0;
if (empty($args['cats_only']) && !$catsel) {
$where = WPFB_File::GetSqlCatWhereStr($parent_id);
if (!empty($args['exclude_attached'])) {
$where .= " AND `file_post_id` = 0";
}
// $files = WPFB_File::GetFiles2(WPFB_File::GetSqlCatWhereStr($root_id), WPFB_Core::$settings->hide_inaccessible, $sql_file_order);
//$files = WPFB_File::GetFiles2(WPFB_File::GetSqlCatWhereStr($root_id), WPFB_Core::$settings->hide_inaccessible, $sql_file_order);
$files = WPFB_File::GetFiles2($where, WPFB_Core::$settings->hide_inaccessible && !($filesel && wpfb_call('Admin', 'CurUserCanUpload')), $sql_sort_files);
foreach ($files as $f) {
$file_items[$i++] = (object) array('id' => sprintf($file_id_format, $f->file_id), 'text' => $filesel ? '<a href="javascript:' . sprintf($onselect, $f->file_id, str_replace('\'', '\\\'', htmlspecialchars(stripslashes($f->file_display_name)))) . '">' . esc_html($f->GetTitle(24)) . '</a> <span style="font-size:75%;vertical-align:top;">' . esc_html($f->file_name) . '</span>' : $f->GenTpl2('filebrowser', false), 'classes' => $filesel ? 'file' : null, 'hasChildren' => false);
}
}
return $files_before_cats ? array_merge($file_items, $cat_items) : array_merge($cat_items, $file_items);
}
开发者ID:Seravo,项目名称:WP-Filebase,代码行数:59,代码来源:Output.php
示例11: ChangeCategoryOrName
function ChangeCategoryOrName($new_cat_id, $new_name = null, $add_existing = false, $overwrite = false)
{
// 1. apply new values (inherit permissions if nothing (Everyone) set!)
// 2. check for name collision and rename
// 3. move stuff
// 4. notify parents
// 5. update child paths
if (empty($new_name)) {
$new_name = $this->GetName();
} elseif (!$add_existing) {
$new_name = sanitize_file_name($new_name);
}
// also removes ()!
$this->Lock(true);
$new_cat_id = intval($new_cat_id);
$old_cat_id = $this->GetParentId();
$old_path_rel = $this->GetLocalPathRel(true);
$old_path = $this->GetLocalPath();
$old_name = $this->GetName();
if ($this->is_file) {
$old_thumb_path = $this->GetThumbPath();
}
$old_cat = $this->GetParent();
$new_cat = WPFB_Category::GetCat($new_cat_id);
if (!$new_cat) {
$new_cat_id = 0;
}
$cat_changed = $new_cat_id != $old_cat_id;
if ($cat_changed && $new_cat_id > 0 && $this->IsAncestorOf($new_cat)) {
return array('error' => __('Cannot move category into a sub-category of itself.', 'wp-filebase'));
}
// strip accents/umlauts
if ($new_name != $old_name) {
if ($this->is_file && $add_existing) {
$this->file_name_original = rawurldecode($new_name);
// expect utf8 chars to be urlencoded on disk, so decode them
} else {
$prev_new_name = $new_name;
$new_name = remove_accents($new_name);
// sanitize, but make sure not to strip too much
$sani = sanitize_file_name($new_name);
if (strlen($sani) >= 6) {
$new_name = $sani;
}
if (wpfb_call('Misc', 'IsUtf8', $new_name)) {
$new_name = rawurlencode($new_name);
}
if ($this->is_file) {
$this->file_name_original = $prev_new_name;
}
}
}
// unset original name if equal to actual
if ($this->is_file && $new_name === $this->file_name_original) {
$this->file_name_original = '';
}
if ($this->is_file) {
$this->file_category = $new_cat_id;
$this->file_name = $new_name;
$this->file_category_name = $new_cat_id == 0 ? '' : $new_cat->GetTitle();
} else {
$this->cat_parent = $new_cat_id;
$this->cat_folder = $new_name;
}
// inherit user roles
if (count($this->GetReadPermissions()) == 0) {
$this->SetReadPermissions($new_cat_id != 0 ? $new_cat->GetReadPermissions() : WPFB_Core::$settings->default_roles);
}
// flush cache
$this->last_parent_id = -1;
$new_path_rel = $this->GetLocalPathRel(true);
$new_path = $this->GetLocalPath();
if ($new_path_rel != $old_path_rel) {
$i = 1;
if (!$add_existing) {
$name = $this->GetName();
if ($overwrite) {
if (@file_exists($new_path)) {
$ex_file = WPFB_File::GetByPath($new_path_rel);
if (!is_null($ex_file)) {
$ex_file->Remove();
} else {
@unlink($new_path);
}
}
} else {
// rename item if filename collision (ignore if coliding with $this and ignore existing folders that does not belong to categories)
while (@file_exists($new_path) && ($this->is_file || !is_dir($new_path) || !is_null(WPFB_Item::GetByPath($new_path_rel))) || !is_null($ex_file = WPFB_Item::GetByPath($new_path_rel)) && !$this->Equals($ex_file)) {
$i++;
if ($this->is_file) {
$p = strrpos($name, '.');
$this->file_name = $p <= 0 ? "{$name}_{$i}" : substr($name, 0, $p) . "_{$i}" . substr($name, $p);
} else {
$this->cat_folder = "{$name}_{$i}";
}
$new_path_rel = $this->GetLocalPathRel(true);
$new_path = $this->GetLocalPath();
}
}
}
//.........这里部分代码省略.........
开发者ID:noxian,项目名称:WP-Filebase,代码行数:101,代码来源:Item.php
示例12: PluginsApiFilter
static function PluginsApiFilter($value, $action = null, $args = null)
{
if (!is_object($args)) {
$args = (object) $args;
}
return $action === 'plugin_information' && (strpos($args->slug, "wp-filebase") === 0 || strpos($args->slug, "wpfb-") === 0) ? wpfb_call('ExtensionLib', 'GetApiPluginInfo', $args->slug) : $value;
}
开发者ID:bruno-barros,项目名称:w.eloquent.light,代码行数:7,代码来源:Core.php
示例13: Display
static function Display()
{
global $wpdb, $user_ID;
require_once ABSPATH . 'wp-admin/includes/dashboard.php';
wpfb_loadclass('AdminDashboard');
add_thickbox();
wp_enqueue_script('dashboard');
if (wp_is_mobile()) {
wp_enqueue_script('jquery-touch-punch');
}
//register_shutdown_function( create_function('','$error = error_get_last(); if( $error && $error[\'type\'] != E_STRICT ){print_r( $error );}else{return true;}') );
wpfb_loadclass('File', 'Category', 'Admin', 'Output');
$_POST = stripslashes_deep($_POST);
$_GET = stripslashes_deep($_GET);
$action = !empty($_POST['action']) ? $_POST['action'] : (!empty($_GET['action']) ? $_GET['action'] : '');
$clean_uri = remove_query_arg(array('message', 'action', 'file_id', 'cat_id', 'deltpl', 'hash_sync', 'doit', 'ids', 'files', 'cats', 'batch_sync'));
// keep search keyword
WPFB_Admin::PrintFlattrHead();
?>
<script type="text/javascript">
/* Liking/Donate Bar */
if(typeof(jQuery) != 'undefined') {
jQuery(document).ready(function(){
if(getUserSetting("wpfilebase_hidesuprow",false) == 1) {
jQuery('#wpfb-liking').hide();
jQuery('#wpfb-liking-toggle').addClass('closed');
}
jQuery('#wpfb-liking-toggle').click(function(){
jQuery('#wpfb-liking').slideToggle();
jQuery(this).toggleClass('closed');
setUserSetting("wpfilebase_hidesuprow", 1-getUserSetting("wpfilebase_hidesuprow",false), 0);
});
});
}
</script>
<div class="wrap">
<div id="icon-wpfilebase" class="icon32"><br /></div>
<h2><?php
echo WPFB_PLUGIN_NAME;
?>
</h2>
<?php
switch ($action) {
default:
$clean_uri = remove_query_arg('pagenum', $clean_uri);
$upload_dir = WPFB_Core::UploadDir();
$upload_dir_rel = str_replace(ABSPATH, '', $upload_dir);
$chmod_cmd = "CHMOD " . WPFB_PERM_DIR . " " . $upload_dir_rel;
if (!is_dir($upload_dir)) {
$result = WPFB_Admin::Mkdir($upload_dir);
if ($result['error']) {
$error_msg = sprintf(__('The upload directory <code>%s</code> does not exists. It could not be created automatically because the directory <code>%s</code> is not writable. Please create <code>%s</code> and make it writable for the webserver by executing the following FTP command: <code>%s</code>', 'wp-filebase'), $upload_dir_rel, str_replace(ABSPATH, '', $result['parent']), $upload_dir_rel, $chmod_cmd);
} else {
wpfb_call('Setup', 'ProtectUploadPath');
}
} elseif (!is_writable($upload_dir)) {
$error_msg = sprintf(__('The upload directory <code>%s</code> is not writable. Please make it writable for PHP by executing the follwing FTP command: <code>%s</code>', 'wp-filebase'), $upload_dir_rel, $chmod_cmd);
}
if (!empty($error_msg)) {
echo '<div class="error default-password-nag"><p>' . $error_msg . '</p></div>';
}
if (!empty(WPFB_Core::$settings->tag_conv_req)) {
echo '<div class="updated"><p><a href="' . add_query_arg('action', 'convert-tags') . '">';
_e('WP-Filebase content tags must be converted', 'wp-filebase');
echo '</a></p></div><div style="clear:both;"></div>';
}
?>
<?php
if (self::PluginHasBeenUsedAWhile(true)) {
self::ProUpgradeNag();
}
if (self::PluginHasBeenUsedAWhile()) {
?>
<div id="wpfb-support-col">
<div id="wpfb-liking-toggle"></div>
<h3><?php
_e('Like WP-Filebase?', 'wp-filebase');
?>
</h3>
<div id="wpfb-liking">
<!-- <div style="text-align: center;"><iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwordpress.org%2Fextend%2Fplugins%2Fwp-filebase%2F&send=false&layout=button_count&width=150&show_faces=false&action=like&colorscheme=light&font&height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:140px; height:21px; display:inline-block; text-align:center;" <?php
echo ' allowTransparency="true"';
?>
></iframe></div> -->
<div style="text-align: center;" ><a href="https://twitter.com/wpfilebase" class="twitter-follow-button" data-show-count="false">Follow @wpfilebase</a>
<script type="text/javascript">!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script></div>
<p>Please <a href="http://wordpress.org/support/view/plugin-reviews/wp-filebase">give it a good rating</a>.</p>
<p>For Cloud support and lots of other advanced features consider an</p>
<p style="text-align: center;"><a href="https://wpfilebase.com/?ref=dblike" class="button-primary">Upgrade to Pro</a></p>
<p style="text-align: center;"><a href="http://demo.wpfilebase.com/?ref=dblike" class="button">Live Pro Demo</a></p>
<p style="text-align:right;float:right;font-style:italic;">Thanks, Fabian</p>
<!-- <div style="text-align: center;">
<?php
//WPFB_Admin::PrintPayPalButton()
//.........这里部分代码省略.........
开发者ID:noxian,项目名称:WP-Filebase,代码行数:101,代码来源:AdminGuiManage.php
示例14: _e
?>
</label>
<input type="radio" name="list-cat-sort-order" id="list-cat-sort-order-desc" value="desc" />
<label for="list-cat-sort-order-desc" class="radio"><?php
_e('Descending');
?>
</label>
</p>
</form>
<?php
do_action('wpfilebase_editor_plugin_tabs');
}
/*manage_attachments*/
?>
<?php
do_action('admin_print_footer_scripts');
?>
<script type="text/javascript">
initEditorPlugin();
if(typeof wpOnload=='function')wpOnload();
</script>
<?php
wpfb_call('Output', 'PrintJS');
/* only required for wpfbConf */
?>
</body>
</html>
开发者ID:noxian,项目名称:WP-Filebase,代码行数:31,代码来源:editor-plugin.php
示例15: GetTreeItems
static function GetTreeItems($parent_id, $args = array())
{
/* $args = array(
* sort_cats
* sort_files
* cats_only
* exclude_attached
* priv
* idp =>
* onselect
* );
*/
$parent_id = is_object($parent_id) ? $parent_id->cat_id : intval($parent_id);
$args = self::fileBrowserArgs($args);
$type = $args['type'];
$browser = $type === 'browser';
$filesel = $type === 'fileselect';
$catsel = $type === 'catselect';
$args['idp'] = wp_strip_all_tags($args['idp']);
$idp_cat = $args['idp'] . 'cat-';
$idp_file = $args['idp'] . 'file-';
$file_tpl = $cat_tpl = !empty($args['tpl']) ? $args['tpl'] : (($is_admin = !empty($args['is_admin'])) ? 'filebrowser_admin' : 'filebrowser');
if ($parent_id > 0 && (is_null($cat = WPFB_Category::GetCat($parent_id)) || !$cat->CurUserCanAccess())) {
return array((object) array('id' => 0, 'text' => WPFB_Core::$settings->cat_inaccessible_msg));
}
$sql_sort_files = $browser ? WPFB_Core::GetSortSql((WPFB_Core::$settings->file_browser_file_sort_dir ? '>' : '<') . WPFB_Core::$settings->file_browser_file_sort_by) : 'file_display_name';
$sql_sort_cats = $browser ? WPFB_Core::GetSortSql((WPFB_Core::$settings->file_browser_cat_sort_dir ? '>' : '<') . WPFB_Core::$settings->file_browser_cat_sort_by, false, true) : 'cat_name';
$files_before_cats = $browser && WPFB_Core::$settings->file_browser_fbc;
$inline_add_cat = WPFB_Core::CurUserCanCreateCat();
$where = " cat_parent = {$parent_id} ";
if ($browser) {
$where .= " AND cat_exclude_browser <> '1' ";
}
$cats = WPFB_Category::GetCats("WHERE {$where} ORDER BY {$sql_sort_cats}");
$cat_items = array();
$i = 0;
$folder_class = $filesel || $catsel ? 'folder' : '';
foreach ($cats as $c) {
if ($c->CurUserCanAccess(true)) {
$cat_items[$i++] = (object) array('id' => $idp_cat . $c->cat_id, 'cat_id' => $c->cat_id, 'text' => self::fileBrowserCatItemText($catsel, $filesel, $c, $args['onselect'], $cat_tpl), 'hasChildren' => $inline_add_cat || $c->HasChildren($catsel), 'classes' => $folder_class);
}
}
if ($inline_add_cat) {
$is = WPFB_Core::$settings->small_icon_size > 0 ? WPFB_Core::$settings->small_icon_size : 32;
$cat_items[$i++] = (object) array('id' => $idp_cat . '0', 'cat_id' => 0, 'text' => '<form action="" style="display:none;"><input type="text" placeholder="' . __('Category Name', WPFB) . '" name="cat_name" /></form> ' . '<a href="#" style="text-decoration:none;" onclick=\'return wpfb_newCatInput(this,' . $parent_id . ');\'><span style="' . ($browser ? 'font-size:' . $is . 'px;width:' . $is . 'px' : 'font-size:200%') . ';line-height:0;vertical-align:sub;display:inline-block;text-align:center;">+</span>' . __('Add Category', WPFB) . '</a>' . '<span style="font-size: 200%;vertical-align: sub;line-height: 0;font-weight: lighter;"> / </span>' . '<a href="#" style="text-decoration:none;" class="add-file"><span style="' . ($browser ? 'font-size:' . $is . 'px;width:' . $is . 'px' : 'font-size:200%') . ';line-height:0;vertical-align:sub;display:inline-block;text-align:center;">+</span>' . __('Add File', WPFB) . '</a>', 'hasChildren' => false, 'classes' => 'add-item');
} elseif ($parent_id == 0 && $catsel && $i == 0) {
return array((object) array('id' => $idp_cat . '0', 'text' => sprintf(__('You did not create a category. <a href="%s" target="_parent">Click here to create one.</a>', WPFB), admin_url('admin.php?page=wpfilebase_cats#addcat')), 'hasChildren' => false));
}
$file_items = array();
$i = 0;
if (empty($args['cats_only']) && !$catsel) {
$where = WPFB_File::GetSqlCatWhereStr($parent_id);
if (!empty($args['exclude_attached'])) {
$where .= " AND `file_post_id` = 0";
}
// $files = WPFB_File::GetFiles2(WPFB_File::GetSqlCatWhereStr($root_id), WPFB_Core::$settings->hide_inaccessible, $sql_file_order);
//$files = WPFB_File::GetFiles2(WPFB_File::GetSqlCatWhereStr($root_id), WPFB_Core::$settings->hide_inaccessible, $sql_file_order);
$files = WPFB_File::GetFiles2($where, WPFB_Core::$settings->hide_inaccessible && !($filesel && wpfb_call('Core', 'CurUserCanUpload')), $sql_sort_files);
foreach ($files as $f) {
$file_items[$i++] = (object) array('id' => $idp_file . $f->file_id, 'text' => $filesel ? '<a href="javascript:;" onclick="' . sprintf($args['onselect'], $f->file_id) . '">' . esc_html($f->GetTitle(24)) . '</a> <span style="font-size:75%;vertical-align:top;">' . esc_html($f->file_name) . '</span>' : $f->GenTpl2($file_tpl, false), 'classes' => $filesel ? 'file' : null, 'hasChildren' => false);
}
}
return $files_before_cats ? array_merge($file_items, $cat_items) : array_merge($cat_items, $file_items);
}
开发者ID:parsonsc,项目名称:dofe,代码行数:64,代码来源:Output.php
示例16: GetMaxUlSize
static function GetMaxUlSize()
{
return wpfb_call('Misc', 'ParseIniFileSize', ini_get('upload_max_filesize'));
}
开发者ID:Seravo,项目名称:WP-Filebase,代码行数:4,代码来源:Core.php
示例17: Display
static function Display()
{
global $wpdb, $user_ID;
//register_shutdown_function( create_function('','$error = error_get_last(); if( $error && $error[\'type\'] != E_STRICT ){print_r( $error );}else{return true;}') );
wpfb_loadclass('File', 'Category', 'Admin', 'Output');
$_POST = stripslashes_deep($_POST);
$_GET = stripslashes_deep($_GET);
$action = !empty($_POST['action']) ? $_POST['action'] : (!empty($_GET['action']) ? $_GET['action'] : '');
$clean_uri = remove_query_arg(array('message', 'action', 'file_id', 'cat_id', 'deltpl', 'hash_sync', 'doit', 'ids', 'files', 'cats', 'batch_sync'));
// keep search keyword
// switch simple/extended form
if (isset($_GET['exform'])) {
$exform = !empty($_GET['exform']) && $_GET['exform'] == 1;
update_user_option($user_ID, WPFB_OPT_NAME . '_exform', $exform, true);
} else {
$exform = (bool) get_user_option(WPFB_OPT_NAME . '_exform');
}
if (!empty($_GET['wpfb-hide-how-start'])) {
update_user_option($user_ID, WPFB_OPT_NAME . '_hide_how_start', 1);
}
$show_how_start = !(bool) get_user_option(WPFB_OPT_NAME . '_hide_how_start');
WPFB_Admin::PrintFlattrHead();
?>
<script type="text/javascript">
/* Liking/Donate Bar */
if(typeof(jQuery) != 'undefined') {
jQuery(document).ready(function(){
if(getUserSetting("wpfilebase_hidesuprow",false) == 1) {
jQuery('#wpfb-liking').hide();
jQuery('#wpfb-liking-toggle').addClass('closed');
}
jQuery('#wpfb-liking-toggle').click(function(){
jQuery('#wpfb-liking').slideToggle();
jQuery(this).toggleClass('closed');
setUserSetting("wpfilebase_hidesuprow", 1-getUserSetting("wpfilebase_hidesuprow",false), 0);
});
});
}
</script>
<div class="wrap">
<div id="icon-wpfilebase" class="icon32"><br /></div>
<h2><?php
echo WPFB_PLUGIN_NAME;
?>
</h2>
<?php
if ($show_how_start) {
wpfb_call('AdminHowToStart', 'Display');
}
if (!empty($_GET['action'])) {
echo '<p><a href="' . $clean_uri . '" class="button">' . __('Go back') . '</a></p>';
}
switch ($action) {
default:
$clean_uri = remove_query_arg('pagenum', $clean_uri);
$upload_dir = WPFB_Core::UploadDir();
$upload_dir_rel = str_replace(ABSPATH, '', $upload_dir);
$chmod_cmd = "CHMOD " . WPFB_PERM_DIR . " " . $upload_dir_rel;
if (!is_dir($upload_dir)) {
$result = WPFB_Admin::Mkdir($upload_dir);
if ($result['error']) {
$error_msg = sprintf(__('The upload directory <code>%s</code> does not exists. It could not be created automatically because the directory <code>%s</code> is not writable. Please create <code>%s</code> and make it writable for the webserver by executing the following FTP command: <code>%s</code>', WPFB), $upload_dir_rel, str_replace(ABSPATH, '', $result['parent']), $upload_dir_rel, $chmod_cmd);
} else {
wpfb_call('Setup', 'ProtectUploadPath');
}
} elseif (!is_writable($upload_dir)) {
$error_msg = sprintf(__('The upload directory <code>%s</code> is not writable. Please make it writable for PHP by executing the follwing FTP command: <code>%s</code>', WPFB), $upload_dir_rel, $chmod_cmd);
}
if (!empty($error_msg)) {
echo '<div class="error default-password-nag"><p>' . $error_msg . '</p></div>';
}
if (!empty(WPFB_Core::$settings->tag_conv_req)) {
echo '<div class="updated"><p><a href="' . add_query_arg('action', 'convert-tags') . '">';
_e('WP-Filebase content tags must be converted', WPFB);
echo '</a></p></div><div style="clear:both;"></div>';
}
if (!get_post(WPFB_Core::$settings->file_browser_post_id)) {
echo '<div class="updated"><p>';
printf(__('File Browser post or page not set! Some features like search will not work. <a href="%s">Click here to set the File Browser Post ID.</a>', WPFB), esc_attr(admin_url('admin.php?page=wpfilebase_sets#' . sanitize_title(__('File Browser', WPFB)))));
echo '</p></div><div style="clear:both;"></div>';
}
/*
wpfb_loadclass('Config');
if(!WPFB_Config::IsWritable()) {
echo '<div class="updated"><p>';
printf(__('The config file %s is not writable or could not be created. Please create the file and make it writable for the webserver.',WPFB), WPFB_Config::$file);
echo '</p></div><div style="clear:both;"></div>';
}
*/
?>
<?php
if (self::PluginHasBeenUsedAWhile(true)) {
self::ProUpgradeNag();
}
if (self::PluginHasBeenUsedAWhile()) {
?>
//.........这里部分代
|
请发表评论