添加到 trunk
+YUCHENG HU+ git-svn-id: https://svn.code.sf.net/p/hawebs/svn@326 a2543c7e-f6e9-4f8a-8bff-1ffc34733512
This commit is contained in:
@@ -0,0 +1,107 @@
|
||||
<?php
|
||||
/**
|
||||
* @version $Id: admin.checkin.php 10381 2008-06-01 03:35:53Z pasamio $
|
||||
* @package Joomla
|
||||
* @subpackage Checkin
|
||||
* @copyright Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved.
|
||||
* @license GNU/GPL, see LICENSE.php
|
||||
* Joomla! is free software. This version may have been modified pursuant
|
||||
* to the GNU General Public License, and as distributed it includes or
|
||||
* is derivative of works licensed under the GNU General Public License or
|
||||
* other free or open source software licenses.
|
||||
* See COPYRIGHT.php for copyright notices and details.
|
||||
*/
|
||||
|
||||
// no direct access
|
||||
defined( '_JEXEC' ) or die( 'Restricted access' );
|
||||
|
||||
// Make sure the user is authorized to view this page
|
||||
|
||||
$user = & JFactory::getUser();
|
||||
if (!$user->authorize( 'com_checkin', 'manage' )) {
|
||||
$mainframe->redirect( 'index.php', JText::_('ALERTNOTAUTH') );
|
||||
}
|
||||
$db =& JFactory::getDBO();
|
||||
$nullDate = $db->getNullDate();
|
||||
?>
|
||||
<div id="tablecell">
|
||||
<table class="adminform">
|
||||
<tr>
|
||||
<th class="title">
|
||||
<?php echo JText::_( 'Database Table' ); ?>
|
||||
</th>
|
||||
<th class="title">
|
||||
<?php echo JText::_( 'Num of Items' ); ?>
|
||||
</th>
|
||||
<th class="title">
|
||||
<?php echo JText::_( 'Checked-In' ); ?>
|
||||
</th>
|
||||
<th class="title">
|
||||
</th>
|
||||
</tr>
|
||||
<?php
|
||||
$tables = $db->getTableList();
|
||||
$k = 0;
|
||||
foreach ($tables as $tn) {
|
||||
// make sure we get the right tables based on prefix
|
||||
if (!preg_match( "/^".$mainframe->getCfg('dbprefix')."/i", $tn )) {
|
||||
continue;
|
||||
}
|
||||
$fields = $db->getTableFields( array( $tn ) );
|
||||
|
||||
$foundCO = false;
|
||||
$foundCOT = false;
|
||||
$foundE = false;
|
||||
|
||||
$foundCO = isset( $fields[$tn]['checked_out'] );
|
||||
$foundCOT = isset( $fields[$tn]['checked_out_time'] );
|
||||
$foundE = isset( $fields[$tn]['editor'] );
|
||||
|
||||
if ($foundCO && $foundCOT) {
|
||||
if ($foundE) {
|
||||
$query = 'SELECT checked_out, editor FROM '.$tn.' WHERE checked_out > 0';
|
||||
} else {
|
||||
$query = 'SELECT checked_out FROM '.$tn.' WHERE checked_out > 0';
|
||||
}
|
||||
$db->setQuery( $query );
|
||||
$res = $db->query();
|
||||
$num = $db->getNumRows( $res );
|
||||
|
||||
if ($foundE) {
|
||||
$query = 'UPDATE '.$tn.' SET checked_out = 0, checked_out_time = '.$db->Quote($nullDate).', editor = NULL WHERE checked_out > 0';
|
||||
} else {
|
||||
$query = 'UPDATE '.$tn.' SET checked_out = 0, checked_out_time = '.$db->Quote($nullDate).' WHERE checked_out > 0';
|
||||
}
|
||||
$db->setQuery( $query );
|
||||
$res = $db->query();
|
||||
|
||||
if ($res == 1) {
|
||||
if ($num > 0) {
|
||||
echo "<tr class=\"row$k\">";
|
||||
echo "\n <td width=\"350\">". JText::_( 'Checking table' ) ." - ". $tn ."</td>";
|
||||
echo "\n <td width=\"150\">". JText::_( 'Checked-In' ) ." <b>". $num ."</b> ". JText::_( 'items' ) ."</td>";
|
||||
echo "\n <td width=\"100\" align=\"center\"><img src=\"images/tick.png\" border=\"0\" alt=\"". JText::_( 'tick' ) ."\" /></td>";
|
||||
echo "\n <td> </td>";
|
||||
echo "\n</tr>";
|
||||
} else {
|
||||
echo "<tr class=\"row$k\">";
|
||||
echo "\n <td width=\"350\">". JText::_( 'Checking table' ) ." - ". $tn ."</td>";
|
||||
echo "\n <td width=\"150\">". JText::_( 'Checked-In' ) ." <b>". $num ."</b> ". JText::_( 'items' ) ."</td>";
|
||||
echo "\n <td width=\"100\"> </td>";
|
||||
echo "\n <td> </td>";
|
||||
echo "\n</tr>";
|
||||
}
|
||||
$k = 1 - $k;
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
<tr>
|
||||
<td colspan="4">
|
||||
<strong>
|
||||
<?php echo JText::_( 'Checked out items have now been all checked in' ); ?>
|
||||
</strong>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
@@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
||||
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
/**
|
||||
* @version $Id: toolbar.checkin.html.php 10381 2008-06-01 03:35:53Z pasamio $
|
||||
* @package Joomla
|
||||
* @subpackage Checkin
|
||||
* @copyright Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved.
|
||||
* @license GNU/GPL, see LICENSE.php
|
||||
* Joomla! is free software. This version may have been modified pursuant
|
||||
* to the GNU General Public License, and as distributed it includes or
|
||||
* is derivative of works licensed under the GNU General Public License or
|
||||
* other free or open source software licenses.
|
||||
* See COPYRIGHT.php for copyright notices and details.
|
||||
*/
|
||||
|
||||
// no direct access
|
||||
defined( '_JEXEC' ) or die( 'Restricted access' );
|
||||
|
||||
/**
|
||||
* @package Joomla
|
||||
* @subpackage Checkin
|
||||
*/
|
||||
class TOOLBAR_checkin {
|
||||
/**
|
||||
* Draws the menu for a New category
|
||||
*/
|
||||
function _DEFAULT() {
|
||||
|
||||
JToolBarHelper::title( JText::_( 'Global Check-in' ), 'checkin.png' );
|
||||
JToolBarHelper::help( 'screen.checkin' );
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
/**
|
||||
* @version $Id: toolbar.checkin.php 10381 2008-06-01 03:35:53Z pasamio $
|
||||
* @package Joomla
|
||||
* @subpackage Checkin
|
||||
* @copyright Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved.
|
||||
* @license GNU/GPL, see LICENSE.php
|
||||
* Joomla! is free software. This version may have been modified pursuant
|
||||
* to the GNU General Public License, and as distributed it includes or
|
||||
* is derivative of works licensed under the GNU General Public License or
|
||||
* other free or open source software licenses.
|
||||
* See COPYRIGHT.php for copyright notices and details.
|
||||
*/
|
||||
|
||||
// no direct access
|
||||
defined( '_JEXEC' ) or die( 'Restricted access' );
|
||||
|
||||
require_once( JApplicationHelper::getPath( 'toolbar_html' ) );
|
||||
|
||||
switch ($task){
|
||||
default:
|
||||
TOOLBAR_checkin::_DEFAULT();
|
||||
break;
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,61 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<config>
|
||||
<params>
|
||||
<param name="contact_icons" type="list" default="0" label="Icons/text" description="PARAMCONTACTICONS">
|
||||
<option value="0">Icons</option>
|
||||
<option value="1">Text</option>
|
||||
<option value="2">None</option>
|
||||
</param>
|
||||
<param name="icon_address" type="imagelist" directory="/images/M_images" hide_none="1" default="" label="Address Icon" description="Icon for the Address info" />
|
||||
<param name="icon_email" type="imagelist" directory="/images/M_images" hide_none="1" default="" label="Email Icon" description="Icon for the Email info" />
|
||||
<param name="icon_telephone" type="imagelist" directory="/images/M_images" hide_none="1" default="" label="Telephone Icon" description="Icon for the Telephone info" />
|
||||
<param name="icon_mobile" type="imagelist" directory="/images/M_images" hide_none="1" default="" label="Mobile Icon" description="Icon for the Mobile info" />
|
||||
<param name="icon_fax" type="imagelist" directory="/images/M_images" hide_none="1" default="" label="Fax Icon" description="Icon for the Fax info" />
|
||||
<param name="icon_misc" type="imagelist" directory="/images/M_images" hide_none="1" default="" label="Misc Icon" description="Icon for the Misc info" />
|
||||
|
||||
<param name="@spacer" type="spacer" default="" label="" description="" />
|
||||
<param name="show_headings" type="radio" default="1" label="Show Table Headings" description="Show/Hide the Table Headings">
|
||||
<option value="0">Hide</option>
|
||||
<option value="1">Show</option>
|
||||
</param>
|
||||
<param name="show_position" type="radio" default="1" label="Show Contact's Position" description="Show/Hide the Contact Position">
|
||||
<option value="0">Hide</option>
|
||||
<option value="1">Show</option>
|
||||
</param>
|
||||
<param name="show_email" type="radio" default="0" label="Show Email Address" description="Show/Hide the Email Address">
|
||||
<option value="0">Hide</option>
|
||||
<option value="1">Show</option>
|
||||
</param>
|
||||
<param name="show_telephone" type="radio" default="1" label="Show Phone Number" description="Show/Hide the Telephone Number">
|
||||
<option value="0">Hide</option>
|
||||
<option value="1">Show</option>
|
||||
</param>
|
||||
<param name="show_mobile" type="radio" default="1" label="Show Mobile Number" description="Show/Hide the Mobile Number">
|
||||
<option value="0">Hide</option>
|
||||
<option value="1">Show</option>
|
||||
</param>
|
||||
<param name="show_fax" type="radio" default="1" label="Show Fax Number" description="Show/Hide the Fax Number">
|
||||
<option value="0">Hide</option>
|
||||
<option value="1">Show</option>
|
||||
</param>
|
||||
|
||||
<param name="@spacer" type="spacer" default="" label="" description="" />
|
||||
<param name="allow_vcard" type="radio" default="0" label="Enable vcard" description="Enable vcard support for contacts">
|
||||
<option value="0">NO</option>
|
||||
<option value="1">YES</option>
|
||||
</param>
|
||||
|
||||
<param name="@spacer" type="spacer" default="" label="" description="" />
|
||||
<param name="banned_email" type="textarea" default="" label="BANNED EMAIL LABEL" rows="3" cols="30" description="BANNED EMAIL DESC" />
|
||||
<param name="banned_subject" type="textarea" default="" label="BANNED SUBJECT LABEL" rows="3" cols="30" description="BANNED SUBJECT DESC" />
|
||||
<param name="banned_text" type="textarea" default="" label="BANNED TEXT LABEL" rows="3" cols="30" description="BANNED TEXT DESC" />
|
||||
<param name="validate_session" type="radio" default="1" label="SESSION CHECK LABEL" description="SESSION CHECK DESC">
|
||||
<option value="0">NO</option>
|
||||
<option value="1">YES</option>
|
||||
</param>
|
||||
<param name="custom_reply" type="radio" default="0" label="Custom Reply" description="Custom Reply Desc">
|
||||
<option value="0">NO</option>
|
||||
<option value="1">YES</option>
|
||||
</param>
|
||||
</params>
|
||||
</config>
|
||||
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<install type="component" version="1.5.0">
|
||||
<name>Contact</name>
|
||||
<author>Joomla! Project</author>
|
||||
<copyright>Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved.</copyright>
|
||||
<creationDate>April 2006</creationDate>
|
||||
<license>http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL</license>
|
||||
<authorEmail>[email protected]</authorEmail>
|
||||
<authorUrl>www.joomla.org</authorUrl>
|
||||
<version>1.5.0</version>
|
||||
<description>This component shows a listing of Contact Information</description>
|
||||
</install>
|
||||
@@ -0,0 +1,101 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<install type="component" version="1.0.0">
|
||||
<name>Contact Items</name>
|
||||
<author>Joomla! Project</author>
|
||||
<creationDate>2006</creationDate>
|
||||
<copyright>Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved.</copyright>
|
||||
<license>http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL</license>
|
||||
<authorEmail>[email protected]</authorEmail>
|
||||
<authorUrl>www.joomla.org</authorUrl>
|
||||
<version>1.0.0</version>
|
||||
<description>Parameters for individual Contact Items</description>
|
||||
<params>
|
||||
<param name="show_name" type="radio" default="1" label="Name" description="Show/Hide the name info">
|
||||
<option value="0">Hide</option>
|
||||
<option value="1">Show</option>
|
||||
</param>
|
||||
<param name="show_position" type="radio" default="1" label="Contact's Position" description="Show/Hide the position info">
|
||||
<option value="0">Hide</option>
|
||||
<option value="1">Show</option>
|
||||
</param>
|
||||
<param name="show_email" type="radio" default="0" label="E-mail" description="PARAMEMAIL">
|
||||
<option value="0">Hide</option>
|
||||
<option value="1">Show</option>
|
||||
</param>
|
||||
<param name="show_street_address" type="radio" default="1" label="Street Address" description="Show/Hide the street address info">
|
||||
<option value="0">Hide</option>
|
||||
<option value="1">Show</option>
|
||||
</param>
|
||||
<param name="show_suburb" type="radio" default="1" label="Town/Suburb" description="Show/Hide the suburb info">
|
||||
<option value="0">Hide</option>
|
||||
<option value="1">Show</option>
|
||||
</param>
|
||||
<param name="show_state" type="radio" default="1" label="State/County" description="Show/Hide the state info">
|
||||
<option value="0">Hide</option>
|
||||
<option value="1">Show</option>
|
||||
</param>
|
||||
<param name="show_postcode" type="radio" default="1" label="Post/Zip Code" description="Show/Hide the post code info">
|
||||
<option value="0">Hide</option>
|
||||
<option value="1">Show</option>
|
||||
</param>
|
||||
<param name="show_country" type="radio" default="1" label="Country" description="Show/Hide the country info">
|
||||
<option value="0">Hide</option>
|
||||
<option value="1">Show</option>
|
||||
</param>
|
||||
<param name="show_telephone" type="radio" default="1" label="Telephone" description="Show/Hide the telephone info">
|
||||
<option value="0">Hide</option>
|
||||
<option value="1">Show</option>
|
||||
</param>
|
||||
<param name="show_mobile" type="radio" default="1" label="Mobile" description="Show/Hide the mobile info">
|
||||
<option value="0">Hide</option>
|
||||
<option value="1">Show</option>
|
||||
</param>
|
||||
<param name="show_fax" type="radio" default="1" label="Fax" description="Show/Hide the fax info">
|
||||
<option value="0">Hide</option>
|
||||
<option value="1">Show</option>
|
||||
</param>
|
||||
<param name="show_webpage" type="radio" default="1" label="Webpage" description="Show/Hide the webpage">
|
||||
<option value="0">Hide</option>
|
||||
<option value="1">Show</option>
|
||||
</param>
|
||||
<param name="show_misc" type="radio" default="1" label="Misc Info" description="Show/Hide the miscellaneous info">
|
||||
<option value="0">Hide</option>
|
||||
<option value="1">Show</option>
|
||||
</param>
|
||||
<param name="show_image" type="radio" default="1" label="Image" description="Show/Hide the image">
|
||||
<option value="0">Hide</option>
|
||||
<option value="1">Show</option>
|
||||
</param>
|
||||
<param name="allow_vcard" type="radio" default="0" label="vCard" description="Show/Hide VCard">
|
||||
<option value="0">Hide</option>
|
||||
<option value="1">Show</option>
|
||||
</param>
|
||||
</params>
|
||||
<params group="advanced">
|
||||
<param name="contact_icons" type="list" default="0" label="Icons/text" description="PARAMCONTACTICONS">
|
||||
<option value="0">Icons</option>
|
||||
<option value="1">Text</option>
|
||||
<option value="2">None</option>
|
||||
</param>
|
||||
<param name="icon_address" type="imagelist" directory="/images/M_images" hide_none="1" default="" label="Address Icon" description="Icon for the Address info" />
|
||||
<param name="icon_email" type="imagelist" directory="/images/M_images" hide_none="1" default="" label="Email Icon" description="Icon for the Email info" />
|
||||
<param name="icon_telephone" type="imagelist" directory="/images/M_images" hide_none="1" default="" label="Telephone Icon" description="Icon for the Telephone info" />
|
||||
<param name="icon_mobile" type="imagelist" directory="/images/M_images" hide_none="1" default="" label="Mobile Icon" description="Icon for the Mobile info" />
|
||||
<param name="icon_fax" type="imagelist" directory="/images/M_images" hide_none="1" default="" label="Fax Icon" description="Icon for the Fax info" />
|
||||
<param name="icon_misc" type="imagelist" directory="/images/M_images" hide_none="1" default="" label="Misc Icon" description="Icon for the Misc info" />
|
||||
</params>
|
||||
<params group="email">
|
||||
<param name="show_email_form" type="radio" default="1" label="Email Form" description="Show/Hide the email to form">
|
||||
<option value="0">Hide</option>
|
||||
<option value="1">Show</option>
|
||||
</param>
|
||||
<param name="email_description" type="text" size="30" default="" label="Description text" description="PARAMEMAILDESCTEXT" />
|
||||
<param name="show_email_copy" type="radio" default="1" label="Email Copy" description="PARAMEMAILCOPY">
|
||||
<option value="0">Hide</option>
|
||||
<option value="1">Show</option>
|
||||
</param>
|
||||
<param name="banned_email" type="textarea" default="" label="BANNED EMAIL LABEL" rows="3" cols="30" description="BANNED EMAIL DESC" />
|
||||
<param name="banned_subject" type="textarea" default="" label="BANNED SUBJECT LABEL" rows="3" cols="30" description="BANNED SUBJECT DESC" />
|
||||
<param name="banned_text" type="textarea" default="" label="BANNED TEXT LABEL" rows="3" cols="30" description="BANNED TEXT DESC" />
|
||||
</params>
|
||||
</install>
|
||||
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
/**
|
||||
* @version $Id: contact.php 10381 2008-06-01 03:35:53Z pasamio $
|
||||
* @package Joomla
|
||||
* @copyright Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved.
|
||||
* @license GNU/GPL, see LICENSE.php
|
||||
* Joomla! is free software. This version may have been modified pursuant
|
||||
* to the GNU General Public License, and as distributed it includes or
|
||||
* is derivative of works licensed under the GNU General Public License or
|
||||
* other free or open source software licenses.
|
||||
* See COPYRIGHT.php for copyright notices and details.
|
||||
*/
|
||||
|
||||
// Check to ensure this file is included in Joomla!
|
||||
defined('_JEXEC') or die( 'Restricted access' );
|
||||
|
||||
class JElementContact extends JElement
|
||||
{
|
||||
/**
|
||||
* Element name
|
||||
*
|
||||
* @access protected
|
||||
* @var string
|
||||
*/
|
||||
var $_name = 'Contact';
|
||||
|
||||
function fetchElement($name, $value, &$node, $control_name)
|
||||
{
|
||||
$db = &JFactory::getDBO();
|
||||
|
||||
$query = 'SELECT a.id, CONCAT( a.name, " - ",a.con_position ) AS text, a.catid '
|
||||
. ' FROM #__contact_details AS a'
|
||||
. ' INNER JOIN #__categories AS c ON a.catid = c.id'
|
||||
. ' WHERE a.published = 1'
|
||||
. ' AND c.published = 1'
|
||||
. ' ORDER BY a.catid, a.name'
|
||||
;
|
||||
$db->setQuery( $query );
|
||||
$options = $db->loadObjectList( );
|
||||
|
||||
return JHTML::_('select.genericlist', $options, ''.$control_name.'['.$name.']', 'class="inputbox"', 'id', 'text', $value, $control_name.$name );
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
||||
@@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
||||
@@ -0,0 +1,94 @@
|
||||
<?php
|
||||
/**
|
||||
* @version $Id: vcard.php 10381 2008-06-01 03:35:53Z pasamio $
|
||||
* @package Joomla
|
||||
* @subpackage Contact
|
||||
* @copyright Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved.
|
||||
* @license GNU/GPL, see LICENSE.php
|
||||
* Joomla! is free software. This version may have been modified pursuant to the
|
||||
* GNU General Public License, and as distributed it includes or is derivative
|
||||
* of works licensed under the GNU General Public License or other free or open
|
||||
* source software licenses. See COPYRIGHT.php for copyright notices and
|
||||
* details.
|
||||
*/
|
||||
|
||||
// no direct access
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
jimport('bitfolge.vcard');
|
||||
|
||||
/**
|
||||
* Class needed to extend vcard class and to correct minor errors
|
||||
*
|
||||
* @pacakge Joomla
|
||||
* @subpackage Contacts
|
||||
*/
|
||||
class JvCard extends vCard
|
||||
{
|
||||
// needed to fix bug in vcard class
|
||||
function setName( $family='', $first='', $additional='', $prefix='', $suffix='' ) {
|
||||
$this->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;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
||||
@@ -0,0 +1,119 @@
|
||||
<?php
|
||||
/**
|
||||
* @version $Id: contact.php 10381 2008-06-01 03:35:53Z pasamio $
|
||||
* @package Joomla
|
||||
* @subpackage Contact
|
||||
* @copyright Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved.
|
||||
* @license GNU/GPL, see LICENSE.php
|
||||
* Joomla! is free software. This version may have been modified pursuant to the
|
||||
* GNU General Public License, and as distributed it includes or is derivative
|
||||
* of works licensed under the GNU General Public License or other free or open
|
||||
* source software licenses. See COPYRIGHT.php for copyright notices and
|
||||
* details.
|
||||
*/
|
||||
|
||||
// Check to ensure this file is included in Joomla!
|
||||
defined('_JEXEC') or die( 'Restricted access' );
|
||||
|
||||
|
||||
/**
|
||||
* @package Joomla
|
||||
* @subpackage Contact
|
||||
*/
|
||||
class TableContact extends JTable
|
||||
{
|
||||
/** @var int Primary key */
|
||||
var $id = null;
|
||||
/** @var string */
|
||||
var $name = null;
|
||||
/** @var string */
|
||||
var $alias = null;
|
||||
/** @var string */
|
||||
var $con_position = null;
|
||||
/** @var string */
|
||||
var $address = null;
|
||||
/** @var string */
|
||||
var $suburb = null;
|
||||
/** @var string */
|
||||
var $state = null;
|
||||
/** @var string */
|
||||
var $country = null;
|
||||
/** @var string */
|
||||
var $postcode = null;
|
||||
/** @var string */
|
||||
var $telephone = null;
|
||||
/** @var string */
|
||||
var $fax = null;
|
||||
/** @var string */
|
||||
var $misc = null;
|
||||
/** @var string */
|
||||
var $image = null;
|
||||
/** @var string */
|
||||
var $imagepos = null;
|
||||
/** @var string */
|
||||
var $email_to = null;
|
||||
/** @var int */
|
||||
var $default_con = null;
|
||||
/** @var int */
|
||||
var $published = 0;
|
||||
/** @var int */
|
||||
var $checked_out = 0;
|
||||
/** @var datetime */
|
||||
var $checked_out_time = 0;
|
||||
/** @var int */
|
||||
var $ordering = null;
|
||||
/** @var string */
|
||||
var $params = null;
|
||||
/** @var int A link to a registered user */
|
||||
var $user_id = null;
|
||||
/** @var int A link to a category */
|
||||
var $catid = null;
|
||||
/** @var int */
|
||||
var $access = null;
|
||||
/** @var string Mobile phone number(s) */
|
||||
var $mobile = null;
|
||||
/** @var string */
|
||||
var $webpage = null;
|
||||
|
||||
/**
|
||||
* @param database A database connector object
|
||||
*/
|
||||
function __construct(&$db)
|
||||
{
|
||||
parent::__construct( '#__contact_details', 'id', $db );
|
||||
}
|
||||
|
||||
/**
|
||||
* Overloaded check function
|
||||
*
|
||||
* @access public
|
||||
* @return boolean
|
||||
* @see JTable::check
|
||||
* @since 1.5
|
||||
*/
|
||||
function check()
|
||||
{
|
||||
$this->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;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
||||
@@ -0,0 +1,59 @@
|
||||
<?php
|
||||
/**
|
||||
* @version $Id: toolbar.contact.html.php 10381 2008-06-01 03:35:53Z pasamio $
|
||||
* @package Joomla
|
||||
* @subpackage Contact
|
||||
* @copyright Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved.
|
||||
* @license GNU/GPL, see LICENSE.php
|
||||
* Joomla! is free software. This version may have been modified pursuant
|
||||
* to the GNU General Public License, and as distributed it includes or
|
||||
* is derivative of works licensed under the GNU General Public License or
|
||||
* other free or open source software licenses.
|
||||
* See COPYRIGHT.php for copyright notices and details.
|
||||
*/
|
||||
|
||||
// no direct access
|
||||
defined( '_JEXEC' ) or die( 'Restricted access' );
|
||||
|
||||
/**
|
||||
* @package Joomla
|
||||
* @subpackage Contact
|
||||
*/
|
||||
class TOOLBAR_contact
|
||||
{
|
||||
/**
|
||||
* Draws the menu for a New Contact
|
||||
*/
|
||||
function _EDIT($edit) {
|
||||
$cid = JRequest::getVar( 'cid', array(0), '', 'array' );
|
||||
|
||||
$text = ( $edit ? JText::_( 'Edit' ) : JText::_( 'New' ) );
|
||||
|
||||
JToolBarHelper::title( JText::_( 'Contact' ) .': <small><small>[ '. $text .' ]</small></small>', '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' );
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
/**
|
||||
* @version $Id: toolbar.contact.php 10381 2008-06-01 03:35:53Z pasamio $
|
||||
* @package Joomla
|
||||
* @subpackage Contact
|
||||
* @copyright Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved.
|
||||
* @license GNU/GPL, see LICENSE.php
|
||||
* Joomla! is free software. This version may have been modified pursuant
|
||||
* to the GNU General Public License, and as distributed it includes or
|
||||
* is derivative of works licensed under the GNU General Public License or
|
||||
* other free or open source software licenses.
|
||||
* See COPYRIGHT.php for copyright notices and details.
|
||||
*/
|
||||
|
||||
// no direct access
|
||||
defined( '_JEXEC' ) or die( 'Restricted access' );
|
||||
|
||||
require_once( JApplicationHelper::getPath( 'toolbar_html' ) );
|
||||
|
||||
switch ($task)
|
||||
{
|
||||
case 'add' :
|
||||
TOOLBAR_contact::_EDIT(false);
|
||||
break;
|
||||
case 'edit' :
|
||||
case 'editA':
|
||||
TOOLBAR_contact::_EDIT(true);
|
||||
break;
|
||||
|
||||
default:
|
||||
TOOLBAR_contact::_DEFAULT();
|
||||
break;
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
/**
|
||||
* @version $Id: admin.cpanel.html.php 10559 2008-07-16 20:57:43Z instance $
|
||||
* @package Joomla
|
||||
* @subpackage Admin
|
||||
* @copyright Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved.
|
||||
* @license GNU/GPL, see LICENSE.php
|
||||
* Joomla! is free software. This version may have been modified pursuant
|
||||
* to the GNU General Public License, and as distributed it includes or
|
||||
* is derivative of works licensed under the GNU General Public License or
|
||||
* other free or open source software licenses.
|
||||
* See COPYRIGHT.php for copyright notices and details.
|
||||
*/
|
||||
|
||||
// no direct access
|
||||
defined( '_JEXEC' ) or die( 'Restricted access' );
|
||||
|
||||
jimport('joomla.html.pane');
|
||||
jimport('joomla.application.module.helper');
|
||||
|
||||
/**
|
||||
* @package Joomla
|
||||
* @subpackage Admin
|
||||
*/
|
||||
class HTML_cpanel
|
||||
{
|
||||
/**
|
||||
* Control panel
|
||||
*/
|
||||
function display()
|
||||
{
|
||||
global $mainframe;
|
||||
|
||||
$modules = &JModuleHelper::getModules('cpanel');
|
||||
// TODO: allowAllClose should default true in J!1.6, so remove the array when it does.
|
||||
$pane = &JPane::getInstance('sliders', array('allowAllClose' => 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();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
/**
|
||||
* @version $Id: admin.cpanel.php 10381 2008-06-01 03:35:53Z pasamio $
|
||||
* @package Joomla
|
||||
* @subpackage Admin
|
||||
* @copyright Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved.
|
||||
* @license GNU/GPL, see LICENSE.php
|
||||
* Joomla! is free software. This version may have been modified pursuant
|
||||
* to the GNU General Public License, and as distributed it includes or
|
||||
* is derivative of works licensed under the GNU General Public License or
|
||||
* other free or open source software licenses.
|
||||
* See COPYRIGHT.php for copyright notices and details.
|
||||
*/
|
||||
|
||||
// no direct access
|
||||
defined( '_JEXEC' ) or die( 'Restricted access' );
|
||||
require_once( JApplicationHelper::getPath( 'admin_html' ) );
|
||||
|
||||
switch (JRequest::getCmd('task'))
|
||||
{
|
||||
default:
|
||||
{
|
||||
//set the component specific template file in the request
|
||||
JRequest::setVar('tmpl', 'cpanel');
|
||||
HTML_cpanel::display();
|
||||
} break;
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<install type="component" version="1.0.0">
|
||||
<name>Control Panel</name>
|
||||
<author>Joomla! Project</author>
|
||||
<creationDate>2006</creationDate>
|
||||
<copyright>Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved.</copyright>
|
||||
<license>http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL</license>
|
||||
<authorEmail>[email protected]</authorEmail>
|
||||
<authorUrl>www.joomla.org</authorUrl>
|
||||
<version>1.5.0</version>
|
||||
<description>The Control Panel is the Home Page of the Joomla! Administrator Back-end</description>
|
||||
</install>
|
||||
@@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
||||
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
/**
|
||||
* @version $Id: toolbar.cpanel.html.php 10381 2008-06-01 03:35:53Z pasamio $
|
||||
* @package Joomla
|
||||
* @subpackage Admin
|
||||
* @copyright Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved.
|
||||
* @license GNU/GPL, see LICENSE.php
|
||||
* Joomla! is free software. This version may have been modified pursuant
|
||||
* to the GNU General Public License, and as distributed it includes or
|
||||
* is derivative of works licensed under the GNU General Public License or
|
||||
* other free or open source software licenses.
|
||||
* See COPYRIGHT.php for copyright notices and details.
|
||||
*/
|
||||
|
||||
// no direct access
|
||||
defined( '_JEXEC' ) or die( 'Restricted access' );
|
||||
|
||||
/**
|
||||
* @package Joomla
|
||||
* @subpackage Admin
|
||||
*/
|
||||
class TOOLBAR_cpanel
|
||||
{
|
||||
function _DEFAULT() {
|
||||
JToolBarHelper::title( JText::_( 'Control Panel' ), 'cpanel.png' );
|
||||
JToolBarHelper::help( 'screen.cpanel' );
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
/**
|
||||
* @version $Id: toolbar.cpanel.php 10381 2008-06-01 03:35:53Z pasamio $
|
||||
* @package Joomla
|
||||
* @subpackage Admin
|
||||
* @copyright Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved.
|
||||
* @license GNU/GPL, see LICENSE.php
|
||||
* Joomla! is free software. This version may have been modified pursuant
|
||||
* to the GNU General Public License, and as distributed it includes or
|
||||
* is derivative of works licensed under the GNU General Public License or
|
||||
* other free or open source software licenses.
|
||||
* See COPYRIGHT.php for copyright notices and details.
|
||||
*/
|
||||
|
||||
// no direct access
|
||||
defined( '_JEXEC' ) or die( 'Restricted access' );
|
||||
|
||||
require_once( JApplicationHelper::getPath( 'toolbar_html' ) );
|
||||
|
||||
switch (JRequest::getCmd('task'))
|
||||
{
|
||||
default:
|
||||
TOOLBAR_cpanel::_DEFAULT();
|
||||
break;
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
/**
|
||||
* @version $Id: admin.installer.php 10381 2008-06-01 03:35:53Z pasamio $
|
||||
* @package Joomla
|
||||
* @subpackage Installer
|
||||
* @copyright Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved.
|
||||
* @license GNU/GPL, see LICENSE.php
|
||||
* Joomla! is free software. This version may have been modified pursuant
|
||||
* to the GNU General Public License, and as distributed it includes or
|
||||
* is derivative of works licensed under the GNU General Public License or
|
||||
* other free or open source software licenses.
|
||||
* See COPYRIGHT.php for copyright notices and details.
|
||||
*/
|
||||
|
||||
// no direct access
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
/*
|
||||
* Make sure the user is authorized to view this page
|
||||
*/
|
||||
$user = & JFactory::getUser();
|
||||
if (!$user->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();
|
||||
@@ -0,0 +1,191 @@
|
||||
<?php
|
||||
/**
|
||||
* @version $Id: controller.php 10381 2008-06-01 03:35:53Z pasamio $
|
||||
* @package Joomla
|
||||
* @subpackage Installer
|
||||
* @copyright Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved.
|
||||
* @license GNU/GPL, see LICENSE.php
|
||||
* Joomla! is free software. This version may have been modified pursuant to the
|
||||
* GNU General Public License, and as distributed it includes or is derivative
|
||||
* of works licensed under the GNU General Public License or other free or open
|
||||
* source software licenses. See COPYRIGHT.php for copyright notices and
|
||||
* details.
|
||||
*/
|
||||
|
||||
// Check to ensure this file is included in Joomla!
|
||||
defined('_JEXEC') or die( 'Restricted access' );
|
||||
|
||||
jimport('joomla.application.component.controller');
|
||||
jimport('joomla.client.helper');
|
||||
|
||||
/**
|
||||
* Installer Controller
|
||||
*
|
||||
* @package Joomla
|
||||
* @subpackage Installer
|
||||
* @since 1.5
|
||||
*/
|
||||
class InstallerController extends JController
|
||||
{
|
||||
/**
|
||||
* Display the extension installer form
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
* @since 1.5
|
||||
*/
|
||||
function installform()
|
||||
{
|
||||
global $mainframe;
|
||||
|
||||
$model = &$this->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();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
/**
|
||||
* @version $Id: helper.php 10381 2008-06-01 03:35:53Z pasamio $
|
||||
* @package Joomla
|
||||
* @subpackage Menus
|
||||
* @copyright Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved.
|
||||
* @license GNU/GPL, see LICENSE.php
|
||||
* Joomla! is free software. This version may have been modified pursuant to the
|
||||
* GNU General Public License, and as distributed it includes or is derivative
|
||||
* of works licensed under the GNU General Public License or other free or open
|
||||
* source software licenses. See COPYRIGHT.php for copyright notices and
|
||||
* details.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Extension Manager Helper
|
||||
*
|
||||
* @static
|
||||
* @package Joomla
|
||||
* @subpackage Installer
|
||||
* @since 1.5
|
||||
*/
|
||||
class InstallerHelper
|
||||
{
|
||||
/**
|
||||
* Get HTML string for writable state of a folder
|
||||
*
|
||||
* @param string $folder
|
||||
* @return string
|
||||
*/
|
||||
function writable( $folder )
|
||||
{
|
||||
return is_writable( JPATH_ROOT.DS.$folder )
|
||||
? '<strong><span class="writable">'.JText::_( 'Writable' ).'</span></strong>'
|
||||
: '<strong><span class="unwritable">'.JText::_( 'Unwritable' ).'</span></strong>';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
||||
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<install type="component" version="1.0.0">
|
||||
<name>Installation Manager</name>
|
||||
<author>Joomla! Project</author>
|
||||
<creationDate>2006</creationDate>
|
||||
<copyright>Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved.</copyright>
|
||||
<license>http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL</license>
|
||||
<authorEmail>[email protected]</authorEmail>
|
||||
<authorUrl>www.joomla.org</authorUrl>
|
||||
<version>1.5.0</version>
|
||||
<description>Installation Manager</description>
|
||||
</install>
|
||||
@@ -0,0 +1,173 @@
|
||||
<?php
|
||||
/**
|
||||
* @version $Id: components.php 12389 2009-07-01 00:34:45Z ian $
|
||||
* @package Joomla
|
||||
* @subpackage Menus
|
||||
* @copyright Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved.
|
||||
* @license GNU/GPL, see LICENSE.php
|
||||
* Joomla! is free software. This version may have been modified pursuant to the
|
||||
* GNU General Public License, and as distributed it includes or is derivative
|
||||
* of works licensed under the GNU General Public License or other free or open
|
||||
* source software licenses. See COPYRIGHT.php for copyright notices and
|
||||
* details.
|
||||
*/
|
||||
|
||||
// no direct access
|
||||
defined( '_JEXEC' ) or die( 'Restricted access' );
|
||||
|
||||
// Import library dependencies
|
||||
require_once(dirname(__FILE__).DS.'extension.php');
|
||||
|
||||
/**
|
||||
* Installer Components Model
|
||||
*
|
||||
* @package Joomla
|
||||
* @subpackage Installer
|
||||
* @since 1.5
|
||||
*/
|
||||
class InstallerModelComponents extends InstallerModel
|
||||
{
|
||||
/**
|
||||
* Extension Type
|
||||
* @var string
|
||||
*/
|
||||
var $_type = 'component';
|
||||
|
||||
/**
|
||||
* Enable a component
|
||||
*
|
||||
* @static
|
||||
* @return boolean True on success
|
||||
* @since 1.0
|
||||
*/
|
||||
function enable($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);
|
||||
|
||||
// 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user