Solved

How can I remove the details button from this page in docman?

Posted on 2010-08-28
10
1,803 Views
Last Modified: 2012-05-10
Hi,
I have been trying to mess around with the code for this page here
http://www.testing.qsma.org.au/index.php?option=com_docman&task=cat_view&gid=42&Itemid=60

As I don't want the details button to be shown on each document.

I am using docman in joomla.

Can someone please tell me what I need to do to remove it.  I couldn't find anything in the configuration, so not sure where to find it in the docman code?
0
Comment
Question by:Amanda Watson
  • 5
  • 5
10 Comments
 
LVL 7

Expert Comment

by:mcuk_storm
ID: 33550801
I only have access to docman 1.4 but in there it is in the plugins/standardbuttons.php file, if you comment out the $buttons['details'] = new ... line that should remove it for you.
0
 
LVL 11

Author Comment

by:Amanda Watson
ID: 33551735
I couldn't find that file, but I found that variable in the document.html.php file but I am not sure if is what I need to edit out?

<?php

/**

 * @version		$Id: documents.html.php 1372 2010-06-11 14:22:50Z mathias $

 * @category	DOCman

 * @package		DOCman15

 * @copyright	Copyright (C) 2003 - 2009 Johan Janssens and Mathias Verraes. All rights reserved.

 * @license		GNU GPLv2 <http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>

 * @link     	http://www.joomladocman.org

 */

defined('_JEXEC') or die('Restricted access');



require_once($_DOCMAN->getPath('classes', 'html'));



class HTML_DMDocuments

{

    function displayDocument(&$buttons, &$paths, &$data)

    {

        // modify links data

        unset($buttons['details']);

        $tpl = new DOCMAN_Theme();



        // Assign values to the Savant instance.

        $tpl->assignRef('buttons', $buttons);

        $tpl->assignRef('paths', $paths);

        $tpl->assignRef('data', $data);



        // Display a template using the assigned values.

        return $tpl->fetch('documents/document.tpl.php');

    }



    function displayDocumentList(&$order, &$items)

    {

        $tpl = new DOCMAN_Theme();



        // Assign values to the Savant instance.

        $tpl->assignRef('order', $order);

        $tpl->assignRef('items', $items);



        // Display a template using the assigned values.

        return $tpl->fetch('documents/list.tpl.php');

    }



    function editDocumentForm(&$row, &$lists, $last, $created, &$params)

