Version 3.1.4
This commit is contained in:
1 parent
1d4720f3e2
commit
ae5c01cc78
2563 files changed
+283048
-240689
No files matched your search
@@ -1,19 +1,21 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.0.5
|
||||
* IP.Board v3.1.4
|
||||
* Skin Functions
|
||||
* Last Updated: $Date: 2009-09-28 18:04:38 -0400 (Mon, 28 Sep 2009) $
|
||||
* Last Updated: $Date: 2010-09-13 05:53:37 -0400 (Mon, 13 Sep 2010) $
|
||||
* </pre>
|
||||
*
|
||||
* Owner: Matt
|
||||
* @author $Author: josh $
|
||||
* @author $Author: terabyte $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.iinvisionpower.com/community/board/license.html
|
||||
* @package Invision Power Board
|
||||
* @link http://www.iinvisionpower.com
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @package IP.Board
|
||||
* @link http://www.invisionpower.com
|
||||
* @since 9th March 2005 11:03
|
||||
* @version $Revision: 5170 $
|
||||
* @version $Revision: 6854 $
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -68,13 +70,23 @@ class skinImportExport extends skinCaching
|
||||
//-----------------------------------------
|
||||
|
||||
$addedCount = 0;
|
||||
|
||||
$masterKeys = $this->fetchMasterKeys();
|
||||
$skinMasterKey = '';
|
||||
|
||||
//-----------------------------------------
|
||||
// Got anything?
|
||||
//-----------------------------------------
|
||||
|
||||
$replacements = $this->parseReplacementsXML( $content );
|
||||
$where = ( is_numeric( $setID ) ) ? 'replacement_set_id=' . $setID : 'replacement_master_key=\'' . $setID . '\'';
|
||||
|
||||
/* If this is a 'master' skin, then reset master key */
|
||||
if ( in_array( $setID, $masterKeys ) )
|
||||
{
|
||||
$skinMasterKey = $setID;
|
||||
$setID = 0;
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Replacements...
|
||||
//-----------------------------------------
|
||||
@@ -82,7 +94,7 @@ class skinImportExport extends skinCaching
|
||||
if ( is_array( $replacements ) )
|
||||
{
|
||||
/* Get all the keys for this set id */
|
||||
$this->DB->build( array( 'select' => 'replacement_key', 'from' => 'skin_replacements', 'where' => "replacement_set_id={$setID}" ) );
|
||||
$this->DB->build( array( 'select' => 'replacement_key', 'from' => 'skin_replacements', 'where' => $where ) );
|
||||
$this->DB->execute();
|
||||
|
||||
$repKeyCache = array();
|
||||
@@ -100,21 +112,16 @@ class skinImportExport extends skinCaching
|
||||
|
||||
if( in_array( $replacement['replacement_key'], $repKeyCache ) )
|
||||
{
|
||||
$this->DB->update( 'skin_replacements', array(
|
||||
'replacement_content' => $replacement['replacement_content']
|
||||
),
|
||||
"replacement_key='{$replacement['replacement_key']}' AND replacement_set_id={$setID}"
|
||||
);
|
||||
$this->DB->update( 'skin_replacements', array( 'replacement_content' => $replacement['replacement_content'] ), "replacement_key='{$replacement['replacement_key']}' AND " . $where );
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->DB->insert( 'skin_replacements', array(
|
||||
'replacement_key' => $replacement['replacement_key'],
|
||||
'replacement_content' => $replacement['replacement_content'],
|
||||
'replacement_set_id' => $setID,
|
||||
'replacement_added_to' => $setID
|
||||
)
|
||||
);
|
||||
$this->DB->insert( 'skin_replacements', array( 'replacement_key' => $replacement['replacement_key'],
|
||||
'replacement_content' => $replacement['replacement_content'],
|
||||
'replacement_set_id' => $setID,
|
||||
'replacement_added_to' => $setID,
|
||||
'replacement_master_key' => $skinMasterKey
|
||||
) );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -149,7 +156,7 @@ class skinImportExport extends skinCaching
|
||||
|
||||
if ( ! strstr( $content, "<xmlarchive" ) )
|
||||
{
|
||||
$this->_addErrorMessage( "Содержимое не является XMLArchive" );
|
||||
$this->_addErrorMessage( $this->lang->words['invalidxmlarchivei'] );
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -164,7 +171,7 @@ class skinImportExport extends skinCaching
|
||||
|
||||
if ( ! $xmlArchive->countFileArray() )
|
||||
{
|
||||
$this->_addErrorMessage( "XMLArchive пуст" );
|
||||
$this->_addErrorMessage( $this->lang->words['emptyxmlarchivei'] );
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -177,13 +184,13 @@ class skinImportExport extends skinCaching
|
||||
if ( $this->checkImageDirectoryExists( $imageSetName ) === TRUE )
|
||||
{
|
||||
/* Already exists... */
|
||||
$this->_addErrorMessage( "Директория public/style_images/{$imageSetName} уже существует" );
|
||||
$this->_addErrorMessage( sprintf( $this->lang->words['imagediralreadyexists'], $imageSetName ) );
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if ( $this->createNewImageDirectory( $imageSetName ) !== TRUE )
|
||||
{
|
||||
$this->_addErrorMessage( "Не удалось создать public/style_images/{$imageSetName}. Проверьте права доступа и повторите попытку снова." );
|
||||
$this->_addErrorMessage( sprintf( $this->lang->words['imagedircannotcreate'], $imageSetName ) );
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -201,7 +208,7 @@ class skinImportExport extends skinCaching
|
||||
/* Write it */
|
||||
if ( $xmlArchive->write( $content, $this->fetchImageDirectoryPath( $imageSetName ) ) === FALSE )
|
||||
{
|
||||
$this->_addErrorMessage( "Не удалось записать файлы изображений" );
|
||||
$this->_addErrorMessage( $this->lang->words['cannotwriteimageset'] );
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -245,21 +252,23 @@ class skinImportExport extends skinCaching
|
||||
* @param int [ Skin set parent. If omitted, it will be made a root skin ]
|
||||
* @param string [ Images directory to use. If omitted, default skin's image dir is used ]
|
||||
* @param string [ Name of skin to create. If omitted, name from skin set is used ]
|
||||
* @param bool [ Whether or not we are attempting to upgrade an existing skin ]
|
||||
* @return mixed bool, or number of items added
|
||||
*/
|
||||
public function importSetXMLArchive( $content, $parentID=0, $imageDir='', $setName='' )
|
||||
public function importSetXMLArchive( $content, $parentID=0, $imageDir='', $setName='', $upgrading=FALSE )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
|
||||
$templates = array();
|
||||
$csss = array();
|
||||
$groups = array();
|
||||
$defaultSkin = array();
|
||||
$return = array( 'replacements' => 0,
|
||||
'css' => 0,
|
||||
'templates' => 0 );
|
||||
$templates = array();
|
||||
$csss = array();
|
||||
$groups = array();
|
||||
$defaultSkin = array();
|
||||
$return = array( 'replacements' => 0,
|
||||
'css' => 0,
|
||||
'templates' => 0,
|
||||
'upgrade' => FALSE );
|
||||
|
||||
//-----------------------------------------
|
||||
// Got anything?
|
||||
@@ -267,7 +276,7 @@ class skinImportExport extends skinCaching
|
||||
|
||||
if ( ! strstr( $content, "<xmlarchive" ) )
|
||||
{
|
||||
$this->_addErrorMessage( "Содержимое не является XMLArchive" );
|
||||
$this->_addErrorMessage( $this->lang->words['invalidxmlarchivei'] );
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -294,7 +303,7 @@ class skinImportExport extends skinCaching
|
||||
|
||||
if ( ! $xmlArchive->countFileArray() )
|
||||
{
|
||||
$this->_addErrorMessage( "XMLArchive пуст" );
|
||||
$this->_addErrorMessage( $this->lang->words['emptyxmlarchivei'] );
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -307,12 +316,34 @@ class skinImportExport extends skinCaching
|
||||
|
||||
if( !$infoXml )
|
||||
{
|
||||
$this->_addErrorMessage( "Файл info.xml пуст или отсутствует" );
|
||||
$this->_addErrorMessage( $this->lang->words['noinfoxml'] );
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
$info = $this->parseInfoXML( $infoXml );
|
||||
|
||||
|
||||
/* Are we attempting to upgrade? */
|
||||
$setID = 0;
|
||||
$doUpgrade = FALSE;
|
||||
$new_items = array( 'replacements' => array(),
|
||||
'css' => array(),
|
||||
'templates' => array(),
|
||||
);
|
||||
|
||||
if ( $info['set_key'] && $upgrading )
|
||||
{
|
||||
foreach ( $this->caches['skinsets'] as $set_id => $set_data )
|
||||
{
|
||||
if ( $set_data['set_key'] == $info['set_key'] )
|
||||
{
|
||||
$setID = $set_id;
|
||||
$doUpgrade = TRUE;
|
||||
$return['upgrade'] = TRUE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Replacements */
|
||||
$replacements = $this->parseReplacementsXML( $xmlArchive->getFile( 'replacements.xml' ) );
|
||||
|
||||
@@ -336,7 +367,7 @@ class skinImportExport extends skinCaching
|
||||
|
||||
if ( ! is_array( $info ) )
|
||||
{
|
||||
$this->_addErrorMessage( "XMLArchive не содержит файл info.xml" );
|
||||
$this->_addErrorMessage( $this->lang->words['noinfoxml'] );
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -355,12 +386,22 @@ class skinImportExport extends skinCaching
|
||||
}
|
||||
}
|
||||
|
||||
/* Make sure key in unique */
|
||||
$test = $this->DB->buildAndFetch( array( 'select' => '*',
|
||||
'from' => 'skin_collections',
|
||||
'where' => 'set_key=\'' . $this->DB->addSlashes( $info['set_key'] ) . '\' AND set_id != ' . intval( $setID ) ) );
|
||||
|
||||
if ( $test['set_id'] )
|
||||
{
|
||||
$info['set_key'] .= '_' . time();
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Build Set Array
|
||||
//-----------------------------------------
|
||||
|
||||
$newSet = array('set_name' => ( $setName ) ? $setName : $info['set_name'] . ' (Import)',
|
||||
'set_key' => '',
|
||||
'set_key' => $info['set_key'],
|
||||
'set_parent_id' => $parentID,
|
||||
'set_permissions' => implode( ",", $groups ),
|
||||
'set_is_default' => 0,
|
||||
@@ -372,15 +413,31 @@ class skinImportExport extends skinCaching
|
||||
'set_output_format' => $info['set_output_format'],
|
||||
'set_css_groups' => '',
|
||||
'set_hide_from_list' => 1, // Per Rikki :P
|
||||
'set_order' => intval( $this->fetchHighestSetPosition() ) + 1,
|
||||
'set_master_key' => ( isset( $info['set_master_key'] ) ) ? $info['set_master_key'] : 'root',
|
||||
'set_updated' => time() );
|
||||
|
||||
//-----------------------------------------
|
||||
// Insert...
|
||||
//-----------------------------------------
|
||||
|
||||
$this->DB->insert( 'skin_collections', $newSet );
|
||||
|
||||
$setID = $this->DB->getInsertId();
|
||||
if ( $setID )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Update...
|
||||
//-----------------------------------------
|
||||
|
||||
$this->DB->update( 'skin_collections', array( 'set_author_name' => $info['set_author_name'],
|
||||
'set_author_url' => $info['set_author_url'],
|
||||
'set_updated' => time(),
|
||||
), 'set_id=' . $setID );
|
||||
}
|
||||
else
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Insert...
|
||||
//-----------------------------------------
|
||||
|
||||
$this->DB->insert( 'skin_collections', $newSet );
|
||||
|
||||
$setID = $this->DB->getInsertId();
|
||||
}
|
||||
|
||||
/* Rebuild trees */
|
||||
$this->rebuildTreeInformation( $setID );
|
||||
@@ -409,11 +466,31 @@ class skinImportExport extends skinCaching
|
||||
if ( $replacement['replacement_key'] )
|
||||
{
|
||||
$return['replacements']++;
|
||||
$existing_id = 0;
|
||||
|
||||
$this->DB->insert( 'skin_replacements', array( 'replacement_key' => $replacement['replacement_key'],
|
||||
'replacement_content' => $replacement['replacement_content'],
|
||||
'replacement_set_id' => $setID,
|
||||
'replacement_added_to' => $setID ) );
|
||||
/* Check if we need to update or insert */
|
||||
if ( $doUpgrade )
|
||||
{
|
||||
$exists = $this->DB->buildAndFetch( array( 'select' => 'replacement_id',
|
||||
'from' => 'skin_replacements',
|
||||
'where' => "replacement_key='{$replacement['replacement_key']}' AND replacement_set_id={$setID} AND replacement_added_to={$setID}" ) );
|
||||
|
||||
|
||||
$existing_id = $exists['replacement_id'];
|
||||
}
|
||||
|
||||
if ( $existing_id )
|
||||
{
|
||||
$new_items['replacements'][] = $existing_id;
|
||||
$this->DB->update( 'skin_replacements', array( 'replacement_content' => $replacement['replacement_content'] ), "replacement_id=".$existing_id );
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->DB->insert( 'skin_replacements', array( 'replacement_key' => $replacement['replacement_key'],
|
||||
'replacement_content' => $replacement['replacement_content'],
|
||||
'replacement_set_id' => $setID,
|
||||
'replacement_added_to' => $setID ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -436,17 +513,42 @@ class skinImportExport extends skinCaching
|
||||
if ( $css['css_group'] )
|
||||
{
|
||||
$return['css']++;
|
||||
|
||||
$this->DB->insert( 'skin_css', array( 'css_group' => $css['css_group'],
|
||||
'css_content' => $css['css_content'],
|
||||
'css_position' => $css['css_position'],
|
||||
'css_attributes' => $css['css_attributes'],
|
||||
'css_app' => $css['css_app'],
|
||||
'css_app_hide' => $css['css_app_hide'],
|
||||
'css_modules' => str_replace( ' ', '', $css['css_modules'] ),
|
||||
'css_updated' => time(),
|
||||
'css_set_id' => $setID,
|
||||
'css_added_to' => ( isset( $_MASTER[ $css['css_group'] ] ) ) ? 0 : $setID ) );
|
||||
$existing_id = 0;
|
||||
|
||||
/* Check if we need to update or insert */
|
||||
if ( $doUpgrade )
|
||||
{
|
||||
$exists = $this->DB->buildAndFetch( array( 'select' => 'css_id',
|
||||
'from' => 'skin_css',
|
||||
'where' => "css_group='{$css['css_group']}' AND css_app='{$css['css_app']}' AND css_set_id={$setID}" ) );
|
||||
|
||||
$existing_id = $exists['css_id'];
|
||||
}
|
||||
|
||||
if ( $existing_id )
|
||||
{
|
||||
$new_items['css'][] = $existing_id;
|
||||
$this->DB->update( 'skin_css', array( 'css_content' => $css['css_content'],
|
||||
'css_position' => $css['css_position'],
|
||||
'css_attributes' => $css['css_attributes'],
|
||||
'css_app_hide' => $css['css_app_hide'],
|
||||
'css_modules' => str_replace( ' ', '', $css['css_modules'] ),
|
||||
'css_updated' => time(),
|
||||
'css_added_to' => ( isset( $_MASTER[ $css['css_group'] ] ) ) ? 0 : $setID ), "css_id=".$existing_id );
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->DB->insert( 'skin_css', array( 'css_group' => $css['css_group'],
|
||||
'css_content' => $css['css_content'],
|
||||
'css_position' => $css['css_position'],
|
||||
'css_attributes' => $css['css_attributes'],
|
||||
'css_app' => $css['css_app'],
|
||||
'css_app_hide' => $css['css_app_hide'],
|
||||
'css_modules' => str_replace( ' ', '', $css['css_modules'] ),
|
||||
'css_updated' => time(),
|
||||
'css_set_id' => $setID,
|
||||
'css_added_to' => ( isset( $_MASTER[ $css['css_group'] ] ) ) ? 0 : $setID ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -474,23 +576,70 @@ class skinImportExport extends skinCaching
|
||||
$isAdded = ( is_array( $_MASTER[ $template['template_group'] ][ strtolower( $template['template_name'] ) ] ) AND ! $_MASTER[ $template['template_group'] ][ strtolower( $template['template_name'] ) ]['template_user_added'] ) ? 0 : 1;
|
||||
|
||||
$return['templates']++;
|
||||
|
||||
$this->DB->insert( 'skin_templates', array( 'template_set_id' => $setID,
|
||||
'template_group' => $template['template_group'],
|
||||
'template_content' => $template['template_content'],
|
||||
'template_name' => $template['template_name'],
|
||||
'template_data' => $template['template_data'],
|
||||
'template_updated' => $template['template_updated'],
|
||||
'template_removable' => 1,
|
||||
'template_user_edited' => 1,
|
||||
'template_user_added' => $isAdded,
|
||||
'template_added_to' => $setID ) );
|
||||
$existing_id = 0;
|
||||
|
||||
/* Check if we need to update or insert */
|
||||
if ( $doUpgrade )
|
||||
{
|
||||
$exists = $this->DB->buildAndFetch( array( 'select' => 'template_id',
|
||||
'from' => 'skin_templates',
|
||||
'where' => "template_set_id={$setID} AND template_group='{$template['template_group']}' AND template_name='{$template['template_name']}'" ) );
|
||||
|
||||
$existing_id = $exists['template_id'];
|
||||
}
|
||||
|
||||
if ( $existing_id )
|
||||
{
|
||||
$new_items['templates'][] = $existing_id;
|
||||
$this->DB->update( 'skin_templates', array( 'template_content' => $template['template_content'],
|
||||
'template_data' => $template['template_data'],
|
||||
'template_updated' => $template['template_updated'],
|
||||
'template_removable' => 1,
|
||||
'template_user_edited' => 1,
|
||||
'template_user_added' => $isAdded,
|
||||
'template_added_to' => $setID ), "template_id=".$existing_id );
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->DB->insert( 'skin_templates', array( 'template_set_id' => $setID,
|
||||
'template_group' => $template['template_group'],
|
||||
'template_content' => $template['template_content'],
|
||||
'template_name' => $template['template_name'],
|
||||
'template_data' => $template['template_data'],
|
||||
'template_updated' => $template['template_updated'],
|
||||
'template_removable' => 1,
|
||||
'template_user_edited' => 1,
|
||||
'template_user_added' => $isAdded,
|
||||
'template_added_to' => $setID ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// If upgrading, and there are items from an old
|
||||
// skin not in the new one, delete the old elements
|
||||
// This probably won't ever come up, but I'm anal retentive :P
|
||||
//-----------------------------------------
|
||||
|
||||
if ( $doUpgrade )
|
||||
{
|
||||
if ( count( $new_items['replacements'] ) )
|
||||
{
|
||||
$this->DB->delete( 'skin_replacements', "replacement_set_id={$setID} AND replacement_id NOT IN (" . implode( ',', $new_items['replacements']) . ")" );
|
||||
}
|
||||
if ( count( $new_items['css'] ) )
|
||||
{
|
||||
$this->DB->delete( 'skin_css', "css_set_id={$setID} AND css_id NOT IN (" . implode( ',', $new_items['css']) . ")" );
|
||||
}
|
||||
if ( count( $new_items['templates'] ) )
|
||||
{
|
||||
$this->DB->delete( 'skin_templates', "template_set_id={$setID} AND template_id NOT IN (" . implode( ',', $new_items['templates']) . ")" );
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Re-cache
|
||||
//-----------------------------------------
|
||||
@@ -677,7 +826,7 @@ class skinImportExport extends skinCaching
|
||||
|
||||
if ( $this->checkImageDirectoryExists( $imgDir ) !== TRUE )
|
||||
{
|
||||
$this->_addErrorMessage( "Директории изображений $imgDir не существует" );
|
||||
$this->_addErrorMessage( sprintf( $this->lang->words['imagedirnotexists'], $imgDir ) );
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -757,16 +906,16 @@ class skinImportExport extends skinCaching
|
||||
|
||||
foreach( $templates as $app_dir => $templateXML )
|
||||
{
|
||||
IPSDebug::addLogMessage( "Template Export: $app_dir\n".$templateXML, 'admin-setExport' );
|
||||
IPSDebug::addLogMessage( "Template Export: $app_dir\n".$templateXML, 'admin-setExport', false, true, true );
|
||||
}
|
||||
|
||||
foreach( $csss as $app_dir => $cssXML )
|
||||
{
|
||||
IPSDebug::addLogMessage( "CSS Export: $app_dir\n".$cssXML, 'admin-setExport' );
|
||||
IPSDebug::addLogMessage( "CSS Export: $app_dir\n".$cssXML, 'admin-setExport', false, true );
|
||||
}
|
||||
|
||||
IPSDebug::addLogMessage( "Replacements Export:\n".$replacements, 'admin-setExport' );
|
||||
IPSDebug::addLogMessage( "Info Export:\n".$info, 'admin-setExport' );
|
||||
IPSDebug::addLogMessage( "Replacements Export:\n".$replacements, 'admin-setExport', false, true );
|
||||
IPSDebug::addLogMessage( "Info Export:\n".$info, 'admin-setExport', false, true );
|
||||
|
||||
//-----------------------------------------
|
||||
// Create new XML archive...
|
||||
@@ -775,6 +924,10 @@ class skinImportExport extends skinCaching
|
||||
require_once( IPS_KERNEL_PATH . 'classXMLArchive.php' );
|
||||
$xmlArchive = new classXMLArchive();
|
||||
|
||||
/* Add in version numbers */
|
||||
$version = IPSLib::fetchVersionNumber();
|
||||
$xmlArchive->addRootTagValues( array( 'ipbLongVersion' => $version['long'], 'ipbHumanVersion' => $version['human'] ) );
|
||||
|
||||
# Templates
|
||||
foreach( $templates as $app_dir => $templateXML )
|
||||
{
|
||||
@@ -813,18 +966,30 @@ class skinImportExport extends skinCaching
|
||||
$this->_resetErrorHandle();
|
||||
$this->_resetMessageHandle();
|
||||
|
||||
if ( $setID == 0 )
|
||||
{
|
||||
/* This is which skins we want to export for default installations */
|
||||
$skinIDs = array_values( $this->remapData['export'] );
|
||||
}
|
||||
else
|
||||
{
|
||||
$skinIDs = array( $setID );
|
||||
}
|
||||
|
||||
foreach( $skinIDs as $setID )
|
||||
{
|
||||
foreach( ipsRegistry::$applications as $app_dir => $app_data )
|
||||
{
|
||||
if ( ! file_exists( IPSLib::getAppDir( $app_dir ) . '/xml' ) )
|
||||
{
|
||||
$this->_addErrorMessage( IPSLib::getAppDir( $app_dir ) . "/xml/ не существует" );
|
||||
$this->_addErrorMessage( IPSLib::getAppDir( $app_dir ) . $this->lang->words['xmldirmissing'] );
|
||||
continue;
|
||||
}
|
||||
else if ( ! is_writable( IPSLib::getAppDir( $app_dir ) . '/xml' ) )
|
||||
{
|
||||
if ( ! @chmod( IPSLib::getAppDir( $app_dir ) . '/xml', 0755 ) )
|
||||
{
|
||||
$this->_addErrorMessage( IPSLib::getAppDir( $app_dir ) . "/xml/ не имеет прав на запись" );
|
||||
$this->_addErrorMessage( IPSLib::getAppDir( $app_dir ) . $this->lang->words['xmldirnotwrite'] );
|
||||
continue;
|
||||
}
|
||||
}
|
||||
@@ -832,6 +997,7 @@ class skinImportExport extends skinCaching
|
||||
$this->exportTemplateAppXML( $app_dir, $setID, $setOnly );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Export all Apps CSS
|
||||
@@ -849,20 +1015,32 @@ class skinImportExport extends skinCaching
|
||||
$this->_resetErrorHandle();
|
||||
$this->_resetMessageHandle();
|
||||
|
||||
if ( $setID == 0 )
|
||||
{
|
||||
/* This is which skins we want to export for default installations */
|
||||
$skinIDs = array_values( $this->remapData['export'] );
|
||||
}
|
||||
else
|
||||
{
|
||||
$skinIDs = array( $setID );
|
||||
}
|
||||
|
||||
foreach( $skinIDs as $setID )
|
||||
{
|
||||
foreach( ipsRegistry::$applications as $app_dir => $app_data )
|
||||
{
|
||||
$file = IPSLib::getAppDir( $app_dir ) . '/xml/' . $app_dir . '_css.xml';
|
||||
|
||||
if ( ! file_exists( IPSLib::getAppDir( $app_dir ) . '/xml' ) )
|
||||
{
|
||||
$this->_addErrorMessage( IPSLib::getAppDir( $app_dir ) . "/xml/ не существует" );
|
||||
$this->_addErrorMessage( IPSLib::getAppDir( $app_dir ) . $this->lang->words['xmldirmissing'] );
|
||||
continue;
|
||||
}
|
||||
else if ( ! is_writable( IPSLib::getAppDir( $app_dir ) . '/xml' ) )
|
||||
{
|
||||
if ( ! @chmod( IPSLib::getAppDir( $app_dir ) . '/xml', 0755 ) )
|
||||
{
|
||||
$this->_addErrorMessage( IPSLib::getAppDir( $app_dir ) . "/xml/ не имеет прав на запись" );
|
||||
$this->_addErrorMessage( IPSLib::getAppDir( $app_dir ) . $this->lang->words['xmldirnotwrite'] );
|
||||
continue;
|
||||
}
|
||||
}
|
||||
@@ -870,6 +1048,7 @@ class skinImportExport extends skinCaching
|
||||
$this->exportCSSAppXML( $app_dir, $setID );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Import all Apps skin files
|
||||
@@ -893,13 +1072,13 @@ class skinImportExport extends skinCaching
|
||||
|
||||
if ( ! file_exists( $file ) )
|
||||
{
|
||||
$this->_addMessage( $app_dir . ': нечего импортировать' );
|
||||
$this->_addMessage( $app_dir . $this->lang->words['importnothingtoimport'] );
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
$return = $this->importTemplateAppXML( $app_dir, 0 );
|
||||
$this->_addMessage( $app_dir . ': ' . $return['updateCount'] . ' добавлено, ' . $return['insertCount'] . ' обновлено' );
|
||||
$this->_addMessage( sprintf( $this->lang->words['importaddupdate'], $app_dir, $return['updateCount'], $return['insertCount'] ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -917,11 +1096,25 @@ class skinImportExport extends skinCaching
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
|
||||
$skins = array();
|
||||
$setid = 1;
|
||||
|
||||
$skins = array();
|
||||
$setid = 1;
|
||||
$exports = array_values( $this->remapData['export'] );
|
||||
$remap = array( 'mobile' => array( 'set_id' => 2,
|
||||
'set_name' => 'IP.Board Mobile',
|
||||
'set_key' => 'mobile',
|
||||
'set_master_key' => 'mobile',
|
||||
'set_output_format' => 'html',
|
||||
'set_image_dir' => 'mobile',
|
||||
'set_locked_uagent' => 'a:2:{s:6:"groups";a:0:{}s:7:"uagents";a:10:{s:10:"blackberry";s:0:"";s:6:"iphone";s:0:"";s:9:"ipodtouch";s:0:"";s:12:"sonyericsson";s:0:"";s:5:"nokia";s:0:"";s:8:"motorola";s:0:"";s:7:"samsung";s:0:"";s:3:"htc";s:0:"";s:2:"lg";s:0:"";s:4:"palm";s:0:"";}}' ),
|
||||
'xmlskin' => array( 'set_id' => 3,
|
||||
'set_name' => 'IP.Board XML',
|
||||
'set_key' => 'xmlskin',
|
||||
'set_master_key' => 'xmlskin',
|
||||
'set_output_format' => 'xml',
|
||||
'set_image_dir' => 'master' ) );
|
||||
|
||||
/* Figure out ID 0 */
|
||||
if ( in_array( 0, $skinIDs ) )
|
||||
if ( in_array( 0, $skinIDs ) OR in_array( 'root', $skinIDs ) )
|
||||
{
|
||||
$cssSkinCollections = array();
|
||||
$_css = $this->fetchCSS( 0 );
|
||||
@@ -943,7 +1136,7 @@ class skinImportExport extends skinCaching
|
||||
'set_permissions' => '*',
|
||||
'set_is_default' => 1,
|
||||
'set_author_name' => 'Invision Power Services, Inc',
|
||||
'set_author_url' => '',
|
||||
'set_author_url' => 'http://www.bestcms.ws',
|
||||
'set_image_dir' => 'master',
|
||||
'set_emo_dir' => 'default',
|
||||
'set_css_inline' => 1,
|
||||
@@ -952,27 +1145,70 @@ class skinImportExport extends skinCaching
|
||||
'set_updated' => time(),
|
||||
'set_output_format' => 'html',
|
||||
'set_locked_uagent' => '',
|
||||
'set_hide_from_list' => 0 );
|
||||
'set_hide_from_list' => 0,
|
||||
'set_master_key' => 'root' );
|
||||
}
|
||||
|
||||
/* Grab the rest */
|
||||
$this->DB->build( array( 'select' => '*',
|
||||
'from' => 'skin_collections',
|
||||
'where' => 'set_id IN (' . implode( ",", $skinIDs ) . ')' ) );
|
||||
|
||||
$this->DB->execute();
|
||||
|
||||
while( $row = $this->DB->fetch() )
|
||||
foreach( $exports as $_id )
|
||||
{
|
||||
/* Ensure settings */
|
||||
$row['set_id'] = $setid;
|
||||
$row['set_permissions'] = '*';
|
||||
$row['set_hide_from_list'] = 0;
|
||||
$row['set_css_inline'] = 1;
|
||||
if ( $_id != 'root' AND in_array( $_id, $skinIDs ) )
|
||||
{
|
||||
$cssSkinCollections = array();
|
||||
$_css = $this->fetchCSS( $_id );
|
||||
|
||||
foreach( $_css as $name => $css )
|
||||
{
|
||||
/* Build skin set row*/
|
||||
$cssSkinCollections[ $css['css_position'] . '.' . $css['css_id'] ] = array( 'css_group' => $css['css_group'], 'css_position' => $css['css_position'] );
|
||||
}
|
||||
|
||||
$setid++;
|
||||
|
||||
$skins[ $remap[ $_id ]['set_id'] ] = array( 'set_id' => $remap[ $_id ]['set_id'],
|
||||
'set_name' => $remap[ $_id ]['set_name'],
|
||||
'set_key' => $remap[ $_id ]['set_key'],
|
||||
'set_parent_id' => 0,
|
||||
'set_parent_array' => serialize( array() ),
|
||||
'set_child_array' => serialize( array() ),
|
||||
'set_permissions' => '*',
|
||||
'set_is_default' => 1,
|
||||
'set_author_name' => 'Invision Power Services, Inc',
|
||||
'set_author_url' => 'http://www.bestcms.ws',
|
||||
'set_image_dir' => $remap[ $_id ]['set_image_dir'],
|
||||
'set_emo_dir' => 'default',
|
||||
'set_css_inline' => 1,
|
||||
'set_css_groups' => serialize( $cssSkinCollections ),
|
||||
'set_added' => time(),
|
||||
'set_updated' => time(),
|
||||
'set_output_format' => $remap[ $_id ]['set_output_format'],
|
||||
'set_locked_uagent' => ( isset( $remap[ $_id ]['set_locked_uagent'] ) ) ? $remap[ $_id ]['set_locked_uagent'] : '',
|
||||
'set_hide_from_list' => 0,
|
||||
'set_master_key' => $remap[ $_id ]['set_master_key'] );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ( count( $skins ) != count( $skinIDs ) )
|
||||
{
|
||||
/* Grab the rest */
|
||||
$this->DB->build( array( 'select' => '*',
|
||||
'from' => 'skin_collections',
|
||||
'where' => 'set_id IN (' . implode( ",", $skinIDs ) . ')' ) );
|
||||
|
||||
$this->DB->execute();
|
||||
|
||||
$skins[ $row['set_id'] ] = $row;
|
||||
|
||||
$setid++;
|
||||
while( $row = $this->DB->fetch() )
|
||||
{
|
||||
/* Ensure settings */
|
||||
$row['set_id'] = $setid;
|
||||
$row['set_permissions'] = '*';
|
||||
$row['set_hide_from_list'] = 0;
|
||||
$row['set_css_inline'] = 1;
|
||||
|
||||
$skins[ $row['set_id'] ] = $row;
|
||||
|
||||
$setid++;
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
@@ -1019,9 +1255,11 @@ class skinImportExport extends skinCaching
|
||||
|
||||
if ( $setOnly === TRUE )
|
||||
{
|
||||
$where = ( is_numeric( $setID ) ) ? 'replacement_set_id=' . $setID : 'replacement_master_key=\'' . $setID . '\'';
|
||||
|
||||
$this->DB->build( array( 'select' => '*',
|
||||
'from' => 'skin_replacements',
|
||||
'where' => 'replacement_set_id=' . $setID ) );
|
||||
'where' => $where ) );
|
||||
|
||||
$this->DB->execute();
|
||||
|
||||
@@ -1037,7 +1275,7 @@ class skinImportExport extends skinCaching
|
||||
|
||||
if ( ! is_array( $replacements ) OR ! count( $replacements ) )
|
||||
{
|
||||
$this->_addMessage( "Нет макросов для экспортирования" );
|
||||
$this->_addMessage( $this->lang->words['noreplacementstoexport'] );
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -1128,7 +1366,7 @@ class skinImportExport extends skinCaching
|
||||
|
||||
if ( ! is_array( $css ) OR ! count( $css ) )
|
||||
{
|
||||
$this->_addMessage( "Нет CSS для экспортирования в " . $app_dir );
|
||||
$this->_addMessage( $this->lang->words['nocsstoexport'] . $app_dir );
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -1168,7 +1406,7 @@ class skinImportExport extends skinCaching
|
||||
|
||||
if ( ! $gotSomething )
|
||||
{
|
||||
$this->_addMessage( "Нет CSS для экспортирования в " . $app_dir );
|
||||
$this->_addMessage( $this->lang->words['nocsstoexport'] . $app_dir );
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -1200,7 +1438,7 @@ class skinImportExport extends skinCaching
|
||||
|
||||
if ( ! file_exists( $infoXML ) )
|
||||
{
|
||||
$this->_addErrorMessage( "Не удалось найти: " . $infoXML );
|
||||
$this->_addErrorMessage( $this->lang->words['couldnotlocate'] . $infoXML );
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -1226,13 +1464,14 @@ class skinImportExport extends skinCaching
|
||||
|
||||
if ( ! is_array( $templateGroups ) OR ! count( $templateGroups ) )
|
||||
{
|
||||
$this->_addMessage( "Нечего экспортировать для приложения " . $app . ": Не установлены группы в information.xml" );
|
||||
$this->_addMessage( sprintf( $this->lang->words['nothingtoexportforapp'], $app ) );
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Fetch templates
|
||||
//-----------------------------------------
|
||||
$templates = array();
|
||||
|
||||
if ( $setOnly === TRUE AND $setID > 0 )
|
||||
{
|
||||
@@ -1283,7 +1522,7 @@ class skinImportExport extends skinCaching
|
||||
|
||||
if ( ! is_array( $templates ) OR ! count( $templates ) )
|
||||
{
|
||||
$this->_addMessage( "Нечего экспортировать для приложения " . $app . ": Нет шаблонов" );
|
||||
$this->_addMessage( sprintf( $this->lang->words['nogroupsforexportapp'], $app ) );
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -1308,9 +1547,21 @@ class skinImportExport extends skinCaching
|
||||
$_okToGo = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
/* If this is the core app, allow any custom bits also */
|
||||
if ( $app == 'core' )
|
||||
{
|
||||
$_data = $data;
|
||||
$test = array_shift( $_data );
|
||||
|
||||
if ( $test['template_user_added'] )
|
||||
{
|
||||
$_okToGo = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
if ( $_okToGo === TRUE )
|
||||
{
|
||||
{
|
||||
$xml->addElement( 'templategroup', 'templates', array( 'group' => $group ) );
|
||||
|
||||
foreach( $data as $name => $templateData )
|
||||
@@ -1328,7 +1579,7 @@ class skinImportExport extends skinCaching
|
||||
|
||||
if ( ! $added )
|
||||
{
|
||||
$this->_addMessage( "Нечего экспортировать для " . $app );
|
||||
$this->_addMessage( $this->lang->words['nothingtoexportfor'] . $app );
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -1350,7 +1601,8 @@ class skinImportExport extends skinCaching
|
||||
|
||||
$data = array();
|
||||
$setData = $this->fetchSkinData( $setID );
|
||||
|
||||
$version = IPSLib::fetchVersionNumber();
|
||||
|
||||
//-----------------------------------------
|
||||
// Grab the XML parser
|
||||
//-----------------------------------------
|
||||
@@ -1366,9 +1618,13 @@ class skinImportExport extends skinCaching
|
||||
$xml->addElement( 'info' );
|
||||
|
||||
$xml->addElementAsRecord( 'info', 'data', array( 'set_name' => $setData['set_name'],
|
||||
'set_key' => $setData['set_key'],
|
||||
'set_author_name' => $setData['set_author_name'],
|
||||
'set_author_url' => $setData['set_author_url'],
|
||||
'set_output_format' => $setData['set_output_format'],
|
||||
'set_master_key' => $setData['set_master_key'],
|
||||
'ipb_human_version' => $version['human'],
|
||||
'ipb_long_version' => $version['long'],
|
||||
'ipb_major_version' => '3' ) );
|
||||
|
||||
return $xml->fetchDocument();
|
||||
@@ -1391,6 +1647,7 @@ class skinImportExport extends skinCaching
|
||||
|
||||
$fileXML = IPSLib::getAppDir( $app ) . '/xml/' . $app . '_' . $skinKey . '_css.xml';
|
||||
$return = array( 'updateCount' => 0, 'insertCount' => 0, 'updateBits' => array(), 'insertBits' => array() );
|
||||
$masterKeys = $this->fetchMasterKeys();
|
||||
|
||||
//-----------------------------------------
|
||||
// File exists
|
||||
@@ -1401,23 +1658,31 @@ class skinImportExport extends skinCaching
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if ( ! $setID and $skinKey != 'root' )
|
||||
if ( ! $setID and ! in_array( $skinKey, $masterKeys ) )
|
||||
{
|
||||
/* Figure out correct set ID based on key */
|
||||
$skinSetData = $this->DB->buildAndFetch( array( 'select' => '*',
|
||||
'from' => 'skin_collections',
|
||||
'where' => "set_key='" . $skinKey . "'" ) );
|
||||
|
||||
$setID = $skinSetData['set_id'];
|
||||
$setID = $skinSetData['set_id'];
|
||||
$skinMasterKey = $skinSetData['set_master_key'];
|
||||
}
|
||||
|
||||
/* If this is a 'master' skin, then reset master key */
|
||||
if ( in_array( $skinKey, $masterKeys ) )
|
||||
{
|
||||
$skinMasterKey = $skinKey;
|
||||
$setID = 0;
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Delete all CSS if this is set ID 0
|
||||
//-----------------------------------------
|
||||
|
||||
if ( ! $setID )
|
||||
if ( in_array( $skinKey, $masterKeys ) )
|
||||
{
|
||||
$this->DB->delete( 'skin_css', 'css_set_id=0 AND css_app=\''. addslashes( $app ) . '\'' );
|
||||
$this->DB->delete( 'skin_css', 'css_set_id=0 AND css_master_key=\'' . $skinMasterKey . '\' AND css_app=\''. addslashes( $app ) . '\'' );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
@@ -1447,6 +1712,7 @@ class skinImportExport extends skinCaching
|
||||
'css_app_hide' => $_css['css_app_hide'],
|
||||
'css_attributes' => $_css['css_attributes'],
|
||||
'css_modules' => $_css['css_modules'],
|
||||
'css_master_key' => ( in_array( $skinKey, $masterKeys ) ) ? $skinKey : '',
|
||||
'css_set_id' => $setID,
|
||||
'css_added_to' => $setID ) );
|
||||
}
|
||||
@@ -1487,17 +1753,13 @@ class skinImportExport extends skinCaching
|
||||
{
|
||||
if ( file_exists( $file ) AND ! IPSLib::isWritable( $file ) )
|
||||
{
|
||||
$this->_addErrorMessage( $file . ' нет прав на запись' );
|
||||
$this->_addErrorMessage( $file . $this->lang->words['css_isnotwritable'] );
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
file_put_contents( $file, $xml );
|
||||
|
||||
$this->_addMessage( "CSS для " . $app_dir . ' - ' . $setData['set_key'] . " создан" );
|
||||
}
|
||||
else
|
||||
{
|
||||
//$this->_addMessage( "CSS XML for " . $app_dir . ' - ' . $setData['set_key'] . " could not be generated" );
|
||||
$this->_addMessage( sprintf( $this->lang->words['csscreatedmsg'], $app_dir, $setData['set_key'] ) );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1533,17 +1795,13 @@ class skinImportExport extends skinCaching
|
||||
{
|
||||
if ( file_exists( $file ) AND ! IPSLib::isWritable( $file ) )
|
||||
{
|
||||
$this->_addErrorMessage( $file . ' нет прав на запись' );
|
||||
$this->_addErrorMessage( $file . $this->lang->words['css_isnotwritable'] );
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
file_put_contents( $file, $xml );
|
||||
|
||||
$this->_addMessage( "Шаблоны для " . $app_dir . ' - ' . $setData['set_key'] . " созданы" );
|
||||
}
|
||||
else
|
||||
{
|
||||
//$this->_addMessage( "XML for " . $app_dir . ' - ' . $setData['set_key'] . " could not be generated" );
|
||||
$this->_addMessage( sprintf( $this->lang->words['templatescreatedmsg'], $app_dir, $setData['set_key'] ) );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1568,28 +1826,37 @@ class skinImportExport extends skinCaching
|
||||
$fileXML = IPSLib::getAppDir( $app ) . '/xml/' . $app . '_' . $skinKey . '_templates.xml';
|
||||
$infoXML = IPSLib::getAppDir( $app ) . '/xml/information.xml';
|
||||
$return = array( 'updateCount' => 0, 'insertCount' => 0, 'updateBits' => array(), 'insertBits' => array() );
|
||||
$masterKeys = $this->fetchMasterKeys();
|
||||
|
||||
if( ! file_exists($fileXML) )
|
||||
{
|
||||
return $return;
|
||||
}
|
||||
|
||||
if ( ! $setID and $skinKey != 'root' )
|
||||
if ( ! $setID and ! in_array( $skinKey, $masterKeys ) )
|
||||
{
|
||||
/* Figure out correct set ID based on key */
|
||||
$skinSetData = $this->DB->buildAndFetch( array( 'select' => '*',
|
||||
'from' => 'skin_collections',
|
||||
'where' => "set_key='" . $skinKey . "'" ) );
|
||||
|
||||
$setID = $skinSetData['set_id'];
|
||||
$setID = $skinSetData['set_id'];
|
||||
$skinMasterKey = $skinSetData['set_master_key'];
|
||||
}
|
||||
|
||||
/* Set ignore flag correctly */
|
||||
if ( ! empty( $skinKey ) AND in_array( $skinKey, array( 'root', 'lofi', 'xmlskin' ) ) )
|
||||
if ( ! empty( $skinKey ) AND in_array( $skinKey, $masterKeys ) )
|
||||
{
|
||||
$ignoreAddedEditedFlag = true;
|
||||
}
|
||||
|
||||
/* If this is a 'master' skin, then reset master key */
|
||||
if ( in_array( $skinKey, $masterKeys ) )
|
||||
{
|
||||
$skinMasterKey = $skinKey;
|
||||
$setID = 0;
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// XML
|
||||
//-----------------------------------------
|
||||
@@ -1616,7 +1883,7 @@ class skinImportExport extends skinCaching
|
||||
|
||||
if ( ! is_array( $templateGroups ) OR ! count( $templateGroups ) )
|
||||
{
|
||||
$this->_addMessage( "Нечего экспортировать для приложения " . $app );
|
||||
$this->_addMessage( $this->lang->words['nothingtoexportfor'] . $app );
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -1624,8 +1891,8 @@ class skinImportExport extends skinCaching
|
||||
// Fetch templates
|
||||
//-----------------------------------------
|
||||
|
||||
$_templates = $this->fetchTemplates( $setID, 'allNoContent' );
|
||||
$_MASTER = $this->fetchTemplates( 0, 'allNoContent' );
|
||||
$_templates = $this->fetchTemplates( $setID , 'allNoContent' );
|
||||
$_MASTER = $this->fetchTemplates( $skinMasterKey, 'allNoContent' );
|
||||
|
||||
//-----------------------------------------
|
||||
// Loop through...
|
||||
@@ -1664,9 +1931,9 @@ class skinImportExport extends skinCaching
|
||||
// Wipe the master skins
|
||||
//-----------------------------------------
|
||||
|
||||
if ( $setID == 0 )
|
||||
if ( in_array( $skinKey, $masterKeys ) )
|
||||
{
|
||||
$this->DB->delete( 'skin_templates', "template_set_id=0 AND template_group IN ('" . implode( "','", array_keys( $templates ) ) . "') AND template_user_added=0 AND template_added_to=0" );
|
||||
$this->DB->delete( 'skin_templates', "template_master_key='" . $skinKey . "' AND template_group IN ('" . implode( "','", array_keys( $templates ) ) . "') AND template_user_added=0 AND template_added_to=0" );
|
||||
|
||||
/* Now wipe the array so we enforce creation */
|
||||
unset( $templates );
|
||||
@@ -1703,6 +1970,7 @@ class skinImportExport extends skinCaching
|
||||
'template_data' => $data['template_data'],
|
||||
'template_user_edited' => $isEdited,
|
||||
'template_user_added' => $isAdded,
|
||||
'template_master_key' => ( in_array( $skinKey, $masterKeys ) ) ? $skinKey : '',
|
||||
'template_updated' => time() ), 'template_set_id=' . $setID . " AND template_group='" . $data['template_group'] . "' AND template_name='" . $data['template_name'] . "'" );
|
||||
}
|
||||
else
|
||||
@@ -1719,6 +1987,7 @@ class skinImportExport extends skinCaching
|
||||
'template_added_to' => $setID,
|
||||
'template_user_edited' => $isEdited,
|
||||
'template_user_added' => $isAdded,
|
||||
'template_master_key' => ( in_array( $skinKey, $masterKeys ) ) ? $skinKey : '',
|
||||
'template_updated' => time() ) );
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user