Adding a Delete Items option to the gbAdminLinks

iamcanadian2222
iamcanadian2222's picture

Joined: 2007-01-17
Posts: 24
Posted: Fri, 2007-12-07 01:24

How would I go about adding a Delete Items link to the ItemAdmin area (Edit) of an Album.

It looks like the list is generated based off:

	  {foreach from=$ItemAdmin.subViewChoices key=choiceName item=choiceParams}
	    <li class="{g->linkId urlParams=$choiceParams}">
	    {if isset($choiceParams.active)}
	      {$choiceName}
	    {else}
	      <a href="{g->url params=$choiceParams}"> {$choiceName} </a>
	    {/if}
	    </li>

But after searching for hours I can't figure it out. I'm tempted to manually just add another list item below (which would just be way too easy, right?) But I really want to do this the right way. It looks like items are added to the list via the modules .inc file in the $itemLink(s?) array. I saw a post that 2.3 has this functionality, so I'm just curious how I can add it to 2.2.3. Hell, if you start creating the list item manually and set the class to follow the pattern of the other list items, the little icon (from FamFamFam Silk Icon set) is automatically applied.

Gallery version = 2.2.3 core 1.2.0.5
PHP version = 5.2.3 apache2handler
Webserver = Apache/2.2.4 (Win32) DAV/2 mod_ssl/2.2.4 OpenSSL/0.9.8e mod_autoindex_color PHP/5.2.3 mod_jk/1.2.23
Database = mysqli 5.0.45-community-nt, lock.system=database
Toolkits = Exif, ImageMagick, SquareThumb, Thumbnail, Gd
Acceleration = none, none
Operating system = Windows NT KP-37KX3 5.1 build 2600
Default theme = siriux
gettext = enabled
Locale = en_GB
Browser = Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.11) Gecko/20071127 Firefox/2.0.0.11
Rows in GalleryAccessMap table = 68
Rows in GalleryAccessSubscriberMap table = 44
Rows in GalleryUser table = 15
Rows in GalleryItem table = 42
Rows in GalleryAlbumItem table = 22
Rows in GalleryCacheMap table = 0

 
iamcanadian2222
iamcanadian2222's picture

Joined: 2007-01-17
Posts: 24
Posted: Fri, 2007-12-07 18:25

For anyone interested in how to add a Delete Items link to the Item Admin area manually (eg. in the template file /gallery2/modules/core/templates/ItemAdmin.tpl) change:

	<ul>
	  {foreach from=$ItemAdmin.subViewChoices key=choiceName item=choiceParams}
	    <li class="{g->linkId urlParams=$choiceParams}">
	    {if isset($choiceParams.active)}
	      {$choiceName}
	    {else}
	      <a href="{g->url params=$choiceParams}"> {$choiceName} </a>
	    {/if}
	    </li>
	  {/foreach}
	</ul>

To:

	<ul>
	  {foreach from=$ItemAdmin.subViewChoices key=choiceName item=choiceParams}
	    <li class="{g->linkId urlParams=$choiceParams}">
	    {if isset($choiceParams.active)}
	      {$choiceName}
	    {else}
	      <a href="{g->url params=$choiceParams}"> {$choiceName} </a>
	    {/if}
	    </li>
	  {/foreach}
	  {if $controller == 'core.ItemDelete'}
		<li class="gbAdminLink gbLink-core_ItemAdmin-core_ItemDelete">
			Delete Items
		</li>
	  {else}
		<li class="gbAdminLink gbLink-core_ItemAdmin-core_ItemDelete">
			<a href="{g->url arg1="view=core.ItemAdmin" arg2="subView=core.ItemDelete" arg3="itemId=`$ItemAdmin.item.id`"}">Delete Items</a>
		</li>
	  {/if}
	</ul>
 
iamcanadian2222
iamcanadian2222's picture

Joined: 2007-01-17
Posts: 24
Posted: Tue, 2007-12-11 20:31

Any input on how to add this to the right place? As I mentioned before, I think it would need to be declared in the modules.inc file. (perhaps in the /modules/core/ one)