    {

        global $Itemid;

        global $_DOCMAN, $_DMUSER;



        require_once(JPATH_SITE . DS.'includes'.DS.'HTML_toolbar.php');



        JFilterOutput::objectHTMLSafe($row);



        ob_start();

        ?>

        <form action="<?php echo JRoute::_('index.php?option=com_docman')?>" method="post" name="adminForm" onsubmit="javascript:setgood();" id="dm_frmedit" class="dm_form">



		<fieldset class="dm_adminform">

    	<legend><?php echo _DML_DESCRIPTION ?></legend>

        <table class="dm_admintable">

		<tr>

			<td class="dm_key">

				<label><?php echo _DML_TITLE; ?></label>

			</td>

			<td>

				<input class="inputbox" type="text" name="dmname" size="50" maxlength="100" value="<?php echo $row->dmname;?>" />

			</td>

		</tr>

		<tr>

			<td class="dm_key">

				<label for="catid"><?php echo _DML_CATEGORY;?></label>

			</td>

			<td>

				<?php echo $lists['catid'];?>

			</td>

		</tr>

		<?php if (!$row->approved && $_DMUSER->canApprove()) : ?>

		<tr>

			<td class="dm_key">

				<label><?php echo _DML_APPROVED;?></label>

			</td>

			<td>

				<?php echo $lists['approved']; ?>

			</td>

		</tr>

		<?php endif; ?>

		<?php if ($row->approved && $_DMUSER->canPublish()) : ?>

		<tr>

			<td class="dm_key">

				<label><?php echo _DML_PUBLISHED;?></label>

			</td>

			<td>

				<?php echo $lists['published']; ?>

			</td>

		</tr>

		<?php endif; ?>

		<tr>

		<td class="dm_key">

				<label><?php echo _DML_DESCRIPTION; ?></label>

			</td>

			<td>

				<?php

				// parameters : areaname, content, hidden field, width, height, rows, cols

				DOCMAN_Compat::editorArea('editor1', $row->dmdescription, 'dmdescription', '100%', '250', '50', '10');

				?>

			</td>

		</tr>

		</table>

		</fieldset>



        <?php

        jimport('joomla.html.pane');

        $tabs = JPane::getInstance('tabs', array('useCookies' => false));



        echo $tabs->startPane("content-pane");

        echo $tabs->startPanel(_DML_DOCUMENT, "document-page");



        HTML_DMDocuments::_showTabDocument($row, $lists, $last, $created);



        echo $tabs->endPanel();

        echo $tabs->startPanel(_DML_TAB_PERMISSIONS, "permissions-page");



        HTML_DMDocuments::_showTabPermissions($row, $lists, $last, $created);



        echo $tabs->endPanel();

        echo $tabs->startPanel(_DML_TAB_LICENSE, "license-page");



        HTML_DMDocuments::_showTabLicense($row, $lists, $last, $created);



       	if(isset($params)) :

        echo $tabs->endPanel();

        echo $tabs->startPanel(_DML_TAB_DETAILS, "details-page");



        HTML_DMDocuments::_showTabDetails($row, $lists, $last, $created, $params);

        endif;



        echo $tabs->endPanel();

        echo $tabs->endPane();

        ?>



        <input type="hidden" name="goodexit" value="0" />

		<input type="hidden" name="id" value="<?php echo $row->id;?>" />

		<input type="hidden" name="option" value="com_docman" />

		<input type="hidden" name="task" value="doc_save" />

		<input type="hidden" name="Itemid" value="<?php echo $Itemid;?>" />

        <input type="hidden" name="dmcounter" value="<?php echo $row->dmcounter;?>" />

        <?php echo DOCMAN_token::render();?>

		</form>

        <?php

        $html = ob_get_contents();

        ob_end_clean();



        return $html;

    }



    function _showTabDocument(&$row, &$lists, $last, $created)

    {

    	global $_DOCMAN, $_DMUSER;

        DOCMAN_Compat::calendarJS();



    	?>

		<fieldset class="dm_adminform">

        <table class="dm_admintable">

		<tr>

			<td class="dm_key">

				<label for="dmthumbnail"><?php echo _DML_THUMBNAIL;?></label>

			</td>

			<td>

				<?php echo $lists['dmthumbnail'];?>

				<?php $previewfull = $lists['dmthumbnail_preview'] ? "images/stories/".$lists['dmthumbnail_preview'] : "images/M_images/blank.png";?>

				<img src="<?php echo $previewfull ?> " id="dmthumbnail_preview" alt="Preview" />

			</td>

		</tr>

		<tr>

			<td class="dm_key">

				<label for="dmdate_published"><?php echo _DML_DATE;?></label>

			</td>

			<td>

				<?php DOCMAN_Compat::calendar('dmdate_published', $row->dmdate_published);?>

			</td>

		</tr>

		<tr>

			<td class="dm_key">

				<label for="dmfilename"><?php echo _DML_FILE;?></label>

			</td>

			<td>

				<?php echo $lists['dmfilename'];?>

			</td>

		</tr>



		<?php if (isset($row->dmlink)) : ?>

		<tr>

			<td class="dm_key">

				<label for="dmfilename" class="hasTip" title="<?php echo _DML_DOCURL.'::'._DML_DOCURL_TOOLTIP; ?>"><?php echo _DML_DOCURL;?></label>

			</td>

			<td>

				<input class="inputbox" type="text" name="document_url" size="50" maxlength="200" value="<?php echo $row->dmlink ?>" />

			</td>

		</tr>

		<?php endif; ?>

		<tr>

			<td class="dm_key">

				<label for="dmurl" class="hasTip" title="<?php echo _DML_HOMEPAGE.'::'._DML_HOMEPAGE_TOOLTIP; ?>"><?php echo _DML_HOMEPAGE;?></label>

			</td>

			<td>

				<input class="inputbox" type="text" name="dmurl" size="50" maxlength="200" value="<?php echo $row->dmurl ?>" />

				<div><i>(<?php echo _DML_MAKE_SURE;?>)</i></div>

			</td>

		</tr>

		</table>

		</fieldset>

        <?php

    }



