Login

Who's Online

We have 1 guest online

Google








Home arrow Programmingarrow Joomla Extensionsarrow Customizing the "Order" Drop Down
Discussion Forum
December 04, 2008, 05:38:34 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: SMF - Just Installed!
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Customizing the "Order" Drop Down  (Read 1652 times)
firetext
Newbie
*
Posts: 10


View Profile Email
« on: June 21, 2007, 12:53:46 AM »

Is it possible to customize the "Order" drop down list to include whichever Input Field you would like? maybe by a check box? also is it possible to add your own Input Fields? When you enter in a Reference Manually? This would be a wonderful addition as well.

You are Brilliant! Keep up the wonderful work
Raoul


Logged
Mark Austin
Administrator
Jr. Member
*****
Posts: 97



View Profile Email
« Reply #1 on: June 21, 2007, 07:34:46 AM »

These features might be a lot of work, I will have a think, but they would probably require a major rewrite of the component.

Mark
Logged
Mark Austin
Administrator
Jr. Member
*****
Posts: 97



View Profile Email
« Reply #2 on: June 21, 2007, 01:48:13 PM »

Thinking about it, if you wanted to customise the order drop down list you would only need to make a few changes to the php files in the component, I would be happy to talk you through this, or even make the changes for you if you tell me which fields you wanted to order by.  Adding new fields dynamically however would require a complete rewrite of the component.

The part of the php file that needs changing is:

jombib.php line 499:

   $order[] = mosHTML::makeOption( 'ryear', _ORDER_DROPDOWN_DD );
   $order[] = mosHTML::makeOption( 'year', _ORDER_DROPDOWN_DA );
   $order[] = mosHTML::makeOption( 'title', _ORDER_DROPDOWN_TA );
   $order[] = mosHTML::makeOption( 'rtitle', _ORDER_DROPDOWN_TD );
   $order[] = mosHTML::makeOption( 'author', 'Author asc' );
   $order[] = mosHTML::makeOption( 'rauthor', 'Author desc' );
   $order[] = mosHTML::makeOption( 'journal', 'Journal asc' );
   $order[] = mosHTML::makeOption( 'rjournal', 'Journal desc' );
   $order[] = mosHTML::makeOption( 'type', 'Type' );

and jombib.php line 584:

function _orderby_sec( $orderby ) {
   switch ( $orderby ) {
      case 'year':
         $orderby = 'year';
         break;

      case 'ryear':
         $orderby = 'year DESC';
         break;

      case 'title':
         $orderby = 'title';
         break;

      case 'rtitle':
         $orderby = 'title DESC';
         break;

      case 'journal':
         $orderby = 'journal';
         break;

      case 'rjournal':
         $orderby = 'journal DESC';
         break;

      case 'author':
         $orderby = '#__bib_auth.last';
         break;

      case 'rauthor':
         $orderby = '#__bib_auth.last DESC';
         break;

      case 'type':
         $orderby = 'type';
         break;


      default:
         $orderby = 'year DESC';
         break;
   }

   return $orderby;
}

For example to add the 'school' field to the list you would need to add the lines:

$order[] = mosHTML::makeOption( 'school', 'School asc' );
$order[] = mosHTML::makeOption( 'rschool', 'School desc' );

to the area starting at line 499, and:

case 'school':
         $orderby = 'school;
         break;

case 'rschool':
         $orderby = 'school DESC';
         break;

to the switch case statement on line 585.

Hope that helps

Logged
firetext
Newbie
*
Posts: 10


View Profile Email
« Reply #3 on: June 22, 2007, 04:44:07 PM »

That's Amazing! I'm adding these fields right away! Hot Hot hot!

What my client is requesting is to be able to enter the following fields for information

Title
Subtitle
Author
-Corporate Author
Publisher
Place of Publication
Date
Subject 1
Subject 2
Subject 3 (Possible up to 6 Categories)

With the ability to do a Boolean Search.

What I was thinking about doing was renaming the fields you have set in your "Manual Input" Section, which would give it the same effect, so when a client Filter's the search results it would narrow it down to the article they are looking for.

I'm pretty sure I'm on the right track or would that effect the stability of your component?

Raoul
Logged
Mark Austin
Administrator
Jr. Member
*****
Posts: 97



View Profile Email
« Reply #4 on: June 23, 2007, 09:11:52 AM »

You can give it a crack.  Make sure that you rename the fields in the xml file as well as all the php files
« Last Edit: June 23, 2007, 09:15:04 AM by Mark Austin » Logged
firetext
Newbie
*
Posts: 10


View Profile Email
« Reply #5 on: July 03, 2007, 04:23:55 AM »

Hi Mark

I'm trying to attempt to create the following forms in your bibtex component

Title
Creator
Subject / Keyword
Description
Publisher
Contributor
Date
Resource Type
Format
Resource Identifier
Source
Language
Relation
Coverage
Rights Management
Link
Pdf Link

I just don't know where to start...

Thanks Mark! Looking forward to your advice!
Raoul
Logged
firetext
Newbie
*
Posts: 10


View Profile Email
« Reply #6 on: July 03, 2007, 04:46:47 AM »

Also!

Sorry Mark, forgot to Add under Authors, I need the Author's to have Contact Phone Number as well.

Do you think modifying the fields would cause instability? Can a person still import bibtex files, but ofcourse the labels would be different.

Thanks again
Raoul
Logged
Mark Austin
Administrator
Jr. Member
*****
Posts: 97



View Profile Email
« Reply #7 on: July 16, 2007, 04:08:29 PM »

yes, that should be fine
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by SMF 1.1.1 | SMF © 2006, Simple Machines LLC
Joomla Bridge by JoomlaHacks.com
© 2008 Everything That I Know About