remove the "from web browser" tab

asterone

Joined: 2011-04-05
Posts: 4
Posted: Thu, 2011-04-14 14:40

Hi, Im using gallery2 with an 'embed video' module see link below.
http://codex.gallery2.org/Gallery2:Modules:embedvideo

I would really like users only to be able to use this action and not have the option of uploading any other way ie to remove the other tab (see image)
Is this possible? I really hope so.
Im assuming it involves the removal of some lines of code from one of the files. Im asking here to save time searching the files myself so excuse my laziness :)

thanks.

[img]http://www.testzone.net.au/sa/gallery2/main.php?g2_view=core.DownloadItem&g2_itemId=19&g2_serialNumber=1[/img]


Gallery URL = http://www.testzone.net.au/sa/gallery2/main.php
Gallery version = 2.3.1 core 1.3.0.1
API = Core 7.54, Module 3.9, Theme 2.6, Embed 1.5
PHP version = 5.2.10 cgi
Webserver = Apache/2.2.13 (Unix) mod_ssl/2.2.13 OpenSSL/0.9.8e-fips-rhel5 mod_bwlimited/1.4 mod_perl/2.0.4 Perl/v5.8.8
Database = mysqli 5.0.92-community, lock.system=flock
Toolkits = ArchiveUpload, Exif, Gd
Acceleration = none, none
Operating system = Linux au001lcs00.syd.the-server.com.au 2.6.18-194.11.4.el5 #1 SMP Tue Sep 21 05:04:09 EDT 2010 x86_64
Default theme = matrix
gettext = enabled
Locale = en_GB
Browser = Mozilla/5.0 (Windows NT 6.1; WOW64; rv:2.0) Gecko/20100101 Firefox/4.0
Rows in GalleryAccessMap table = 12
Rows in GalleryAccessSubscriberMap table = 2
Rows in GalleryUser table = 2
Rows in GalleryItem table = 2
Rows in GalleryAlbumItem table = 1
Rows in GalleryCacheMap table = 0

 
Dayo

Joined: 2005-11-04
Posts: 1642
Posted: Sat, 2011-04-16 10:01

I believe this a default upload method that is always available and cannot be normally disabled. You can edit the core module to hide the tab though.

Go to /modules/core/templates/ItemAdd.tpl. Near the bottom of the file, you will find this block of code...

<div class="gbTabBar">
  {foreach from=$ItemAdd.plugins item=plugin}
    {if $plugin.isSelected}
      <span class="giSelected o"><span>
	{$plugin.title}
      </span></span>
    {else}
      <span class="o"><span>
	<a href="{g->url arg1="view=core.ItemAdmin" arg2="subView=core.ItemAdd"
	 arg3="itemId=`$ItemAdmin.item.id`" arg4="addPlugin=`$plugin.id`"}">{$plugin.title}</a>
      </span></span>
    {/if}
  {/foreach}
</div>

Edit to ...

<div class="gbTabBar">
  {foreach from=$ItemAdd.plugins item=plugin}
   {if $plugin.title != "From Web Browser"}
    {if $plugin.isSelected}
      <span class="giSelected o"><span>
	{$plugin.title}
      </span></span>
    {else}
      <span class="o"><span>
	<a href="{g->url arg1="view=core.ItemAdmin" arg2="subView=core.ItemAdd"
	 arg3="itemId=`$ItemAdmin.item.id`" arg4="addPlugin=`$plugin.id`"}">{$plugin.title}</a>
      </span></span>
    {/if}
   {/if}
  {/foreach}
</div>

This will hide the tab.

--
dakanji.com

 
asterone

Joined: 2011-04-05
Posts: 4
Posted: Sun, 2011-04-17 00:13

Great thanks that worked very nicely. Very thankful for your help. :)