    function _showTabPermissions(&$row, &$lists, $last, $created)

    {

    	global $_DOCMAN, $_DMUSER;



    	?>

    	<fieldset class="dm_adminform">

	    	<table class="dm_admintable">

	    	<tr>

				<td class="dm_key">

					<label for="dmowner" class="hasTip" title="<?php echo _DML_OWNER.'::'._DML_OWNER_TOOLTIP; ?>"><?php echo _DML_OWNER;?></label>

				</td>

				<td>

					<?php echo $lists['viewer'];?>

				</td>

			</tr>

			<tr>

				<td class="dm_key">

					<label for="dmmaintainedby" class="hasTip" title="<?php echo _DML_MAINTAINER.'::'._DML_MANT_TOOLTIP; ?>"><?php echo _DML_MAINTAINER;?></label>

				</td>

				<td>

					<?php echo $lists['maintainer']; ?>

				</td>

			</tr>

			<tr>

				<td class="dm_key">

					<label for="dmcreatedby"><?php echo _DML_CREATED_BY;?></label>

				</td>

				<td>

					[<?php echo $created[0]->name;?>]&nbsp;

					<i>

					<?php echo _DML_ON . "&nbsp;"; ?>

					<?php

		        	if ($row->dmdate_published) {

		           	 	echo JHTML::_('date', $row->dmdate_published);

		        	} else {

		            	$date = date("Y-m-d H:i:s", time("Y-m-d g:i:s"));

		            	echo  JHTML::_('date', $row->dmdate_published, JText::_('DATE_FORMAT_LC1'));

		        	}

		        	?>

	   				</i>

				</td>

			</tr>

			<tr>

				<td class="dm_key">

					<label for="dmupdatedby"><?php echo _DML_UPDATED_BY;?></label>

				</td>

				<td>

					[<?php echo $created[0]->name;?>]&nbsp;

					<?php

		        	if ($row->dmlastupdateon) {

		            	echo "<i>" . _DML_ON . "&nbsp;" . JHTML::_('date', $row->dmlastupdateon, JText::_('DATE_FORMAT_LC1')) ."</i>" ;

		        	} ?>

				</td>

			</tr>

			</table>

  		</fieldset>

  		<?php

    }



    function _showTabLicense(&$row, &$lists, $last, $created)

    {

    	global $_DOCMAN, $_DMUSER;



    	?>

    	<fieldset class="dm_adminform">

    	<table class="dm_admintable">

    	<tr>

			<td class="dm_key">

				<label for="dmlicense_id" class="hasTip" title="<?php echo _DML_LICENSE_TYPE.'::'._DML_LICENSE_TOOLTIP; ?>"><?php echo _DML_LICENSE_TYPE;?></label>

			</td>

			<td>

				<?php echo $lists['licenses']; ?>

			</td>

		</tr>

    	<tr>

			<td class="dm_key">

				<label for="dmlicense_display" class="hasTip" title="<?php echo _DML_DISPLAY_LIC.'::'._DML_DISPLAY_LIC_TOOLTIP; ?>"><?php echo _DML_DISPLAY_LICENSE;?></label>

			</td>

			<td>

				<?php echo $lists['licenses_display']; ?>

			</td>

		</tr>

		</table>

        </fieldset>

        <?php

    }



