diff --git a/oss/joomla/trunk/administrator/components/com_checkin/admin.checkin.php b/oss/joomla/trunk/administrator/components/com_checkin/admin.checkin.php
new file mode 100644
index 00000000..c798cfdf
--- /dev/null
+++ b/oss/joomla/trunk/administrator/components/com_checkin/admin.checkin.php
@@ -0,0 +1,107 @@
+authorize( 'com_checkin', 'manage' )) {
+ $mainframe->redirect( 'index.php', JText::_('ALERTNOTAUTH') );
+}
+$db =& JFactory::getDBO();
+$nullDate = $db->getNullDate();
+?>
+
\ No newline at end of file
diff --git a/oss/joomla/trunk/administrator/components/com_checkin/index.html b/oss/joomla/trunk/administrator/components/com_checkin/index.html
new file mode 100644
index 00000000..fa6d84e8
--- /dev/null
+++ b/oss/joomla/trunk/administrator/components/com_checkin/index.html
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/oss/joomla/trunk/administrator/components/com_checkin/toolbar.checkin.html.php b/oss/joomla/trunk/administrator/components/com_checkin/toolbar.checkin.html.php
new file mode 100644
index 00000000..dafbd4f5
--- /dev/null
+++ b/oss/joomla/trunk/administrator/components/com_checkin/toolbar.checkin.html.php
@@ -0,0 +1,31 @@
+
+
+ image == '') {
+ $row->image = 'blank.png';
+ }
+
+ JHTML::_('behavior.tooltip');
+ jimport('joomla.html.pane');
+ // TODO: allowAllClose should default true in J!1.6, so remove the array when it does.
+ $pane = &JPane::getInstance('sliders', array('allowAllClose' => true));
+
+ JFilterOutput::objectHTMLSafe( $row, ENT_QUOTES, 'misc' );
+ $cparams = JComponentHelper::getParams ('com_media');
+ ?>
+
+
+
+ authorize( 'com_contact', 'manage' )) {
+ $mainframe->redirect( 'index.php', JText::_('ALERTNOTAUTH') );
+}
+
+require_once( JApplicationHelper::getPath( 'admin_html' ) );
+// Set the table directory
+JTable::addIncludePath(JPATH_ADMINISTRATOR.DS.'components'.DS.'com_contact'.DS.'tables');
+
+$task = JRequest::getCmd('task');
+$id = JRequest::getVar('id', 0, 'get', 'int');
+$cid = JRequest::getVar('cid', array(0), 'post', 'array');
+JArrayHelper::toInteger($cid, array(0));
+
+switch ($task)
+{
+ case 'add' :
+ editContact(false );
+ break;
+ case 'edit':
+ editContact(true);
+ break;
+
+ case 'apply':
+ case 'save':
+ case 'save2new':
+ case 'save2copy':
+ saveContact( $task );
+ break;
+
+ case 'remove':
+ removeContacts( $cid );
+ break;
+
+ case 'publish':
+ changeContact( $cid, 1 );
+ break;
+
+ case 'unpublish':
+ changeContact( $cid, 0 );
+ break;
+
+ case 'orderup':
+ orderContacts( $cid[0], -1 );
+ break;
+
+ case 'orderdown':
+ orderContacts( $cid[0], 1 );
+ break;
+
+ case 'accesspublic':
+ changeAccess( $cid[0], 0 );
+ break;
+
+ case 'accessregistered':
+ changeAccess( $cid[0], 1 );
+ break;
+
+ case 'accessspecial':
+ changeAccess( $cid[0], 2 );
+ break;
+
+ case 'saveorder':
+ saveOrder( $cid );
+ break;
+
+ case 'cancel':
+ cancelContact();
+ break;
+
+ default:
+ showContacts( $option );
+ break;
+}
+
+/**
+* List the records
+* @param string The current GET/POST option
+*/
+function showContacts( $option )
+{
+ global $mainframe;
+
+ $db =& JFactory::getDBO();
+ $filter_order = $mainframe->getUserStateFromRequest( $option.'filter_order', 'filter_order', 'cd.ordering', 'cmd' );
+ $filter_order_Dir = $mainframe->getUserStateFromRequest( $option.'filter_order_Dir', 'filter_order_Dir', '', 'word' );
+ $filter_state = $mainframe->getUserStateFromRequest( $option.'filter_state', 'filter_state', '', 'word' );
+ $filter_catid = $mainframe->getUserStateFromRequest( $option.'filter_catid', 'filter_catid', 0, 'int' );
+ $search = $mainframe->getUserStateFromRequest( $option.'search', 'search', '', 'string' );
+ $search = JString::strtolower( $search );
+
+ $limit = $mainframe->getUserStateFromRequest('global.list.limit', 'limit', $mainframe->getCfg('list_limit'), 'int');
+ $limitstart = $mainframe->getUserStateFromRequest($option.'.limitstart', 'limitstart', 0, 'int');
+
+ $where = array();
+
+ if ( $search ) {
+ $where[] = 'cd.name LIKE '.$db->Quote( '%'.$db->getEscaped( $search, true ).'%', false );
+ }
+ if ( $filter_catid ) {
+ $where[] = 'cd.catid = '.(int) $filter_catid;
+ }
+ if ( $filter_state ) {
+ if ( $filter_state == 'P' ) {
+ $where[] = 'cd.published = 1';
+ } else if ($filter_state == 'U' ) {
+ $where[] = 'cd.published = 0';
+ }
+ }
+
+ $where = ( count( $where ) ? ' WHERE ' . implode( ' AND ', $where ) : '' );
+ if ($filter_order == 'cd.ordering'){
+ $orderby = ' ORDER BY category, cd.ordering';
+ } else {
+ $orderby = ' ORDER BY '. $filter_order .' '. $filter_order_Dir .', category, cd.ordering';
+ }
+
+ // get the total number of records
+ $query = 'SELECT COUNT(*)'
+ . ' FROM #__contact_details AS cd'
+ . $where
+ ;
+ $db->setQuery( $query );
+ $total = $db->loadResult();
+
+ jimport('joomla.html.pagination');
+ $pageNav = new JPagination( $total, $limitstart, $limit );
+
+ // get the subset (based on limits) of required records
+ $query = 'SELECT cd.*, cc.title AS category, u.name AS user, v.name as editor, g.name AS groupname'
+ . ' FROM #__contact_details AS cd'
+ . ' LEFT JOIN #__groups AS g ON g.id = cd.access'
+ . ' LEFT JOIN #__categories AS cc ON cc.id = cd.catid'
+ . ' LEFT JOIN #__users AS u ON u.id = cd.user_id'
+ . ' LEFT JOIN #__users AS v ON v.id = cd.checked_out'
+ . $where
+ . $orderby
+ ;
+ $db->setQuery( $query, $pageNav->limitstart, $pageNav->limit );
+ $rows = $db->loadObjectList();
+
+ // build list of categories
+ $javascript = 'onchange="document.adminForm.submit();"';
+ $lists['catid'] = JHTML::_('list.category', 'filter_catid', 'com_contact_details', intval( $filter_catid ), $javascript );
+
+ // state filter
+ $lists['state'] = JHTML::_('grid.state', $filter_state );
+
+ // table ordering
+ $lists['order_Dir'] = $filter_order_Dir;
+ $lists['order'] = $filter_order;
+
+ // search filter
+ $lists['search']= $search;
+
+ HTML_contact::showcontacts( $rows, $pageNav, $option, $lists );
+}
+
+/**
+* Creates a new or edits and existing user record
+* @param int The id of the record, 0 if a new entry
+* @param string The current GET/POST option
+*/
+function editContact($edit )
+{
+ $db =& JFactory::getDBO();
+ $user =& JFactory::getUser();
+
+ $cid = JRequest::getVar('cid', array(0), '', 'array');
+ $option = JRequest::getCmd('option');
+
+ JArrayHelper::toInteger($cid, array(0));
+
+ $row =& JTable::getInstance('contact', 'Table');
+ // load the row from the db table
+ if($edit)
+ $row->load( $cid[0] );
+
+ if ($edit) {
+ // do stuff for existing records
+ $row->checkout($user->get('id'));
+ } else {
+ // do stuff for new records
+ $row->imagepos = 'top';
+ $row->ordering = 0;
+ $row->published = 1;
+ }
+ $lists = array();
+
+ // build the html select list for ordering
+ $query = 'SELECT ordering AS value, name AS text'
+ . ' FROM #__contact_details'
+ . ' WHERE published >= 0'
+ . ' AND catid = '.(int) $row->catid
+ . ' ORDER BY ordering'
+ ;
+ if($edit)
+ $lists['ordering'] = JHTML::_('list.specificordering', $row, $cid[0], $query );
+ else
+ $lists['ordering'] = JHTML::_('list.specificordering', $row, '', $query );
+
+ // build list of users
+ $lists['user_id'] = JHTML::_('list.users', 'user_id', $row->user_id, 1, NULL, 'name', 0 );
+ // build list of categories
+ $lists['catid'] = JHTML::_('list.category', 'catid', 'com_contact_details', intval( $row->catid ) );
+ // build the html select list for images
+ $lists['image'] = JHTML::_('list.images', 'image', $row->image );
+ // build the html select list for the group access
+ $lists['access'] = JHTML::_('list.accesslevel', $row );
+ // build the html radio buttons for published
+ $lists['published'] = JHTML::_('select.booleanlist', 'published', '', $row->published );
+ // build the html radio buttons for default
+ $lists['default_con'] = JHTML::_('select.booleanlist', 'default_con', '', $row->default_con );
+
+ // get params definitions
+ $file = JPATH_ADMINISTRATOR .'/components/com_contact/contact_items.xml';
+ $params = new JParameter( $row->params, $file, 'component' );
+
+ HTML_contact::editcontact( $row, $lists, $option, $params );
+}
+
+/**
+* Saves the record from an edit form submit
+* @param string The current GET/POST option
+*/
+function saveContact( $task )
+{
+ global $mainframe;
+
+ // Check for request forgeries
+ JRequest::checkToken() or jexit( 'Invalid Token' );
+
+ // Initialize variables
+ $db =& JFactory::getDBO();
+ $row =& JTable::getInstance('contact', 'Table');
+ $post = JRequest::get( 'post' );
+ $post['misc'] = JRequest::getVar('misc', '', 'POST', 'string', JREQUEST_ALLOWHTML);
+ if (!$row->bind( $post )) {
+ JError::raiseError(500, $row->getError() );
+ }
+ // save params
+ $params = JRequest::getVar( 'params', array(), 'post', 'array' );
+ if (is_array( $params )) {
+ $txt = array();
+ foreach ( $params as $k=>$v) {
+ $txt[] = "$k=$v";
+ }
+ $row->params = implode( "\n", $txt );
+ }
+
+ // save to a copy, reset the primary key
+ if ($task == 'save2copy') {
+ $row->id = 0;
+ }
+
+ // pre-save checks
+ if (!$row->check()) {
+ JError::raiseError(500, $row->getError() );
+ }
+
+ // if new item, order last in appropriate group
+ if (!$row->id) {
+ $where = "catid = " . (int) $row->catid;
+ $row->ordering = $row->getNextOrder( $where );
+ }
+
+ // save the changes
+ if (!$row->store()) {
+ JError::raiseError(500, $row->getError() );
+ }
+ $row->checkin();
+ if ($row->default_con) {
+ $query = 'UPDATE #__contact_details'
+ . ' SET default_con = 0'
+ . ' WHERE id <> '. (int) $row->id
+ . ' AND default_con = 1'
+ ;
+ $db->setQuery( $query );
+ $db->query();
+ }
+
+ switch ($task)
+ {
+ case 'apply':
+ case 'save2copy':
+ $msg = JText::sprintf( 'Changes to X saved', JText::_('Contact') );
+ $link = 'index.php?option=com_contact&task=edit&cid[]='. $row->id .'';
+ break;
+
+ case 'save2new':
+ $msg = JText::sprintf( 'Changes to X saved', JText::_('Contact') );
+ $link = 'index.php?option=com_contact&task=edit';
+ break;
+
+ case 'save':
+ default:
+ $msg = JText::_( 'Contact saved' );
+ $link = 'index.php?option=com_contact';
+ break;
+ }
+
+ $mainframe->redirect( $link, $msg );
+}
+
+/**
+* Removes records
+* @param array An array of id keys to remove
+* @param string The current GET/POST option
+*/
+function removeContacts( &$cid )
+{
+ global $mainframe;
+
+ // Check for request forgeries
+ JRequest::checkToken() or jexit( 'Invalid Token' );
+
+ // Initialize variables
+ $db =& JFactory::getDBO();
+ JArrayHelper::toInteger($cid);
+
+ if (count( $cid )) {
+ $cids = implode( ',', $cid );
+ $query = 'DELETE FROM #__contact_details'
+ . ' WHERE id IN ( '. $cids .' )'
+ ;
+ $db->setQuery( $query );
+ if (!$db->query()) {
+ echo "\n";
+ }
+ }
+
+ $mainframe->redirect( "index.php?option=com_contact" );
+}
+
+/**
+* Changes the state of one or more content pages
+* @param array An array of unique category id numbers
+* @param integer 0 if unpublishing, 1 if publishing
+* @param string The current option
+*/
+function changeContact( $cid=null, $state=0 )
+{
+ global $mainframe;
+
+ // Check for request forgeries
+ JRequest::checkToken() or jexit( 'Invalid Token' );
+
+ // Initialize variables
+ $db =& JFactory::getDBO();
+ $user =& JFactory::getUser();
+ JArrayHelper::toInteger($cid);
+
+ if (count( $cid ) < 1) {
+ $action = $state ? 'publish' : 'unpublish';
+ JError::raiseError(500, JText::_( 'Select an item to' .$action, true ) );
+ }
+
+ $cids = implode( ',', $cid );
+
+ $query = 'UPDATE #__contact_details'
+ . ' SET published = ' . (int) $state
+ . ' WHERE id IN ( '. $cids .' )'
+ . ' AND ( checked_out = 0 OR ( checked_out = '. (int) $user->get('id') .' ) )'
+ ;
+ $db->setQuery( $query );
+ if (!$db->query()) {
+ JError::raiseError(500, $db->getErrorMsg() );
+ }
+
+ if (count( $cid ) == 1) {
+ $row =& JTable::getInstance('contact', 'Table');
+ $row->checkin( intval( $cid[0] ) );
+ }
+
+ $mainframe->redirect( 'index.php?option=com_contact' );
+}
+
+/** JJC
+* Moves the order of a record
+* @param integer The increment to reorder by
+*/
+function orderContacts( $uid, $inc )
+{
+ global $mainframe;
+
+ // Check for request forgeries
+ JRequest::checkToken() or jexit( 'Invalid Token' );
+
+ // Initialize variables
+ $db =& JFactory::getDBO();
+
+ $row =& JTable::getInstance('contact', 'Table');
+ $row->load( $uid );
+ $row->move( $inc, 'catid = '. (int) $row->catid .' AND published != 0' );
+
+ $mainframe->redirect( 'index.php?option=com_contact' );
+}
+
+/** PT
+* Cancels editing and checks in the record
+*/
+function cancelContact()
+{
+ global $mainframe;
+
+ // Check for request forgeries
+ JRequest::checkToken() or jexit( 'Invalid Token' );
+
+ // Initialize variables
+ $db =& JFactory::getDBO();
+ $row =& JTable::getInstance('contact', 'Table');
+ $row->bind( JRequest::get( 'post' ));
+ $row->checkin();
+
+ $mainframe->redirect('index.php?option=com_contact');
+}
+
+/**
+* changes the access level of a record
+* @param integer The increment to reorder by
+*/
+function changeAccess( $id, $access )
+{
+ global $mainframe;
+
+ // Check for request forgeries
+ JRequest::checkToken() or jexit( 'Invalid Token' );
+
+ // Initialize variables
+ $db =& JFactory::getDBO();
+
+ $row =& JTable::getInstance('contact', 'Table');
+ $row->load( $id );
+ $row->access = $access;
+
+ if ( !$row->check() ) {
+ return $row->getError();
+ }
+ if ( !$row->store() ) {
+ return $row->getError();
+ }
+
+ $mainframe->redirect( 'index.php?option=com_contact' );
+}
+
+function saveOrder( &$cid )
+{
+ global $mainframe;
+
+ // Check for request forgeries
+ JRequest::checkToken() or jexit( 'Invalid Token' );
+
+ // Initialize variables
+ $db =& JFactory::getDBO();
+ $total = count( $cid );
+ $order = JRequest::getVar( 'order', array(0), 'post', 'array' );
+ JArrayHelper::toInteger($order, array(0));
+
+ $row =& JTable::getInstance('contact', 'Table');
+ $groupings = array();
+
+ // update ordering values
+ for( $i=0; $i < $total; $i++ ) {
+ $row->load( (int) $cid[$i] );
+ // track categories
+ $groupings[] = $row->catid;
+
+ if ($row->ordering != $order[$i]) {
+ $row->ordering = $order[$i];
+ if (!$row->store()) {
+ JError::raiseError(500, $db->getErrorMsg() );
+ }
+ }
+ }
+
+ // execute updateOrder for each parent group
+ $groupings = array_unique( $groupings );
+ foreach ($groupings as $group){
+ $row->reorder('catid = '.(int) $group);
+ }
+
+ $msg = 'New ordering saved';
+ $mainframe->redirect( 'index.php?option=com_contact', $msg );
+}
diff --git a/oss/joomla/trunk/administrator/components/com_contact/config.xml b/oss/joomla/trunk/administrator/components/com_contact/config.xml
new file mode 100644
index 00000000..1c4d06f7
--- /dev/null
+++ b/oss/joomla/trunk/administrator/components/com_contact/config.xml
@@ -0,0 +1,61 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/oss/joomla/trunk/administrator/components/com_contact/contact.xml b/oss/joomla/trunk/administrator/components/com_contact/contact.xml
new file mode 100644
index 00000000..f0222d1e
--- /dev/null
+++ b/oss/joomla/trunk/administrator/components/com_contact/contact.xml
@@ -0,0 +1,12 @@
+
+
+ Contact
+ Joomla! Project
+ Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved.
+ April 2006
+ http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
+ admin@joomla.org
+ www.joomla.org
+ 1.5.0
+ This component shows a listing of Contact Information
+
diff --git a/oss/joomla/trunk/administrator/components/com_contact/contact_items.xml b/oss/joomla/trunk/administrator/components/com_contact/contact_items.xml
new file mode 100644
index 00000000..ff9d5b44
--- /dev/null
+++ b/oss/joomla/trunk/administrator/components/com_contact/contact_items.xml
@@ -0,0 +1,101 @@
+
+
+ Contact Items
+ Joomla! Project
+ 2006
+ Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved.
+ http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
+ admin@joomla.org
+ www.joomla.org
+ 1.0.0
+ Parameters for individual Contact Items
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/oss/joomla/trunk/administrator/components/com_contact/elements/contact.php b/oss/joomla/trunk/administrator/components/com_contact/elements/contact.php
new file mode 100644
index 00000000..70111727
--- /dev/null
+++ b/oss/joomla/trunk/administrator/components/com_contact/elements/contact.php
@@ -0,0 +1,43 @@
+setQuery( $query );
+ $options = $db->loadObjectList( );
+
+ return JHTML::_('select.genericlist', $options, ''.$control_name.'['.$name.']', 'class="inputbox"', 'id', 'text', $value, $control_name.$name );
+ }
+}
diff --git a/oss/joomla/trunk/administrator/components/com_contact/elements/index.html b/oss/joomla/trunk/administrator/components/com_contact/elements/index.html
new file mode 100644
index 00000000..fa6d84e8
--- /dev/null
+++ b/oss/joomla/trunk/administrator/components/com_contact/elements/index.html
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/oss/joomla/trunk/administrator/components/com_contact/helpers/index.html b/oss/joomla/trunk/administrator/components/com_contact/helpers/index.html
new file mode 100644
index 00000000..fa6d84e8
--- /dev/null
+++ b/oss/joomla/trunk/administrator/components/com_contact/helpers/index.html
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/oss/joomla/trunk/administrator/components/com_contact/helpers/vcard.php b/oss/joomla/trunk/administrator/components/com_contact/helpers/vcard.php
new file mode 100644
index 00000000..a97c29bf
--- /dev/null
+++ b/oss/joomla/trunk/administrator/components/com_contact/helpers/vcard.php
@@ -0,0 +1,94 @@
+properties["N"] = "$family;$first;$additional;$prefix;$suffix";
+ $this->setFormattedName( trim( "$prefix $first $additional $family $suffix" ) );
+ }
+
+ // needed to fix bug in vcard class
+ function setAddress( $postoffice='', $extended='', $street='', $city='', $region='', $zip='', $country='', $type='HOME;POSTAL' ) {
+ // $type may be DOM | INTL | POSTAL | PARCEL | HOME | WORK or any combination of these: e.g. "WORK;PARCEL;POSTAL"
+ $separator = ';';
+
+ $key = 'ADR';
+ if ( $type != '' ) {
+ $key .= $separator . $type;
+ }
+ $key.= ';ENCODING=QUOTED-PRINTABLE';
+
+ $return = encode( $postoffice );
+ $return .= $separator . encode( $extended );
+ $return .= $separator . encode( $street );
+ $return .= $separator . encode( $city );
+ $return .= $separator . encode( $region);
+ $return .= $separator . encode( $zip );
+ $return .= $separator . encode( $country );
+
+ $this->properties[$key] = $return;
+ }
+
+ // added ability to set filename
+ function setFilename( $filename ) {
+ $this->filename = $filename .'.vcf';
+ }
+
+ // added ability to set position/title
+ function setTitle( $title ) {
+ $title = trim( $title );
+
+ $this->properties['TITLE'] = $title;
+ }
+
+ // added ability to set organisation/company
+ function setOrg( $org ) {
+ $org = trim( $org );
+
+ $this->properties['ORG'] = $org;
+ }
+
+ function getVCard( $sitename ) {
+ $text = 'BEGIN:VCARD';
+ $text .= "\r\n";
+ $text .= 'VERSION:2.1';
+ $text .= "\r\n";
+
+ foreach( $this->properties as $key => $value ) {
+ $text .= "$key:$value";
+ $text .= "\r\n";
+ }
+ $text .= 'REV:'. date( 'Y-m-d' ) .'T'. date( 'H:i:s' ). 'Z';
+ $text .= "\r\n";
+ $text .= 'MAILER: Joomla! vCard for '. $sitename;
+ $text .= "\r\n";
+ $text .= 'END:VCARD';
+ $text .= "\r\n";
+
+ return $text;
+ }
+}
\ No newline at end of file
diff --git a/oss/joomla/trunk/administrator/components/com_contact/index.html b/oss/joomla/trunk/administrator/components/com_contact/index.html
new file mode 100644
index 00000000..fa6d84e8
--- /dev/null
+++ b/oss/joomla/trunk/administrator/components/com_contact/index.html
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/oss/joomla/trunk/administrator/components/com_contact/tables/contact.php b/oss/joomla/trunk/administrator/components/com_contact/tables/contact.php
new file mode 100644
index 00000000..5cd873b0
--- /dev/null
+++ b/oss/joomla/trunk/administrator/components/com_contact/tables/contact.php
@@ -0,0 +1,119 @@
+default_con = intval( $this->default_con );
+
+ if (JFilterInput::checkAttribute(array ('href', $this->webpage))) {
+ $this->setError(JText::_('Please provide a valid URL'));
+ return false;
+ }
+
+ // check for http on webpage
+ if (strlen($this->webpage) > 0 && (!(eregi('http://', $this->webpage) || (eregi('https://', $this->webpage)) || (eregi('ftp://', $this->webpage))))) {
+ $this->webpage = 'http://'.$this->webpage;
+ }
+
+ if(empty($this->alias)) {
+ $this->alias = $this->name;
+ }
+ $this->alias = JFilterOutput::stringURLSafe($this->alias);
+ if(trim(str_replace('-','',$this->alias)) == '') {
+ $datenow =& JFactory::getDate();
+ $this->alias = $datenow->toFormat("%Y-%m-%d-%H-%M-%S");
+ }
+
+ return true;
+ }
+}
diff --git a/oss/joomla/trunk/administrator/components/com_contact/tables/index.html b/oss/joomla/trunk/administrator/components/com_contact/tables/index.html
new file mode 100644
index 00000000..fa6d84e8
--- /dev/null
+++ b/oss/joomla/trunk/administrator/components/com_contact/tables/index.html
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/oss/joomla/trunk/administrator/components/com_contact/toolbar.contact.html.php b/oss/joomla/trunk/administrator/components/com_contact/toolbar.contact.html.php
new file mode 100644
index 00000000..89e4728e
--- /dev/null
+++ b/oss/joomla/trunk/administrator/components/com_contact/toolbar.contact.html.php
@@ -0,0 +1,59 @@
+[ '. $text .' ]', 'generic.png' );
+
+ //JToolBarHelper::custom( 'save2new', 'new.png', 'new_f2.png', 'Save & New', false, false );
+ //JToolBarHelper::custom( 'save2copy', 'copy.png', 'copy_f2.png', 'Save To Copy', false, false );
+ JToolBarHelper::save();
+ JToolBarHelper::apply();
+ if ( $edit ) {
+ // for existing items the button is renamed `close`
+ JToolBarHelper::cancel( 'cancel', 'Close' );
+ } else {
+ JToolBarHelper::cancel();
+ }
+ JToolBarHelper::help( 'screen.contactmanager.edit' );
+ }
+
+ function _DEFAULT() {
+
+ JToolBarHelper::title( JText::_( 'Contact Manager' ), 'generic.png' );
+ JToolBarHelper::publishList();
+ JToolBarHelper::unpublishList();
+ JToolBarHelper::deleteList();
+ JToolBarHelper::editListX();
+ JToolBarHelper::addNewX();
+ JToolBarHelper::preferences('com_contact', '500');
+
+ JToolBarHelper::help( 'screen.contactmanager' );
+ }
+}
\ No newline at end of file
diff --git a/oss/joomla/trunk/administrator/components/com_contact/toolbar.contact.php b/oss/joomla/trunk/administrator/components/com_contact/toolbar.contact.php
new file mode 100644
index 00000000..7b37ab8b
--- /dev/null
+++ b/oss/joomla/trunk/administrator/components/com_contact/toolbar.contact.php
@@ -0,0 +1,33 @@
+ true));
+ echo $pane->startPane("content-pane");
+
+ foreach ($modules as $module) {
+ $title = $module->title ;
+ echo $pane->startPanel( $title, 'cpanel-panel-'.$module->name );
+ echo JModuleHelper::renderModule($module);
+ echo $pane->endPanel();
+ }
+
+ echo $pane->endPane();
+ }
+}
\ No newline at end of file
diff --git a/oss/joomla/trunk/administrator/components/com_cpanel/admin.cpanel.php b/oss/joomla/trunk/administrator/components/com_cpanel/admin.cpanel.php
new file mode 100644
index 00000000..d0c69cff
--- /dev/null
+++ b/oss/joomla/trunk/administrator/components/com_cpanel/admin.cpanel.php
@@ -0,0 +1,27 @@
+
+
+ Control Panel
+ Joomla! Project
+ 2006
+ Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved.
+ http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
+ admin@joomla.org
+ www.joomla.org
+ 1.5.0
+ The Control Panel is the Home Page of the Joomla! Administrator Back-end
+
diff --git a/oss/joomla/trunk/administrator/components/com_cpanel/index.html b/oss/joomla/trunk/administrator/components/com_cpanel/index.html
new file mode 100644
index 00000000..fa6d84e8
--- /dev/null
+++ b/oss/joomla/trunk/administrator/components/com_cpanel/index.html
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/oss/joomla/trunk/administrator/components/com_cpanel/toolbar.cpanel.html.php b/oss/joomla/trunk/administrator/components/com_cpanel/toolbar.cpanel.html.php
new file mode 100644
index 00000000..c4f16973
--- /dev/null
+++ b/oss/joomla/trunk/administrator/components/com_cpanel/toolbar.cpanel.html.php
@@ -0,0 +1,28 @@
+authorize('com_installer', 'installer')) {
+ $mainframe->redirect('index.php', JText::_('ALERTNOTAUTH'));
+}
+
+$ext = JRequest::getWord('type');
+
+$subMenus = array(
+ 'Components' => 'components',
+ 'Modules' => 'modules',
+ 'Plugins' => 'plugins',
+ 'Languages' => 'languages',
+ 'Templates' => 'templates');
+
+JSubMenuHelper::addEntry(JText::_( 'Install' ), '#" onclick="javascript:document.adminForm.type.value=\'\';submitbutton(\'installer\');', !in_array( $ext, $subMenus));
+foreach ($subMenus as $name => $extension) {
+ JSubMenuHelper::addEntry(JText::_( $name ), '#" onclick="javascript:document.adminForm.type.value=\''.$extension.'\';submitbutton(\'manage\');', ($extension == $ext));
+}
+
+require_once( JPATH_COMPONENT.DS.'controller.php' );
+
+$controller = new InstallerController( array('default_task' => 'installform') );
+//die(JRequest::getCmd('task'));
+$controller->execute( JRequest::getCmd('task') );
+$controller->redirect();
diff --git a/oss/joomla/trunk/administrator/components/com_installer/controller.php b/oss/joomla/trunk/administrator/components/com_installer/controller.php
new file mode 100644
index 00000000..266a90f8
--- /dev/null
+++ b/oss/joomla/trunk/administrator/components/com_installer/controller.php
@@ -0,0 +1,191 @@
+getModel( 'Install' );
+ $model->setState( 'install.directory', $mainframe->getCfg( 'config.tmp_path' ));
+
+ $view = &$this->getView( 'Install');
+
+ $ftp =& JClientHelper::setCredentialsFromRequest('ftp');
+ $view->assignRef('ftp', $ftp);
+
+ $view->setModel( $model, true );
+ $view->display();
+ }
+
+ /**
+ * Install an extension
+ *
+ * @access public
+ * @return void
+ * @since 1.5
+ */
+ function doInstall()
+ {
+ // Check for request forgeries
+ JRequest::checkToken() or jexit( 'Invalid Token' );
+
+ $model = &$this->getModel( 'Install' );
+ $view = &$this->getView( 'Install' );
+
+ $ftp =& JClientHelper::setCredentialsFromRequest('ftp');
+ $view->assignRef('ftp', $ftp);
+
+ if ($model->install()) {
+ $cache = &JFactory::getCache('mod_menu');
+ $cache->clean();
+ }
+
+ $view->setModel( $model, true );
+ $view->display();
+ }
+
+ /**
+ * Manage an extension type (List extensions of a given type)
+ *
+ * @access public
+ * @return void
+ * @since 1.5
+ */
+ function manage()
+ {
+ $type = JRequest::getWord('type', 'components');
+ $model = &$this->getModel( $type );
+ $view = &$this->getView( $type );
+
+ $ftp =& JClientHelper::setCredentialsFromRequest('ftp');
+ $view->assignRef('ftp', $ftp);
+
+ $view->setModel( $model, true );
+ $view->display();
+ }
+
+ /**
+ * Enable an extension (If supported)
+ *
+ * @access public
+ * @return void
+ * @since 1.5
+ */
+ function enable()
+ {
+ // Check for request forgeries
+ JRequest::checkToken( 'request' ) or jexit( 'Invalid Token' );
+
+ $type = JRequest::getWord('type', 'components');
+ $model = &$this->getModel( $type );
+ $view = &$this->getView( $type );
+
+ $ftp =& JClientHelper::setCredentialsFromRequest('ftp');
+ $view->assignRef('ftp', $ftp);
+
+ if (method_exists($model, 'enable')) {
+ $eid = JRequest::getVar('eid', array(), '', 'array');
+ JArrayHelper::toInteger($eid, array());
+ $model->enable($eid);
+ }
+
+ $view->setModel( $model, true );
+ $view->display();
+ }
+
+ /**
+ * Disable an extension (If supported)
+ *
+ * @access public
+ * @return void
+ * @since 1.5
+ */
+ function disable()
+ {
+ // Check for request forgeries
+ JRequest::checkToken( 'request' ) or jexit( 'Invalid Token' );
+
+ $type = JRequest::getWord('type', 'components');
+ $model = &$this->getModel( $type );
+ $view = &$this->getView( $type );
+
+ $ftp =& JClientHelper::setCredentialsFromRequest('ftp');
+ $view->assignRef('ftp', $ftp);
+
+ if (method_exists($model, 'disable')) {
+ $eid = JRequest::getVar('eid', array(), '', 'array');
+ JArrayHelper::toInteger($eid, array());
+ $model->disable($eid);
+ }
+
+ $view->setModel( $model, true );
+ $view->display();
+ }
+
+ /**
+ * Remove an extension (Uninstall)
+ *
+ * @access public
+ * @return void
+ * @since 1.5
+ */
+ function remove()
+ {
+ // Check for request forgeries
+ JRequest::checkToken() or jexit( 'Invalid Token' );
+
+ $type = JRequest::getWord('type', 'components');
+ $model = &$this->getModel( $type );
+ $view = &$this->getView( $type );
+
+ $ftp =& JClientHelper::setCredentialsFromRequest('ftp');
+ $view->assignRef('ftp', $ftp);
+
+ $eid = JRequest::getVar('eid', array(), '', 'array');
+
+ // Update to handle components radio box
+ // Checks there is only one extensions, we're uninstalling components
+ // and then checks that the zero numbered item is set (shouldn't be a zero
+ // if the eid is set to the proper format)
+ if((count($eid) == 1) && ($type == 'components') && (isset($eid[0]))) $eid = array($eid[0] => 0);
+
+ JArrayHelper::toInteger($eid, array());
+ $result = $model->remove($eid);
+
+ $view->setModel( $model, true );
+ $view->display();
+ }
+}
\ No newline at end of file
diff --git a/oss/joomla/trunk/administrator/components/com_installer/helper.php b/oss/joomla/trunk/administrator/components/com_installer/helper.php
new file mode 100644
index 00000000..457ab5d9
--- /dev/null
+++ b/oss/joomla/trunk/administrator/components/com_installer/helper.php
@@ -0,0 +1,37 @@
+'.JText::_( 'Writable' ).''
+ : ''.JText::_( 'Unwritable' ).'';
+ }
+}
\ No newline at end of file
diff --git a/oss/joomla/trunk/administrator/components/com_installer/index.html b/oss/joomla/trunk/administrator/components/com_installer/index.html
new file mode 100644
index 00000000..fa6d84e8
--- /dev/null
+++ b/oss/joomla/trunk/administrator/components/com_installer/index.html
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/oss/joomla/trunk/administrator/components/com_installer/installer.xml b/oss/joomla/trunk/administrator/components/com_installer/installer.xml
new file mode 100644
index 00000000..f21951d7
--- /dev/null
+++ b/oss/joomla/trunk/administrator/components/com_installer/installer.xml
@@ -0,0 +1,12 @@
+
+
+ Installation Manager
+ Joomla! Project
+ 2006
+ Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved.
+ http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
+ admin@joomla.org
+ www.joomla.org
+ 1.5.0
+ Installation Manager
+
diff --git a/oss/joomla/trunk/administrator/components/com_installer/models/components.php b/oss/joomla/trunk/administrator/components/com_installer/models/components.php
new file mode 100644
index 00000000..0f7ab13f
--- /dev/null
+++ b/oss/joomla/trunk/administrator/components/com_installer/models/components.php
@@ -0,0 +1,173 @@
+_type);
+
+ // Enable the extension in the table and store it in the database
+ foreach ($eid as $id)
+ {
+ $table->load($id);
+ $table->enabled = '1';
+ $result |= $table->store();
+ }
+
+ return $result;
+ }
+
+ /**
+ * Disable a component
+ *
+ * @return boolean True on success
+ * @since 1.5
+ */
+ function disable($eid=array())
+ {
+ // Initialize variables
+ $result = false;
+
+ /*
+ * Ensure eid is an array of extension ids
+ * TODO: If it isn't an array do we want to set an error and fail?
+ */
+ if (!is_array($eid)) {
+ $eid = array ($eid);
+ }
+
+ // Get a database connector
+ $db =& JFactory::getDBO();
+
+ // Get a table object for the extension type
+ $table = & JTable::getInstance($this->_type);
+
+ // Disable the extension in the table and store it in the database
+ foreach ($eid as $id)
+ {
+ $table->load($id);
+ $table->enabled = '0';
+ $result |= $table->store();
+ }
+
+ return $result;
+ }
+
+ function _loadItems()
+ {
+ global $mainframe, $option;
+
+ jimport('joomla.filesystem.folder');
+
+ /* Get a database connector */
+ $db =& JFactory::getDBO();
+
+ $query = 'SELECT *' .
+ ' FROM #__components' .
+ ' WHERE parent = 0' .
+ ' ORDER BY iscore, name';
+ $db->setQuery($query);
+ $rows = $db->loadObjectList();
+
+ /* Get the component base directory */
+ $adminDir = JPATH_ADMINISTRATOR .DS. 'components';
+ $siteDir = JPATH_SITE .DS. 'components';
+
+ $numRows = count($rows);
+ for($i=0;$i < $numRows; $i++)
+ {
+ $row =& $rows[$i];
+
+ /* Get the component folder and list of xml files in folder */
+ $folder = $adminDir.DS.$row->option;
+ if (JFolder::exists($folder)) {
+ $xmlFilesInDir = JFolder::files($folder, '.xml$');
+ } else {
+ $folder = $siteDir.DS.$row->option;
+ if (JFolder::exists($folder)) {
+ $xmlFilesInDir = JFolder::files($folder, '.xml$');
+ } else {
+ $xmlFilesInDir = null;
+ }
+ }
+
+ if (count($xmlFilesInDir))
+ {
+ foreach ($xmlFilesInDir as $xmlfile)
+ {
+ if ($data = JApplicationHelper::parseXMLInstallFile($folder.DS.$xmlfile)) {
+ foreach($data as $key => $value) {
+ $row->$key = $value;
+ }
+ }
+ $row->jname = JString::strtolower(str_replace(" ", "_", $row->name));
+ }
+ }
+ }
+ $this->setState('pagination.total', $numRows);
+
+ // if the offset is greater than the total, then can the offset
+ if($this->_state->get('pagination.offset') > $this->_state->get('pagination.total')) {
+ $this->setState('pagination.offset',0);
+ }
+
+ if($this->_state->get('pagination.limit') > 0) {
+ $this->_items = array_slice( $rows, $this->_state->get('pagination.offset'), $this->_state->get('pagination.limit') );
+ } else {
+ $this->_items = $rows;
+ }
+ }
+}
\ No newline at end of file
diff --git a/oss/joomla/trunk/administrator/components/com_installer/models/extension.php b/oss/joomla/trunk/administrator/components/com_installer/models/extension.php
new file mode 100644
index 00000000..1da0df63
--- /dev/null
+++ b/oss/joomla/trunk/administrator/components/com_installer/models/extension.php
@@ -0,0 +1,142 @@
+setState('pagination.limit', $mainframe->getUserStateFromRequest('global.list.limit', 'limit', $mainframe->getCfg('list_limit'), 'int'));
+ $this->setState('pagination.offset',$mainframe->getUserStateFromRequest('com_installer.limitstart.'.$this->_type, 'limitstart', 0, 'int'));
+ $this->setState('pagination.total', 0);
+ }
+
+ function &getItems()
+ {
+ if (empty($this->_items)) {
+ // Load the items
+ $this->_loadItems();
+ }
+ return $this->_items;
+ }
+
+ function &getPagination()
+ {
+ if (empty($this->_pagination)) {
+ // Make sure items are loaded for a proper total
+ if (empty($this->_items)) {
+ // Load the items
+ $this->_loadItems();
+ }
+ // Load the pagination object
+ jimport('joomla.html.pagination');
+ $this->_pagination = new JPagination($this->_state->get('pagination.total'), $this->_state->get('pagination.offset'), $this->_state->get('pagination.limit'));
+ }
+ return $this->_pagination;
+ }
+
+ /**
+ * Remove (uninstall) an extension
+ *
+ * @static
+ * @param array An array of identifiers
+ * @return boolean True on success
+ * @since 1.0
+ */
+ function remove($eid=array())
+ {
+ global $mainframe;
+
+ // Initialize variables
+ $failed = array ();
+
+ /*
+ * Ensure eid is an array of extension ids in the form id => client_id
+ * TODO: If it isn't an array do we want to set an error and fail?
+ */
+ if (!is_array($eid)) {
+ $eid = array($eid => 0);
+ }
+
+ // Get a database connector
+ $db =& JFactory::getDBO();
+
+ // Get an installer object for the extension type
+ jimport('joomla.installer.installer');
+ $installer = & JInstaller::getInstance();
+
+ // Uninstall the chosen extensions
+ foreach ($eid as $id => $clientId)
+ {
+ $id = trim( $id );
+ $result = $installer->uninstall($this->_type, $id, $clientId );
+
+ // Build an array of extensions that failed to uninstall
+ if ($result === false) {
+ $failed[] = $id;
+ }
+ }
+
+ if (count($failed)) {
+ // There was an error in uninstalling the package
+ $msg = JText::sprintf('UNINSTALLEXT', JText::_($this->_type), JText::_('Error'));
+ $result = false;
+ } else {
+ // Package uninstalled sucessfully
+ $msg = JText::sprintf('UNINSTALLEXT', JText::_($this->_type), JText::_('Success'));
+ $result = true;
+ }
+
+ $mainframe->enqueueMessage($msg);
+ $this->setState('action', 'remove');
+ $this->setState('name', $installer->get('name'));
+ $this->setState('message', $installer->message);
+ $this->setState('extension.message', $installer->get('extension.message'));
+
+ return $result;
+ }
+
+ function _loadItems()
+ {
+ return JError::raiseError( 500, JText::_('Method Not Implemented'));
+ }
+}
\ No newline at end of file
diff --git a/oss/joomla/trunk/administrator/components/com_installer/models/index.html b/oss/joomla/trunk/administrator/components/com_installer/models/index.html
new file mode 100644
index 00000000..fa6d84e8
--- /dev/null
+++ b/oss/joomla/trunk/administrator/components/com_installer/models/index.html
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/oss/joomla/trunk/administrator/components/com_installer/models/install.php b/oss/joomla/trunk/administrator/components/com_installer/models/install.php
new file mode 100644
index 00000000..41f65bb7
--- /dev/null
+++ b/oss/joomla/trunk/administrator/components/com_installer/models/install.php
@@ -0,0 +1,236 @@
+setState('action', 'install');
+
+ switch(JRequest::getWord('installtype'))
+ {
+ case 'folder':
+ $package = $this->_getPackageFromFolder();
+ break;
+
+ case 'upload':
+ $package = $this->_getPackageFromUpload();
+ break;
+
+ case 'url':
+ $package = $this->_getPackageFromUrl();
+ break;
+
+ default:
+ $this->setState('message', 'No Install Type Found');
+ return false;
+ break;
+ }
+
+ // Was the package unpacked?
+ if (!$package) {
+ $this->setState('message', 'Unable to find install package');
+ return false;
+ }
+
+ // Get a database connector
+ //$db = & JFactory::getDBO();
+
+ // Get an installer instance
+ $installer =& JInstaller::getInstance();
+
+ // Install the package
+ if (!$installer->install($package['dir'])) {
+ // There was an error installing the package
+ $msg = JText::sprintf('INSTALLEXT', JText::_($package['type']), JText::_('Error'));
+ $result = false;
+ } else {
+ // Package installed sucessfully
+ $msg = JText::sprintf('INSTALLEXT', JText::_($package['type']), JText::_('Success'));
+ $result = true;
+ }
+
+ // Set some model state values
+ $mainframe->enqueueMessage($msg);
+ $this->setState('name', $installer->get('name'));
+ $this->setState('result', $result);
+ $this->setState('message', $installer->message);
+ $this->setState('extension.message', $installer->get('extension.message'));
+
+ // Cleanup the install files
+ if (!is_file($package['packagefile'])) {
+ $config =& JFactory::getConfig();
+ $package['packagefile'] = $config->getValue('config.tmp_path').DS.$package['packagefile'];
+ }
+
+ JInstallerHelper::cleanupInstall($package['packagefile'], $package['extractdir']);
+
+ return $result;
+ }
+
+ /**
+ * @param string The class name for the installer
+ */
+ function _getPackageFromUpload()
+ {
+ // Get the uploaded file information
+ $userfile = JRequest::getVar('install_package', null, 'files', 'array' );
+
+ // Make sure that file uploads are enabled in php
+ if (!(bool) ini_get('file_uploads')) {
+ JError::raiseWarning('SOME_ERROR_CODE', JText::_('WARNINSTALLFILE'));
+ return false;
+ }
+
+ // Make sure that zlib is loaded so that the package can be unpacked
+ if (!extension_loaded('zlib')) {
+ JError::raiseWarning('SOME_ERROR_CODE', JText::_('WARNINSTALLZLIB'));
+ return false;
+ }
+
+ // If there is no uploaded file, we have a problem...
+ if (!is_array($userfile) ) {
+ JError::raiseWarning('SOME_ERROR_CODE', JText::_('No file selected'));
+ return false;
+ }
+
+ // Check if there was a problem uploading the file.
+ if ( $userfile['error'] || $userfile['size'] < 1 )
+ {
+ JError::raiseWarning('SOME_ERROR_CODE', JText::_('WARNINSTALLUPLOADERROR'));
+ return false;
+ }
+
+ // Build the appropriate paths
+ $config =& JFactory::getConfig();
+ $tmp_dest = $config->getValue('config.tmp_path').DS.$userfile['name'];
+ $tmp_src = $userfile['tmp_name'];
+
+ // Move uploaded file
+ jimport('joomla.filesystem.file');
+ $uploaded = JFile::upload($tmp_src, $tmp_dest);
+
+ // Unpack the downloaded package file
+ $package = JInstallerHelper::unpack($tmp_dest);
+
+ return $package;
+ }
+
+ /**
+ * Install an extension from a directory
+ *
+ * @static
+ * @return boolean True on success
+ * @since 1.0
+ */
+ function _getPackageFromFolder()
+ {
+ // Get the path to the package to install
+ $p_dir = JRequest::getString('install_directory');
+ $p_dir = JPath::clean( $p_dir );
+
+ // Did you give us a valid directory?
+ if (!is_dir($p_dir)) {
+ JError::raiseWarning('SOME_ERROR_CODE', JText::_('Please enter a package directory'));
+ return false;
+ }
+
+ // Detect the package type
+ $type = JInstallerHelper::detectType($p_dir);
+
+ // Did you give us a valid package?
+ if (!$type) {
+ JError::raiseWarning('SOME_ERROR_CODE', JText::_('Path does not have a valid package'));
+ return false;
+ }
+
+ $package['packagefile'] = null;
+ $package['extractdir'] = null;
+ $package['dir'] = $p_dir;
+ $package['type'] = $type;
+
+ return $package;
+ }
+
+ /**
+ * Install an extension from a URL
+ *
+ * @static
+ * @return boolean True on success
+ * @since 1.5
+ */
+ function _getPackageFromUrl()
+ {
+ // Get a database connector
+ $db = & JFactory::getDBO();
+
+ // Get the URL of the package to install
+ $url = JRequest::getString('install_url');
+
+ // Did you give us a URL?
+ if (!$url) {
+ JError::raiseWarning('SOME_ERROR_CODE', JText::_('Please enter a URL'));
+ return false;
+ }
+
+ // Download the package at the URL given
+ $p_file = JInstallerHelper::downloadPackage($url);
+
+ // Was the package downloaded?
+ if (!$p_file) {
+ JError::raiseWarning('SOME_ERROR_CODE', JText::_('Invalid URL'));
+ return false;
+ }
+
+ $config =& JFactory::getConfig();
+ $tmp_dest = $config->getValue('config.tmp_path');
+
+ // Unpack the downloaded package file
+ $package = JInstallerHelper::unpack($tmp_dest.DS.$p_file);
+
+ return $package;
+ }
+}
\ No newline at end of file
diff --git a/oss/joomla/trunk/administrator/components/com_installer/models/languages.php b/oss/joomla/trunk/administrator/components/com_installer/models/languages.php
new file mode 100644
index 00000000..6cdb9294
--- /dev/null
+++ b/oss/joomla/trunk/administrator/components/com_installer/models/languages.php
@@ -0,0 +1,239 @@
+setState('filter.string', $mainframe->getUserStateFromRequest( "com_installer.languages.string", 'filter', '', 'string' ));
+ $this->setState('filter.client', $mainframe->getUserStateFromRequest( "com_installer.languages.client", 'client', -1, 'int' ));
+ }
+
+ function _loadItems()
+ {
+ global $mainframe, $option;
+
+ $db = &JFactory::getDBO();
+
+ if ($this->_state->get('filter.client') < 0) {
+ $client = 'all';
+ // Get the site languages
+ $langBDir = JLanguage::getLanguagePath(JPATH_SITE);
+ $langDirs = JFolder::folders($langBDir);
+
+ for ($i=0; $i < count($langDirs); $i++)
+ {
+ $lang = new stdClass();
+ $lang->folder = $langDirs[$i];
+ $lang->client = 0;
+ $lang->baseDir = $langBDir;
+ $languages[] = $lang;
+ }
+ // Get the admin languages
+ $langBDir = JLanguage::getLanguagePath(JPATH_ADMINISTRATOR);
+ $langDirs = JFolder::folders($langBDir);
+
+ for ($i=0; $i < count($langDirs); $i++)
+ {
+ $lang = new stdClass();
+ $lang->folder = $langDirs[$i];
+ $lang->client = 1;
+ $lang->baseDir = $langBDir;
+ $languages[] = $lang;
+ }
+ }
+ else
+ {
+ $clientInfo =& JApplicationHelper::getClientInfo($this->_state->get('filter.client'));
+ $client = $clientInfo->name;
+ $langBDir = JLanguage::getLanguagePath($clientInfo->path);
+ $langDirs = JFolder::folders($langBDir);
+
+ for ($i=0, $n=count($langDirs); $i < $n; $i++)
+ {
+ $lang = new stdClass();
+ $lang->folder = $langDirs[$i];
+ $lang->client = $clientInfo->id;
+ $lang->baseDir = $langBDir;
+
+ if ($this->_state->get('filter.string')) {
+ if (strpos($lang->folder, $this->_state->get('filter.string')) !== false) {
+ $languages[] = $lang;
+ }
+ } else {
+ $languages[] = $lang;
+ }
+ }
+ }
+
+ $rows = array();
+ $rowid = 0;
+ foreach ($languages as $language)
+ {
+ $files = JFolder::files( $language->baseDir.DS.$language->folder, '^([-_A-Za-z]*)\.xml$' );
+ foreach ($files as $file)
+ {
+ $data = JApplicationHelper::parseXMLLangMetaFile($language->baseDir.DS.$language->folder.DS.$file);
+
+ $row = new StdClass();
+ $row->id = $rowid;
+ $row->client_id = $language->client;
+ $row->language = $language->baseDir.DS.$language->folder;
+
+ // If we didn't get valid data from the xml file, move on...
+ if (!is_array($data)) {
+ continue;
+ }
+
+ // Populate the row from the xml meta file
+ foreach($data as $key => $value) {
+ $row->$key = $value;
+ }
+
+ // if current than set published
+ $clientVals =& JApplicationHelper::getClientInfo($row->client_id);
+ $lang = JComponentHelper::getParams('com_languages');
+ if ( $lang->get($clientVals->name, 'en-GB') == basename( $row->language ) ) {
+ $row->published = 1;
+ } else {
+ $row->published = 0;
+ }
+
+ $row->checked_out = 0;
+ $row->jname = JString::strtolower( str_replace( " ", "_", $row->name ) );
+ $rows[] = $row;
+ $rowid++;
+ }
+ }
+ $this->setState('pagination.total', count($rows));
+ // if the offset is greater than the total, then can the offset
+ if($this->_state->get('pagination.offset') > $this->_state->get('pagination.total')) {
+ $this->setState('pagination.offset',0);
+ }
+
+ if($this->_state->get('pagination.limit') > 0) {
+ $this->_items = array_slice( $rows, $this->_state->get('pagination.offset'), $this->_state->get('pagination.limit') );
+ } else {
+ $this->_items = $rows;
+ }
+ }
+
+ /**
+ * Remove (uninstall) an extension
+ *
+ * @static
+ * @return boolean True on success
+ * @since 1.0
+ */
+ function remove($eid=array())
+ {
+ global $mainframe;
+
+ $lang =& JFactory::getLanguage();
+ $lang->load('com_installer');
+
+ // Initialize variables
+ $failed = array ();
+
+ /*
+ * Ensure eid is an array of extension ids
+ * TODO: If it isn't an array do we want to set an error and fail?
+ */
+ if (!is_array($eid)) {
+ $eid = array ($eid);
+ }
+ // construct the list of all language
+ $this->_loadItems();
+
+ // Get a database connector
+ $db =& JFactory::getDBO();
+
+ // Get an installer object for the extension type
+ jimport('joomla.installer.installer');
+ $installer =& JInstaller::getInstance($db, $this->_type);
+
+ // Uninstall the chosen extensions
+ foreach ($eid as $id)
+ {
+ $item = $this->_items[$id];
+
+ // Get client information
+ $client =& JApplicationHelper::getClientInfo($item->client_id);
+
+ // Don't delete a default ( published language )
+ $params = JComponentHelper::getParams('com_languages');
+ $tag = basename($item->language);
+ if ( $params->get($client->name, 'en-GB') == $tag ) {
+ $failed[] = $id;
+ JError::raiseWarning('', JText::_('UNINSTALLLANGPUBLISHEDALREADY'));
+ return;
+ }
+
+ $result = $installer->uninstall( 'language', $item->language );
+
+ // Build an array of extensions that failed to uninstall
+ if ($result === false) {
+ $failed[] = $id;
+ }
+ }
+
+ if (count($failed)) {
+ // There was an error in uninstalling the package
+ $msg = JText::sprintf('UNINSTALLEXT', JText::_($this->_type), JText::_('Error'));
+ $result = false;
+ } else {
+ // Package uninstalled sucessfully
+ $msg = JText::sprintf('UNINSTALLEXT', JText::_($this->_type), JText::_('Success'));
+ $result = true;
+ }
+
+ $mainframe->enqueueMessage($msg);
+ $this->setState('action', 'remove');
+ $this->setState('message', $installer->message);
+ // re-construct the list of all language
+ $this->_loadItems();
+
+ return $result;
+ }
+}
\ No newline at end of file
diff --git a/oss/joomla/trunk/administrator/components/com_installer/models/modules.php b/oss/joomla/trunk/administrator/components/com_installer/models/modules.php
new file mode 100644
index 00000000..29c74127
--- /dev/null
+++ b/oss/joomla/trunk/administrator/components/com_installer/models/modules.php
@@ -0,0 +1,118 @@
+setState('filter.string', $mainframe->getUserStateFromRequest( 'com_installer.modules.string', 'filter', '', 'string' ));
+ $this->setState('filter.client', $mainframe->getUserStateFromRequest( 'com_installer.modules.client', 'client', -1, 'int' ));
+ }
+
+ function _loadItems()
+ {
+ global $mainframe, $option;
+
+ $db = &JFactory::getDBO();
+
+ $and = null;
+ if ($this->_state->get('filter.client') < 0) {
+ if ($search = $this->_state->get('filter.string')) {
+ $and = ' AND title LIKE '.$db->Quote( '%'.$db->getEscaped( $search, true ).'%', false );
+ }
+ } else {
+ if ($search = $this->_state->get('filter.string'))
+ {
+ $and = ' AND client_id = '.(int)$this->_state->get('filter.client');
+ $and .= ' AND title LIKE '.$db->Quote( '%'.$db->getEscaped( $search, true ).'%', false );
+ }
+ else {
+ $and = ' AND client_id = '.(int)$this->_state->get('filter.client');
+ }
+ }
+
+ $query = 'SELECT id, module, client_id, title, iscore' .
+ ' FROM #__modules' .
+ ' WHERE module LIKE "mod_%" ' .
+ $and .
+ ' GROUP BY module, client_id' .
+ ' ORDER BY iscore, client_id, module';
+ $db->setQuery($query);
+ $rows = $db->loadObjectList();
+
+ $n = count($rows);
+ for ($i = 0; $i < $n; $i ++) {
+ $row = & $rows[$i];
+
+ // path to module directory
+ if ($row->client_id == "1") {
+ $moduleBaseDir = JPATH_ADMINISTRATOR.DS."modules";
+ } else {
+ $moduleBaseDir = JPATH_SITE.DS."modules";
+ }
+
+ // xml file for module
+ $xmlfile = $moduleBaseDir . DS . $row->module .DS. $row->module.".xml";
+
+ if (file_exists($xmlfile))
+ {
+ if ($data = JApplicationHelper::parseXMLInstallFile($xmlfile)) {
+ foreach($data as $key => $value) {
+ $row->$key = $value;
+ }
+ }
+ }
+ }
+ $this->setState('pagination.total', $n);
+ // if the offset is greater than the total, then can the offset
+ if($this->_state->get('pagination.offset') > $this->_state->get('pagination.total')) {
+ $this->setState('pagination.offset',0);
+ }
+
+ if($this->_state->get('pagination.limit') > 0) {
+ $this->_items = array_slice( $rows, $this->_state->get('pagination.offset'), $this->_state->get('pagination.limit') );
+ } else {
+ $this->_items = $rows;
+ }
+ }
+}
\ No newline at end of file
diff --git a/oss/joomla/trunk/administrator/components/com_installer/models/plugins.php b/oss/joomla/trunk/administrator/components/com_installer/models/plugins.php
new file mode 100644
index 00000000..2bcfc077
--- /dev/null
+++ b/oss/joomla/trunk/administrator/components/com_installer/models/plugins.php
@@ -0,0 +1,132 @@
+setState('filter.group', $mainframe->getUserStateFromRequest( "com_installer.plugins.group", 'group', '', 'cmd' ));
+ $this->setState('filter.string', $mainframe->getUserStateFromRequest( "com_installer.plugins.string", 'filter', '', 'string' ));
+ }
+
+ function &getGroups()
+ {
+ // Get a database connector object
+ $db = &$this->getDBO();
+
+ // get list of Positions for dropdown filter
+ $query = 'SELECT folder AS value, folder AS text' .
+ ' FROM #__plugins' .
+ ' GROUP BY folder' .
+ ' ORDER BY folder';
+ $db->setQuery( $query );
+
+ $types[] = JHTML::_('select.option', '', JText::_( 'All' ) );
+ $types = array_merge( $types, $db->loadObjectList() );
+
+ return $types;
+ }
+
+ function _loadItems()
+ {
+ global $mainframe, $option;
+
+ // Get a database connector
+ $db = & JFactory::getDBO();
+
+ $where = null;
+ if ($this->_state->get('filter.group')) {
+ if ($search = $this->_state->get('filter.string'))
+ {
+ $where = ' WHERE folder = "'.$db->getEscaped($this->_state->get('filter.group')).'"';
+ $where .= ' AND name LIKE '.$db->Quote( '%'.$db->getEscaped( $search, true ).'%', false );
+ }
+ else {
+ $where = ' WHERE folder = "'.$db->getEscaped($this->_state->get('filter.group')).'"';
+ }
+ } else {
+ if ($search = $this->_state->get('filter.string')) {
+ $where .= ' WHERE name LIKE '.$db->Quote( '%'.$db->getEscaped( $search, true ).'%', false );
+ }
+ }
+
+ $query = 'SELECT id, name, folder, element, client_id, iscore' .
+ ' FROM #__plugins' .
+ $where .
+ ' ORDER BY iscore, folder, name';
+ $db->setQuery($query);
+ $rows = $db->loadObjectList();
+
+ // Get the plugin base path
+ $baseDir = JPATH_ROOT.DS.'plugins';
+
+ $numRows = count($rows);
+ for ($i = 0; $i < $numRows; $i ++) {
+ $row = & $rows[$i];
+
+ // Get the plugin xml file
+ $xmlfile = $baseDir.DS.$row->folder.DS.$row->element.".xml";
+
+ if (file_exists($xmlfile)) {
+ if ($data = JApplicationHelper::parseXMLInstallFile($xmlfile)) {
+ foreach($data as $key => $value)
+ {
+ $row->$key = $value;
+ }
+ }
+ }
+ }
+
+ $this->setState('pagination.total', $numRows);
+ // if the offset is greater than the total, then can the offset
+ if($this->_state->get('pagination.offset') > $this->_state->get('pagination.total')) {
+ $this->setState('pagination.offset',0);
+ }
+
+ if($this->_state->get('pagination.limit') > 0) {
+ $this->_items = array_slice( $rows, $this->_state->get('pagination.offset'), $this->_state->get('pagination.limit') );
+ } else {
+ $this->_items = $rows;
+ }
+ }
+}
\ No newline at end of file
diff --git a/oss/joomla/trunk/administrator/components/com_installer/models/templates.php b/oss/joomla/trunk/administrator/components/com_installer/models/templates.php
new file mode 100644
index 00000000..ef8315bc
--- /dev/null
+++ b/oss/joomla/trunk/administrator/components/com_installer/models/templates.php
@@ -0,0 +1,173 @@
+setState('filter.string', $mainframe->getUserStateFromRequest( "com_installer.templates.string", 'filter', '', 'string' ));
+ $this->setState('filter.client', $mainframe->getUserStateFromRequest( "com_installer.templates.client", 'client', -1, 'int' ));
+ }
+
+ function _loadItems()
+ {
+ global $mainframe, $option;
+
+ $db = &JFactory::getDBO();
+
+ if ($this->_state->get('filter.client') < 0) {
+ $client = 'all';
+ // Get the site templates
+ $templateDirs = JFolder::folders(JPATH_SITE.DS.'templates');
+
+ for ($i=0; $i < count($templateDirs); $i++) {
+ $template = new stdClass();
+ $template->folder = $templateDirs[$i];
+ $template->client = 0;
+ $template->baseDir = JPATH_SITE.DS.'templates';
+
+ if ($this->_state->get('filter.string')) {
+ if (strpos($template->folder, $this->_state->get('filter.string')) !== false) {
+ $templates[] = $template;
+ }
+ } else {
+ $templates[] = $template;
+ }
+ }
+ // Get the admin templates
+ $templateDirs = JFolder::folders(JPATH_ADMINISTRATOR.DS.'templates');
+
+ for ($i=0; $i < count($templateDirs); $i++) {
+ $template = new stdClass();
+ $template->folder = $templateDirs[$i];
+ $template->client = 1;
+ $template->baseDir = JPATH_ADMINISTRATOR.DS.'templates';
+
+ if ($this->_state->get('filter.string')) {
+ if (strpos($template->folder, $this->_state->get('filter.string')) !== false) {
+ $templates[] = $template;
+ }
+ } else {
+ $templates[] = $template;
+ }
+ }
+ } else {
+ $clientInfo =& JApplicationHelper::getClientInfo($this->_state->get('filter.client'));
+ $client = $clientInfo->name;
+ $templateDirs = JFolder::folders($clientInfo->path.DS.'templates');
+
+ for ($i=0; $i < count($templateDirs); $i++) {
+ $template = new stdClass();
+ $template->folder = $templateDirs[$i];
+ $template->client = $clientInfo->id;
+ $template->baseDir = $clientInfo->path.DS.'templates';
+
+ if ($this->_state->get('filter.string')) {
+ if (strpos($template->folder, $this->_state->get('filter.string')) !== false) {
+ $templates[] = $template;
+ }
+ } else {
+ $templates[] = $template;
+ }
+ }
+ }
+
+ // Get a list of the currently active templates
+ $query = 'SELECT template' .
+ ' FROM #__templates_menu' .
+ ' WHERE 1';
+ $db->setQuery($query);
+ $activeList = $db->loadResultArray();
+
+ $rows = array();
+ $rowid = 0;
+ // Check that the directory contains an xml file
+ foreach($templates as $template)
+ {
+ $dirName = $template->baseDir .DS. $template->folder;
+ $xmlFilesInDir = JFolder::files($dirName,'.xml$');
+
+ foreach($xmlFilesInDir as $xmlfile)
+ {
+ $data = JApplicationHelper::parseXMLInstallFile($dirName . DS. $xmlfile);
+
+ $row = new StdClass();
+ $row->id = $rowid;
+ $row->client_id = $template->client;
+ $row->directory = $template->folder;
+ $row->baseDir = $template->baseDir;
+
+ // Is the template active?
+ if (in_array($row->directory, $activeList)) {
+ $row->active = true;
+ } else {
+ $row->active = false;
+ }
+
+ if ($data) {
+ foreach($data as $key => $value) {
+ $row->$key = $value;
+ }
+ }
+
+ $row->checked_out = 0;
+ $row->jname = JString::strtolower( str_replace( ' ', '_', $row->name ) );
+
+ $rows[] = $row;
+ $rowid++;
+ }
+ }
+ $this->setState('pagination.total', count($rows));
+ // if the offset is greater than the total, then can the offset
+ if($this->_state->get('pagination.offset') > $this->_state->get('pagination.total')) {
+ $this->setState('pagination.offset',0);
+ }
+
+ if($this->_state->get('pagination.limit') > 0) {
+ $this->_items = array_slice( $rows, $this->_state->get('pagination.offset'), $this->_state->get('pagination.limit') );
+ } else {
+ $this->_items = $rows;
+ }
+ }
+}
\ No newline at end of file
diff --git a/oss/joomla/trunk/administrator/components/com_installer/views/components/index.html b/oss/joomla/trunk/administrator/components/com_installer/views/components/index.html
new file mode 100644
index 00000000..fa6d84e8
--- /dev/null
+++ b/oss/joomla/trunk/administrator/components/com_installer/views/components/index.html
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/oss/joomla/trunk/administrator/components/com_installer/views/components/tmpl/default.php b/oss/joomla/trunk/administrator/components/com_installer/views/components/tmpl/default.php
new file mode 100644
index 00000000..b53cb033
--- /dev/null
+++ b/oss/joomla/trunk/administrator/components/com_installer/views/components/tmpl/default.php
@@ -0,0 +1,48 @@
+
+
\ No newline at end of file
diff --git a/oss/joomla/trunk/administrator/components/com_installer/views/components/tmpl/default_item.php b/oss/joomla/trunk/administrator/components/com_installer/views/components/tmpl/default_item.php
new file mode 100644
index 00000000..b02c5ef3
--- /dev/null
+++ b/oss/joomla/trunk/administrator/components/com_installer/views/components/tmpl/default_item.php
@@ -0,0 +1,28 @@
+
+item->index % 2; ?>" item->style; ?>>
+ | pagination->getRowOffset( $this->item->index ); ?> |
+
+ item->cbd; ?> />
+ item->name; ?>
+ |
+
+ item->option) : ?>
+ X
+
+
+
+ |
+ item->version != '' ? $this->item->version : ' '; ?> |
+ item->creationdate != '' ? $this->item->creationdate : ' '; ?> |
+
+
+ item->author != '' ? $this->item->author : ' '; ?>
+
+ |
+
+
+
+
+ |
+
diff --git a/oss/joomla/trunk/administrator/components/com_installer/views/components/tmpl/index.html b/oss/joomla/trunk/administrator/components/com_installer/views/components/tmpl/index.html
new file mode 100644
index 00000000..fa6d84e8
--- /dev/null
+++ b/oss/joomla/trunk/administrator/components/com_installer/views/components/tmpl/index.html
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/oss/joomla/trunk/administrator/components/com_installer/views/components/view.php b/oss/joomla/trunk/administrator/components/com_installer/views/components/view.php
new file mode 100644
index 00000000..d8baeb14
--- /dev/null
+++ b/oss/joomla/trunk/administrator/components/com_installer/views/components/view.php
@@ -0,0 +1,69 @@
+get('State');
+ $items = &$this->get('Items');
+ $pagination = &$this->get('Pagination');
+
+ $this->assignRef('items', $items);
+ $this->assignRef('pagination', $pagination);
+
+ parent::display($tpl);
+ }
+
+ function loadItem($index=0)
+ {
+ $item =& $this->items[$index];
+ $item->index = $index;
+ $item->img = $item->enabled ? 'tick.png' : 'publish_x.png';
+ $item->task = $item->enabled ? 'disable' : 'enable';
+ $item->alt = $item->enabled ? JText::_( 'Enabled' ) : JText::_( 'Disabled' );
+ $item->action = $item->enabled ? JText::_( 'disable' ) : JText::_( 'enable' );
+
+ if ($item->iscore) {
+ $item->cbd = 'disabled';
+ $item->style = 'style="color:#999999;"';
+ } else {
+ $item->cbd = null;
+ $item->style = null;
+ }
+ $item->author_info = @$item->authorEmail .'
'. @$item->authorUrl;
+
+ $this->assignRef('item', $item);
+ }
+}
diff --git a/oss/joomla/trunk/administrator/components/com_installer/views/default/index.html b/oss/joomla/trunk/administrator/components/com_installer/views/default/index.html
new file mode 100644
index 00000000..fa6d84e8
--- /dev/null
+++ b/oss/joomla/trunk/administrator/components/com_installer/views/default/index.html
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/oss/joomla/trunk/administrator/components/com_installer/views/default/tmpl/default_ftp.php b/oss/joomla/trunk/administrator/components/com_installer/views/default/tmpl/default_ftp.php
new file mode 100644
index 00000000..a5565d38
--- /dev/null
+++ b/oss/joomla/trunk/administrator/components/com_installer/views/default/tmpl/default_ftp.php
@@ -0,0 +1,33 @@
+
+
\ No newline at end of file
diff --git a/oss/joomla/trunk/administrator/components/com_installer/views/default/tmpl/default_message.php b/oss/joomla/trunk/administrator/components/com_installer/views/default/tmpl/default_message.php
new file mode 100644
index 00000000..e602b55d
--- /dev/null
+++ b/oss/joomla/trunk/administrator/components/com_installer/views/default/tmpl/default_message.php
@@ -0,0 +1,20 @@
+get('State');
+ $message1 = $state->get('message');
+ $message2 = $state->get('extension.message');
+?>
+
diff --git a/oss/joomla/trunk/administrator/components/com_installer/views/default/tmpl/index.html b/oss/joomla/trunk/administrator/components/com_installer/views/default/tmpl/index.html
new file mode 100644
index 00000000..fa6d84e8
--- /dev/null
+++ b/oss/joomla/trunk/administrator/components/com_installer/views/default/tmpl/index.html
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/oss/joomla/trunk/administrator/components/com_installer/views/default/view.php b/oss/joomla/trunk/administrator/components/com_installer/views/default/view.php
new file mode 100644
index 00000000..308fb840
--- /dev/null
+++ b/oss/joomla/trunk/administrator/components/com_installer/views/default/view.php
@@ -0,0 +1,73 @@
+_addPath('template', $this->_basePath.DS.'views'.DS.'default'.DS.'tmpl');
+ }
+
+ function display($tpl=null)
+ {
+ /*
+ * Set toolbar items for the page
+ */
+ JToolBarHelper::title( JText::_( 'Extension Manager'), 'install.png' );
+
+ // Document
+ $document = & JFactory::getDocument();
+ $document->setTitle(JText::_('Extension Manager').' : '.JText::_( $this->getName() ));
+
+ // Get data from the model
+ $state = &$this->get('State');
+
+ // Are there messages to display ?
+ $showMessage = false;
+ if ( is_object($state) )
+ {
+ $message1 = $state->get('message');
+ $message2 = $state->get('extension.message');
+ $showMessage = ( $message1 || $message2 );
+ }
+
+ $this->assign('showMessage', $showMessage);
+ $this->assignRef('state', $state);
+
+ JHTML::_('behavior.tooltip');
+ parent::display($tpl);
+ }
+
+ /**
+ * Should be overloaded by extending view
+ *
+ * @param int $index
+ */
+ function loadItem($index=0)
+ {
+ }
+}
\ No newline at end of file
diff --git a/oss/joomla/trunk/administrator/components/com_installer/views/index.html b/oss/joomla/trunk/administrator/components/com_installer/views/index.html
new file mode 100644
index 00000000..fa6d84e8
--- /dev/null
+++ b/oss/joomla/trunk/administrator/components/com_installer/views/index.html
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/oss/joomla/trunk/administrator/components/com_installer/views/install/index.html b/oss/joomla/trunk/administrator/components/com_installer/views/install/index.html
new file mode 100644
index 00000000..fa6d84e8
--- /dev/null
+++ b/oss/joomla/trunk/administrator/components/com_installer/views/install/index.html
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/oss/joomla/trunk/administrator/components/com_installer/views/install/tmpl/default.php b/oss/joomla/trunk/administrator/components/com_installer/views/install/tmpl/default.php
new file mode 100644
index 00000000..7cf1cca6
--- /dev/null
+++ b/oss/joomla/trunk/administrator/components/com_installer/views/install/tmpl/default.php
@@ -0,0 +1,6 @@
+
+showMessage) : ?>
+loadTemplate('message'); ?>
+
+loadTemplate('form'); ?>
diff --git a/oss/joomla/trunk/administrator/components/com_installer/views/install/tmpl/default_form.php b/oss/joomla/trunk/administrator/components/com_installer/views/install/tmpl/default_form.php
new file mode 100644
index 00000000..f10e9cb6
--- /dev/null
+++ b/oss/joomla/trunk/administrator/components/com_installer/views/install/tmpl/default_form.php
@@ -0,0 +1,87 @@
+
+
+
+
\ No newline at end of file
diff --git a/oss/joomla/trunk/administrator/components/com_installer/views/install/tmpl/index.html b/oss/joomla/trunk/administrator/components/com_installer/views/install/tmpl/index.html
new file mode 100644
index 00000000..fa6d84e8
--- /dev/null
+++ b/oss/joomla/trunk/administrator/components/com_installer/views/install/tmpl/index.html
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/oss/joomla/trunk/administrator/components/com_installer/views/install/view.php b/oss/joomla/trunk/administrator/components/com_installer/views/install/view.php
new file mode 100644
index 00000000..df2bd529
--- /dev/null
+++ b/oss/joomla/trunk/administrator/components/com_installer/views/install/view.php
@@ -0,0 +1,46 @@
+first = '';
+
+ $this->assignRef('paths', $paths);
+ $this->assignRef('state', $this->get('state'));
+
+ parent::display($tpl);
+ }
+
+}
\ No newline at end of file
diff --git a/oss/joomla/trunk/administrator/components/com_installer/views/languages/index.html b/oss/joomla/trunk/administrator/components/com_installer/views/languages/index.html
new file mode 100644
index 00000000..fa6d84e8
--- /dev/null
+++ b/oss/joomla/trunk/administrator/components/com_installer/views/languages/index.html
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/oss/joomla/trunk/administrator/components/com_installer/views/languages/tmpl/default.php b/oss/joomla/trunk/administrator/components/com_installer/views/languages/tmpl/default.php
new file mode 100644
index 00000000..33e97337
--- /dev/null
+++ b/oss/joomla/trunk/administrator/components/com_installer/views/languages/tmpl/default.php
@@ -0,0 +1,52 @@
+
+
\ No newline at end of file
diff --git a/oss/joomla/trunk/administrator/components/com_installer/views/languages/tmpl/default_item.php b/oss/joomla/trunk/administrator/components/com_installer/views/languages/tmpl/default_item.php
new file mode 100644
index 00000000..a57264d5
--- /dev/null
+++ b/oss/joomla/trunk/administrator/components/com_installer/views/languages/tmpl/default_item.php
@@ -0,0 +1,19 @@
+
+item->index % 2; ?>" item->style; ?>>
+ | pagination->getRowOffset( $this->item->index ); ?> |
+
+ item->cbd; ?> />
+ item->name; ?>
+ |
+
+ item->client_id == "0" ? JText::_( 'Site' ) : JText::_( 'Admin' ); ?>
+ |
+ item->version != '' ? $this->item->version : ' '; ?> |
+ item->creationdate != '' ? $this->item->creationdate : ' '; ?> |
+
+
+ item->author != '' ? $this->item->author : ' '; ?>
+
+ |
+
diff --git a/oss/joomla/trunk/administrator/components/com_installer/views/languages/tmpl/index.html b/oss/joomla/trunk/administrator/components/com_installer/views/languages/tmpl/index.html
new file mode 100644
index 00000000..fa6d84e8
--- /dev/null
+++ b/oss/joomla/trunk/administrator/components/com_installer/views/languages/tmpl/index.html
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/oss/joomla/trunk/administrator/components/com_installer/views/languages/view.php b/oss/joomla/trunk/administrator/components/com_installer/views/languages/view.php
new file mode 100644
index 00000000..2257833d
--- /dev/null
+++ b/oss/joomla/trunk/administrator/components/com_installer/views/languages/view.php
@@ -0,0 +1,73 @@
+get('State');
+ $items = &$this->get('Items');
+ $pagination = &$this->get('Pagination');
+
+ $lists = new stdClass();
+ $select[] = JHTML::_('select.option', '-1', JText::_('All'));
+ $select[] = JHTML::_('select.option', '0', JText::_('Site Languages'));
+ $select[] = JHTML::_('select.option', '1', JText::_('Admin Languages'));
+ $lists->client = JHTML::_('select.genericlist', $select, 'client', 'class="inputbox" size="1" onchange="document.adminForm.submit();"', 'value', 'text', $state->get('filter.client'));
+
+ $this->assignRef('items', $items);
+ $this->assignRef('pagination', $pagination);
+ $this->assignRef('lists', $lists);
+
+ parent::display($tpl);
+ }
+
+ function loadItem($index=0)
+ {
+ $item =& $this->items[$index];
+ $item->index = $index;
+
+ if ($item->published) {
+ $item->cbd = 'disabled';
+ $item->style = 'style="color:#999999;"';
+ } else {
+ $item->cbd = null;
+ $item->style = null;
+ }
+ $item->author_info = @$item->authorEmail .'
'. @$item->authorUrl;
+
+ $this->assignRef('item', $item);
+ }
+}
diff --git a/oss/joomla/trunk/administrator/components/com_installer/views/modules/index.html b/oss/joomla/trunk/administrator/components/com_installer/views/modules/index.html
new file mode 100644
index 00000000..fa6d84e8
--- /dev/null
+++ b/oss/joomla/trunk/administrator/components/com_installer/views/modules/index.html
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/oss/joomla/trunk/administrator/components/com_installer/views/modules/tmpl/default.php b/oss/joomla/trunk/administrator/components/com_installer/views/modules/tmpl/default.php
new file mode 100644
index 00000000..ff0f0629
--- /dev/null
+++ b/oss/joomla/trunk/administrator/components/com_installer/views/modules/tmpl/default.php
@@ -0,0 +1,53 @@
+
+
\ No newline at end of file
diff --git a/oss/joomla/trunk/administrator/components/com_installer/views/modules/tmpl/default_item.php b/oss/joomla/trunk/administrator/components/com_installer/views/modules/tmpl/default_item.php
new file mode 100644
index 00000000..2f0ea3ac
--- /dev/null
+++ b/oss/joomla/trunk/administrator/components/com_installer/views/modules/tmpl/default_item.php
@@ -0,0 +1,24 @@
+
+item->index % 2; ?>" item->style; ?>>
+ | pagination->getRowOffset( $this->item->index ); ?> |
+
+ item->cbd; ?> />
+ item->module; ?>
+ |
+
+ item->client_id == "0" ? JText::_( 'Site' ) : JText::_( 'Admin' ); ?>
+ |
+ item->version != '' ? $this->item->version : ' '; ?> |
+ item->creationdate != '' ? $this->item->creationdate : ' '; ?> |
+
+
+ item->author != '' ? $this->item->author : ' '; ?>
+
+ |
+
+
+
+
+ |
+
diff --git a/oss/joomla/trunk/administrator/components/com_installer/views/modules/tmpl/index.html b/oss/joomla/trunk/administrator/components/com_installer/views/modules/tmpl/index.html
new file mode 100644
index 00000000..fa6d84e8
--- /dev/null
+++ b/oss/joomla/trunk/administrator/components/com_installer/views/modules/tmpl/index.html
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/oss/joomla/trunk/administrator/components/com_installer/views/modules/view.php b/oss/joomla/trunk/administrator/components/com_installer/views/modules/view.php
new file mode 100644
index 00000000..983f9480
--- /dev/null
+++ b/oss/joomla/trunk/administrator/components/com_installer/views/modules/view.php
@@ -0,0 +1,75 @@
+get('State');
+ $items = &$this->get('Items');
+ $pagination = &$this->get('Pagination');
+
+ $lists = new stdClass();
+ $select[] = JHTML::_('select.option', '-1', JText::_('All'));
+ $select[] = JHTML::_('select.option', '0', JText::_('Site Modules'));
+ $select[] = JHTML::_('select.option', '1', JText::_('Admin Modules'));
+ $lists->client = JHTML::_('select.genericlist', $select, 'client', 'class="inputbox" size="1" onchange="document.adminForm.submit();"', 'value', 'text', $state->get('filter.client'));
+
+ $this->assignRef('items', $items);
+ $this->assignRef('pagination', $pagination);
+ $this->assignRef('lists', $lists);
+
+ JHTML::_('behavior.tooltip');
+ parent::display($tpl);
+ }
+
+ function loadItem($index=0)
+ {
+ $item =& $this->items[$index];
+ $item->index = $index;
+
+ if ($item->iscore) {
+ $item->cbd = 'disabled';
+ $item->style = 'style="color:#999999;"';
+ } else {
+ $item->cbd = null;
+ $item->style = null;
+ }
+ $item->author_info = @$item->authorEmail .'
'. @$item->authorUrl;
+
+ $this->assignRef('item', $item);
+ }
+}
diff --git a/oss/joomla/trunk/administrator/components/com_installer/views/plugins/index.html b/oss/joomla/trunk/administrator/components/com_installer/views/plugins/index.html
new file mode 100644
index 00000000..fa6d84e8
--- /dev/null
+++ b/oss/joomla/trunk/administrator/components/com_installer/views/plugins/index.html
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/oss/joomla/trunk/administrator/components/com_installer/views/plugins/tmpl/default.php b/oss/joomla/trunk/administrator/components/com_installer/views/plugins/tmpl/default.php
new file mode 100644
index 00000000..171c3001
--- /dev/null
+++ b/oss/joomla/trunk/administrator/components/com_installer/views/plugins/tmpl/default.php
@@ -0,0 +1,53 @@
+
+
\ No newline at end of file
diff --git a/oss/joomla/trunk/administrator/components/com_installer/views/plugins/tmpl/default_item.php b/oss/joomla/trunk/administrator/components/com_installer/views/plugins/tmpl/default_item.php
new file mode 100644
index 00000000..647c96a2
--- /dev/null
+++ b/oss/joomla/trunk/administrator/components/com_installer/views/plugins/tmpl/default_item.php
@@ -0,0 +1,22 @@
+
+item->index % 2; ?>" item->style; ?>>
+ | pagination->getRowOffset( $this->item->index ); ?> |
+
+ item->cbd; ?> />
+ item->name; ?>
+ |
+ item->folder; ?> |
+ item->legacy) echo 'class="legacy-mode"'; ?>>item->version != '' ? $this->item->version : ' '; ?> |
+ item->creationdate != '' ? $this->item->creationdate : ' '; ?> |
+
+
+ item->author != '' ? $this->item->author : ' '; ?>
+
+ |
+
+
+
+
+ |
+
diff --git a/oss/joomla/trunk/administrator/components/com_installer/views/plugins/tmpl/index.html b/oss/joomla/trunk/administrator/components/com_installer/views/plugins/tmpl/index.html
new file mode 100644
index 00000000..fa6d84e8
--- /dev/null
+++ b/oss/joomla/trunk/administrator/components/com_installer/views/plugins/tmpl/index.html
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/oss/joomla/trunk/administrator/components/com_installer/views/plugins/view.php b/oss/joomla/trunk/administrator/components/com_installer/views/plugins/view.php
new file mode 100644
index 00000000..1f882abd
--- /dev/null
+++ b/oss/joomla/trunk/administrator/components/com_installer/views/plugins/view.php
@@ -0,0 +1,71 @@
+get('State');
+ $items = &$this->get('Items');
+ $pagination = &$this->get('Pagination');
+ $groups = &$this->get('Groups');
+
+ $fields = new stdClass();
+ $fields->groups = JHTML::_('select.genericlist', $groups, 'group', 'class="inputbox" size="1" onchange="document.adminForm.submit( );"', 'value', 'text', $state->get('filter.group') );
+
+ $this->assignRef('items', $items);
+ $this->assignRef('pagination', $pagination);
+ $this->assignRef('fields', $fields);
+
+ parent::display($tpl);
+ }
+
+ function loadItem($index=0)
+ {
+ $item =& $this->items[$index];
+ $item->index = $index;
+
+ if ($item->iscore) {
+ $item->cbd = 'disabled';
+ $item->style = 'style="color:#999999;"';
+ } else {
+ $item->cbd = null;
+ $item->style = null;
+ }
+ $item->author_info = @$item->authorEmail .'
'. @$item->authorUrl;
+
+ $this->assignRef('item', $item);
+ }
+}
diff --git a/oss/joomla/trunk/administrator/components/com_installer/views/templates/index.html b/oss/joomla/trunk/administrator/components/com_installer/views/templates/index.html
new file mode 100644
index 00000000..fa6d84e8
--- /dev/null
+++ b/oss/joomla/trunk/administrator/components/com_installer/views/templates/index.html
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/oss/joomla/trunk/administrator/components/com_installer/views/templates/tmpl/default.php b/oss/joomla/trunk/administrator/components/com_installer/views/templates/tmpl/default.php
new file mode 100644
index 00000000..b738eea3
--- /dev/null
+++ b/oss/joomla/trunk/administrator/components/com_installer/views/templates/tmpl/default.php
@@ -0,0 +1,52 @@
+
+
\ No newline at end of file
diff --git a/oss/joomla/trunk/administrator/components/com_installer/views/templates/tmpl/default_item.php b/oss/joomla/trunk/administrator/components/com_installer/views/templates/tmpl/default_item.php
new file mode 100644
index 00000000..d72d7a0b
--- /dev/null
+++ b/oss/joomla/trunk/administrator/components/com_installer/views/templates/tmpl/default_item.php
@@ -0,0 +1,24 @@
+
+item->index % 2; ?>" item->style; ?>>
+ | pagination->getRowOffset( $this->item->index ); ?> |
+
+ item->cbd; ?> />
+ item->name; ?>
+ |
+
+ item->client_id == "0" ? JText::_( 'Site' ) : JText::_( 'Admin' ); ?>
+ |
+ item->legacy) echo 'class="legacy-mode"'; ?>>item->version != '' ? $this->item->version : ' '; ?> |
+ item->creationdate != '' ? $this->item->creationdate : ' '; ?> |
+
+
+ item->author != '' ? $this->item->author : ' '; ?>
+
+ |
+
+
+
+
+ |
+
diff --git a/oss/joomla/trunk/administrator/components/com_installer/views/templates/tmpl/index.html b/oss/joomla/trunk/administrator/components/com_installer/views/templates/tmpl/index.html
new file mode 100644
index 00000000..fa6d84e8
--- /dev/null
+++ b/oss/joomla/trunk/administrator/components/com_installer/views/templates/tmpl/index.html
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/oss/joomla/trunk/administrator/components/com_installer/views/templates/view.php b/oss/joomla/trunk/administrator/components/com_installer/views/templates/view.php
new file mode 100644
index 00000000..170d1f4a
--- /dev/null
+++ b/oss/joomla/trunk/administrator/components/com_installer/views/templates/view.php
@@ -0,0 +1,73 @@
+get('State');
+ $items = &$this->get('Items');
+ $pagination = &$this->get('Pagination');
+
+ $lists = new stdClass();
+ $select[] = JHTML::_('select.option', '-1', JText::_('All'));
+ $select[] = JHTML::_('select.option', '0', JText::_('Site Templates'));
+ $select[] = JHTML::_('select.option', '1', JText::_('Admin Templates'));
+ $lists->client = JHTML::_('select.genericlist', $select, 'client', 'class="inputbox" size="1" onchange="document.adminForm.submit();"', 'value', 'text', $state->get('filter.client'));
+
+ $this->assignRef('items', $items);
+ $this->assignRef('pagination', $pagination);
+ $this->assignRef('lists', $lists);
+
+ parent::display($tpl);
+ }
+
+ function loadItem($index=0)
+ {
+ $item =& $this->items[$index];
+ $item->id = $item->directory;
+ $item->index = $index;
+
+ if ($item->active) {
+ $item->cbd = 'disabled';
+ $item->style = 'style="color:#999999;"';
+ } else {
+ $item->cbd = null;
+ $item->style = null;
+ }
+ $item->author_information = @$item->authorEmail .'
'. @$item->authorUrl;
+
+ $this->assignRef('item', $item);
+ }
+}