mirror of
https://github.com/Piwigo/Piwigo.git
synced 2025-04-27 03:39:57 +03:00
feature 2108 finalize upload removal (php warnings)
git-svn-id: http://piwigo.org/svn/trunk@8652 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
parent
fe569ab1bf
commit
af6e6b55ca
3 changed files with 0 additions and 171 deletions
|
@ -495,59 +495,4 @@ function get_display_images_count($cat_nb_images, $cat_count_images, $cat_count_
|
|||
return $display_text;
|
||||
}
|
||||
|
||||
/**
|
||||
* returns the link of upload menu
|
||||
*
|
||||
* @param null
|
||||
* @return string or null
|
||||
*/
|
||||
function get_upload_menu_link()
|
||||
{
|
||||
global $conf, $page, $user;
|
||||
|
||||
$show_link = false;
|
||||
$arg_link = null;
|
||||
|
||||
if (is_autorize_status($conf['upload_user_access']))
|
||||
{
|
||||
if (isset($page['category']) and $page['category']['uploadable'] )
|
||||
{
|
||||
// upload a picture in the category
|
||||
$show_link = true;
|
||||
$arg_link = 'cat='.$page['category']['id'];
|
||||
}
|
||||
else
|
||||
if ($conf['upload_link_everytime'])
|
||||
{
|
||||
// upload a picture in the category
|
||||
$query = '
|
||||
SELECT
|
||||
1
|
||||
FROM '.CATEGORIES_TABLE.' INNER JOIN '.USER_CACHE_CATEGORIES_TABLE.'
|
||||
ON id = cat_id and user_id = '.$user['id'].'
|
||||
WHERE
|
||||
uploadable = \'true\'
|
||||
'.get_sql_condition_FandF
|
||||
(
|
||||
array
|
||||
(
|
||||
'visible_categories' => 'id',
|
||||
),
|
||||
'AND'
|
||||
).'
|
||||
LIMIT 1';
|
||||
|
||||
$show_link = pwg_db_num_rows(pwg_query($query)) <> 0;
|
||||
}
|
||||
}
|
||||
if ($show_link)
|
||||
{
|
||||
return get_root_url().'upload.php'.(empty($arg_link) ? '' : '?'.$arg_link);
|
||||
}
|
||||
else
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
|
@ -105,7 +105,6 @@ function initialize_menu()
|
|||
'NB_PICTURE' => $user['nb_total_images'],
|
||||
'MENU_CATEGORIES' => get_categories_menu(),
|
||||
'U_CATEGORIES' => make_index_url(array('section' => 'categories')),
|
||||
'U_UPLOAD' => get_upload_menu_link()
|
||||
);
|
||||
$block->template = 'menubar_categories.tpl';
|
||||
}
|
||||
|
|
|
@ -1,115 +0,0 @@
|
|||
{* Example of resizeable *}
|
||||
{*
|
||||
{include file='include/autosize.inc.tpl'}
|
||||
*}
|
||||
|
||||
<div id="content" class="content">
|
||||
|
||||
<div class="titrePage">
|
||||
<ul class="categoryActions">
|
||||
<li><a href="{$U_HOME}" title="{'Home'|@translate}" class="pwg-state-default pwg-button">
|
||||
<span class="pwg-icon pwg-icon-home"> </span><span class="pwg-button-text">{'Home'|@translate}</span>
|
||||
</a></li>
|
||||
</ul>
|
||||
<h2>{'Upload a picture'|@translate}</h2>
|
||||
</div>
|
||||
|
||||
{if !empty($errors)}
|
||||
<div class="errors">
|
||||
<ul>
|
||||
{foreach from=$errors item=error}
|
||||
<li>{$error}</li>
|
||||
{/foreach}
|
||||
</ul>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
{if not $UPLOAD_SUCCESSFUL }
|
||||
<form enctype="multipart/form-data" method="post" action="{$F_ACTION}">
|
||||
<table style="width:80%;margin-left:auto;margin-right:auto;">
|
||||
<tr>
|
||||
<td colspan="2" class="menu">
|
||||
<div style="text-align:center;">{$ADVISE_TITLE}</div>
|
||||
{if not empty($advises)}
|
||||
<ul>
|
||||
{foreach from=$advises item=advise}
|
||||
<li>{$advise}</li>
|
||||
{/foreach}
|
||||
</ul>
|
||||
{/if}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2" align="center">
|
||||
<input class="file" name="picture" type="file" value="">
|
||||
</td>
|
||||
</tr>
|
||||
{if isset($SHOW_FORM_FIELDS) and $SHOW_FORM_FIELDS}
|
||||
<!-- category -->
|
||||
<tr>
|
||||
<td>{'Category'|@translate}</td>
|
||||
<td>
|
||||
{html_options name="category" options=$categories selected=$categories_selected}
|
||||
</td>
|
||||
</tr>
|
||||
<!-- username -->
|
||||
<tr>
|
||||
<td>{'Username'|@translate} <span style="color:red;">*</span></td>
|
||||
<td>
|
||||
<input name="username" type="text" value="{$NAME}">
|
||||
</td>
|
||||
</tr>
|
||||
<!-- mail address -->
|
||||
<tr>
|
||||
<td>{'E-mail address'|@translate} <span style="color:red;">*</span></td>
|
||||
<td>
|
||||
<input name="mail_address" type="text" value="{$EMAIL}">
|
||||
</td>
|
||||
</tr>
|
||||
<!-- name of the picture -->
|
||||
<tr>
|
||||
<td>{'Name of the picture'|@translate}</td>
|
||||
<td>
|
||||
<input name="name" type="text" value="{$NAME_IMG}">
|
||||
</td>
|
||||
</tr>
|
||||
<!-- author -->
|
||||
<tr>
|
||||
<td>{'Author'|@translate}</td>
|
||||
<td>
|
||||
<input name="author" type="text" value="{$AUTHOR_IMG}">
|
||||
</td>
|
||||
</tr>
|
||||
<!-- date of creation -->
|
||||
<tr>
|
||||
<td>{'Creation date'|@translate} (DD/MM/YYYY)</td>
|
||||
<td>
|
||||
<input name="date_creation" type="text" value="{$DATE_IMG}">
|
||||
</td>
|
||||
</tr>
|
||||
<!-- comment -->
|
||||
<tr>
|
||||
<td>{'Comment'|@translate}</td>
|
||||
<td>
|
||||
<textarea name="comment" id="comment" rows="3" cols="40" style="overflow:auto">{$COMMENT_IMG}</textarea>
|
||||
</td>
|
||||
</tr>
|
||||
{/if}
|
||||
<tr>
|
||||
<td colspan="2" align="center">
|
||||
<input class="submit" name="submit" type="submit" value="{'Submit'|@translate}">
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
{else}
|
||||
{'Picture uploaded with success, an administrator will validate it as soon as possible'|@translate}<br>
|
||||
<div style="text-align:center;">
|
||||
<a href="{$U_RETURN}">[ {'Home'|@translate} ]</a>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
{if isset($SHOW_FORM_FIELDS) and $SHOW_FORM_FIELDS}
|
||||
<div style="text-align:left; margin-left:20px;"><span style="color:red;">*</span> : {'obligatory'|@translate}</div>
|
||||
{/if}
|
||||
</div> <!-- content -->
|
Loading…
Add table
Add a link
Reference in a new issue