    function _showTabDetails(&$row, &$lists, $last, $created, &$params)

    {

    	global $_DOCMAN, $_DMUSER;



    	?>

    	<fieldset class="dm_adminform">

		<?php echo $params->render('params');?>

    	</fieldset>

    	<?php

    }



    function moveDocumentForm($lists, $links, $paths, $data)

    {

        $action = _taskLink('doc_move_process', $data->id);



		ob_start();

        ?>

		<form action="<?php echo DOCMAN_Compat::sefRelToAbs($action) ?>" method="post" id="dm_frmmove" class="dm_form" >

		<fieldset class="dm_adminform">

		<table class="dm_admintable">

		<tr>

			<td class="dm_key">

				<label for="name"><?php echo _DML_DOC;?></label>

			</td>

			<td>

				<span id="name"><?php echo $data->dmname;?> (<?php echo $data->filename;?>)</span>

			</td>

		</tr>

		<tr>

			<td class="dm_key">

				<label for="catid"><?php echo _DML_MOVETO;?></label>

			</td>

			<td>

				<?php echo $lists['categories'];?>

			</td>

		</tr>

		</table>

		</fieldset>

		<fieldset class="dm_button">

 			<p>

 				<input name="submit" class="button" value="<?php echo _DML_MOVETHEFILES;?>" type="submit" />

 			</p>

 		</fieldset>

        <?php echo DOCMAN_token::render();?>

 		</form>

 		<?php



 		$html = ob_get_contents();

        ob_end_clean();



        return $html;

    }

}

Open in new window

0
 
LVL 11

Author Comment

by:Amanda Watson
ID: 33551740
I am using Docman 1.5.8
0
Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

 
LVL 7

Expert Comment

by:mcuk_storm
ID: 33552207
you could try in: administrator/components/com_docman/ext/plugins/docman/standardbuttons.php about line 48
0
 
LVL 7

Expert Comment

by:mcuk_storm
ID: 33552222
Sorry that was obviously the adminside button on the client side:
If you add the following line:
unset($this->doc->buttons['details']);
to the displayDocumentList function as it is in the displayDocument function that should do the trick
0
 
LVL 7

Expert Comment

by:mcuk_storm
ID: 33552229
Sorry for the bombardment of comments, just looked through the code again and it doesn't seem to pass the buttons their though it is using them in the template file, it appears to be using them in tasks.tpl.php in components/com_docman/themes/default/templates/documents/tasks.tpl.php if you try adding the unset line before the foreach loop c. line 28 that should unset it before it gets a chance to put it in the page.
0
 
LVL 11

Author Comment

by:Amanda Watson
ID: 33554350
Here is the task.tpl.php file...
What did you think I could try?
<?php

/**

 * @version		$Id: tasks.tpl.php 979 2009-11-26 18:08:33Z tom $

 * @category	DOCman

 * @package		DOCman15

 * @copyright	Copyright (C) 2003 - 2009 Johan Janssens and Mathias Verraes. All rights reserved.

 * @license	    This file can not be redistributed without the written consent of the 

 				original copyright holder. This file is not licensed under the GPL. 

 * @link     	http://www.joomladocman.org

 */

defined('_JEXEC') or die('Restricted access');



/*

* Display the document tasks (called by document/list_item.tpl.php and documents/document.tpl.php)

*

* General variables  :

*	$this->theme->path (string) : template path

* 	$this->theme->name (string) : template name

* 	$this->theme->conf (object) : template configuartion parameters

*	$this->theme->icon (string) : template icon path

*   $this->theme->png  (boolean): browser png transparency support

*

* Template variables :

*	$this-	>doc->buttons (array) : holds the tasks a user can preform on a

*document

*/



