Source for file contact_item_link.class.php

Documentation is available at contact_item_link.class.php

  1. <?php
  2. /**
  3. @package Mambo
  4. @subpackage Menus
  5. @copyright  Refer to copyright.php
  6. @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
  7. @author Mambo Foundation Inc see README.php
  8. */ 
  9.  
  10. /** ensure this file is being included by a parent file */
  11. defined'_VALID_MOS' or die'Direct Access to this location is not allowed.' );
  12.  
  13. /**
  14. * Contact item link class
  15. */
  16.  
  17.     function edit&$uid$menutype$option {
  18.         global $database$my$mainframe;
  19.         global $mosConfig_absolute_path;
  20.     
  21.         $menu new mosMenu$database );
  22.         $menu->load$uid );
  23.     
  24.         // fail if checked out not by 'me'
  25.         if ($menu->checked_out && $menu->checked_out <> $my->id{
  26.             echo "<script>alert('".sprintf(T_('The module % is currently being edited by another administrator')$menu->title)."'); document.location.href='index2.php?option=$option'</script>\n";
  27.             exit(0);
  28.         }
  29.     
  30.         if $uid {
  31.             $menu->checkout$my->id );
  32.         else {
  33.             // load values for new entry
  34.             $menu->type 'contact_item_link';
  35.             $menu->menutype $menutype;
  36.             $menu->browserNav 0;
  37.             $menu->ordering 9999;
  38.             $menu->parent intvalmosGetParam$_POST'parent') );
  39.             $menu->published 1;
  40.         }
  41.     
  42.         if $uid {
  43.             $temp explode'contact_id='$menu->link );
  44.             $query "SELECT *"
  45.             . "\n FROM #__contact_details AS a"
  46.             . "\n WHERE a.id = '"$temp[1."'"
  47.             ;
  48.             $database->setQuery$query );
  49.             $contact $database->loadObjectlist();
  50.             // outputs item name, category & section instead of the select list
  51.             $lists['contact''
  52.             <table width="100%">
  53.             <tr>
  54.                 <td width="10%">
  55.                 '.T_('Name:').'
  56.                 </td>
  57.                 <td>
  58.                 '$contact[0]->name .'
  59.                 </td>
  60.             </tr>
  61.             <tr>
  62.                 <td width="10%">
  63.                 '.T_('Position:').'
  64.                 </td>
  65.                 <td>
  66.                 '$contact[0]->con_position .'
  67.                 </td>
  68.             </tr>
  69.             </table>';
  70.             $lists['contact'.= '<input type="hidden" name="contact_item_link" value="'$temp[1.'" />';
  71.             $contacts '';
  72.         else {
  73.             $query "SELECT a.id AS value, CONCAT( a.name, ' - ',a.con_position ) AS text, a.catid "
  74.             . "\n FROM #__contact_details AS a"
  75.             . "\n INNER JOIN #__categories AS c ON a.catid = c.id"
  76.             . "\n WHERE a.published = '1'"
  77.             . "\n ORDER BY a.catid, a.name"
  78.             ;
  79.             $database->setQuery$query );
  80.             $contacts $database->loadObjectList);
  81.     
  82.             //    Create a list of links
  83.             $lists['contact'mosHTML::selectList$contacts'contact_item_link''class="inputbox" size="10"''value''text''' );
  84.         }
  85.         
  86.         // build html select list for target window
  87.         $lists['target']         mosAdminMenus::Target$menu );
  88.     
  89.         // build the html select list for ordering
  90.         $lists['ordering']         mosAdminMenus::Ordering$menu$uid );
  91.         // build the html select list for the group access
  92.         $lists['access']         mosAdminMenus::Access$menu );
  93.         // build the html select list for paraent item
  94.         $lists['parent']         mosAdminMenus::Parent$menu );
  95.         // build published button option
  96.         $lists['published']     mosAdminMenus::Published$menu );
  97.         // build the url link output
  98.         $lists['link']         mosAdminMenus::Link$menu$uid );
  99.         
  100.         // get params definitions
  101.         $params =new mosAdminParameters$menu->params$mainframe->getPath'menu_xml'$menu->type )'menu' );
  102.     
  103.         contact_item_link_menu_html::edit$menu$lists$params$option$contacts );
  104.     }
  105. }
  106. ?>

Documentation generated on Mon, 05 May 2008 16:18:14 +0400 by phpDocumentor 1.4.0