foreach($this->doc->buttons as $button) {

	if($button->params->get('popup', false))
	{
		JHTML::_('behavior.modal');
		$popup = 'class="modal" rel="{handler: \'iframe\', size: {x: 800, y: 500}}"';
	} else {
		$popup = '';
	}
	
	$attr = '';

    if($class = $button->params->get('class', '')) {

    	$attr = 'class="' . $class . '"';

    }

	?><li <?php echo $attr?>>

        <a href="<?php echo $button->link?>" <?php echo $popup?>>

            <?php echo $button->text ?>

        </a>

    </li><?php

}

Open in new window

0
 
LVL 11

Author Comment

by:Amanda Watson
ID: 33554378
I also found the standardbuttons.php file...and found $buttons['details']   within in it, but no matter what I edited the button showed still

Any idea?
<?php
/**
 * @version		$Id: standardbuttons.php 1122 2010-01-14 20:55:22Z mathias $
 * @category	DOCman
 * @package		DOCman15
 * @copyright	Copyright (C) 2003 - 2009 Johan Janssens and Mathias Verraes. All rights reserved.
 * @license		GNU GPLv2 <http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>
 * @link     	http://www.joomladocman.org
 */
defined('_JEXEC') or die('Restricted access');

JApplication::registerEvent( 'onFetchButtons', 'bot_standardbuttons' );

function bot_standardbuttons($params) 
{
    global $_DOCMAN, $_DMUSER;

    require_once($_DOCMAN->getPath('classes', 'button'));
    require_once($_DOCMAN->getPath('classes', 'token'));

    $_DOCMAN->loadLanguage('frontend');

    $doc        = & $params['doc'];
    $file       = & $params['file'];
    $objDBDoc   = $doc->objDBTable;

    $botParams  = bot_standardbuttonsParams();
    $js = "javascript:if(confirm('"._DML_ARE_YOU_SURE."')) {window.location='%s'}";

    // format document links, ONLY those the user can perform.
    $buttons = array();

    if ($_DMUSER->canDownload($objDBDoc) AND $botParams->get('download', 1)) {
        $buttons['download'] = new DOCMAN_Button('download', _DML_BUTTON_DOWNLOAD, $doc->_formatLink('doc_download'));
    }

    if ($_DMUSER->canDownload($objDBDoc) AND $botParams->get('view', 1)) {
        $viewtypes = trim($_DOCMAN->getCfg('viewtypes'));
        if ($viewtypes != '' && ($viewtypes == '*' || stristr($viewtypes, $file->ext))) {
            $link = $doc->_formatLink('doc_view', null, true, 'index.php');
            $params = new DMmosParameters('popup=1');
            $buttons['view'] = new DOCMAN_Button('view', _DML_BUTTON_VIEW, $link, $params);
        }
    }

    if($botParams->get('details', 1)) {
    	$params = new DMmosParameters('popup=1');
        $buttons['details'] = new DOCMAN_Button('details', _DML_BUTTON_DETAILS, $doc->_formatLink('doc_details', array('tmpl'=>'component')), $params);
    }


    if ($_DMUSER->canEdit($objDBDoc) AND $botParams->get('edit', 1)) {
        $buttons['edit'] = new DOCMAN_Button('edit', _DML_BUTTON_EDIT, $doc->_formatLink('doc_edit'));
    }

    if ($_DMUSER->canMove($objDBDoc) AND $botParams->get('move', 1)) {
        $buttons['move'] = new DOCMAN_Button('move', _DML_BUTTON_MOVE, $doc->_formatLink('doc_move'));
    }

    if ($_DMUSER->canDelete($objDBDoc) AND $botParams->get('delete', 1)) {
        $link = $doc->_formatLink('doc_delete', null, null, 'index.php', true);
        $buttons['delete'] = new DOCMAN_Button('delete', _DML_BUTTON_DELETE, sprintf($js, $link));
    }

    if ($_DMUSER->canUpdate($objDBDoc) AND $botParams->get('update', 1)) {
        $buttons['update'] = new DOCMAN_Button('update', _DML_BUTTON_UPDATE, $doc->_formatLink('doc_update'));
    }

    if ($_DMUSER->canReset($objDBDoc) AND $botParams->get('reset', 1)) {
        $buttons['reset'] = new DOCMAN_Button('reset', _DML_BUTTON_RESET, sprintf($js, $doc->_formatLink('doc_reset')));
    }

    if ($_DMUSER->canCheckin($objDBDoc) AND $objDBDoc->checked_out AND $botParams->get('checkout', 1)) {
        $params = new DMmosParameters('class=checkin');
        $buttons['checkin'] = new DOCMAN_Button('checkin', _DML_BUTTON_CHECKIN, $doc->_formatLink('doc_checkin'), $params);
    }

    if ($_DMUSER->canCheckout($objDBDoc) AND !$objDBDoc->checked_out AND $botParams->get('checkout', 1)) {
        $buttons['checkout'] = new DOCMAN_Button('checkout', _DML_BUTTON_CHECKOUT, $doc->_formatLink('doc_checkout'));
    }

    if ($_DMUSER->canApprove($objDBDoc) AND !$objDBDoc->approved AND $botParams->get('approve', 1)) {
        $params = new DMmosParameters('class=approve');
        $link   = $doc->_formatLink('doc_approve', null, null, 'index.php', true);
        $buttons['approve'] = new DOCMAN_Button('approve', _DML_BUTTON_APPROVE, $link, $params);
    }

    if ($_DMUSER->canPublish($objDBDoc) AND $botParams->get('publish', 1)) {
        $params = new DMmosParameters('class=publish');
        $link   = $doc->_formatLink('doc_publish', null, null, 'index.php', true);
        $buttons['publish'] = new DOCMAN_Button('publish', _DML_BUTTON_PUBLISH, $link, $params);
    }

    if ($_DMUSER->canUnPublish($objDBDoc) AND $botParams->get('publish', 1)) {
        $link   = $doc->_formatLink('doc_unpublish', null, null, 'index.php', true);
        $buttons['unpublish'] = new DOCMAN_Button('unpublish', _DML_BUTTON_UNPUBLISH, $link);
    }

    return $buttons;

}

function bot_standardbuttonsParams() 
{
    static $params;
    $database = JFactory::getDBO();

    $dbtable = '#__plugins';
   
	// check if param query has previously been processed
    if ( !isset($params) ) 
    {
        // load plugin params info
        $query = "SELECT params"
        . "\n FROM $dbtable"
        . "\n WHERE element = 'standardbuttons'"
        . "\n AND folder = 'docman'"
        ;
        $database->setQuery( $query );
        $result = $database->loadResult();

        // save query to class variable
        $params = $result;
    }

    // pull query data from class variable
    $botParams = new JParameter(  $params );
    return $botParams;
}

Open in new window

0
 
LVL 7

Accepted Solution

by:
mcuk_storm earned 500 total points
ID: 33554554

Try Adding this on line 54 of the task.tpl.php
unset($this->doc->buttons['details']);

it goes in just above:
foreach($this->doc->buttons as $button) {

Effectively this should hopefully remove the button definition just before it tries to output it.
0
 
LVL 11

Author Comment

by:Amanda Watson
ID: 33554601
That did it beautifully thank you...before I lose you expert, can you help me remove the view button too?

Have a look at this thread here...

http://www.experts-exchange.com/Web_Development/Web_Languages-Standards/PHP/Q_26437569.html

thanks
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
how to use Initialization Vector for openssl_encrypt() 5 58
Dynamic Dropdowns 15 32
Undefined variable problem 5 22
Checking https returns 301 21 19
These days socially coordinated efforts have turned into a critical requirement for enterprises.
This article discusses how to create an extensible mechanism for linked drop downs.
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question