Anpassung an neue Editoren und Verbesserungen im Handling der Bilder im FileSystem
This commit is contained in:
@@ -12,7 +12,7 @@ if (ENVIRONMENT === 'local')
|
|||||||
elseif (ENVIRONMENT === 'production')
|
elseif (ENVIRONMENT === 'production')
|
||||||
{
|
{
|
||||||
$svjf['editorUrl'] = $vC['portal']['arrHost']['scheme'] . '://rist-editors.ri-st.de/';
|
$svjf['editorUrl'] = $vC['portal']['arrHost']['scheme'] . '://rist-editors.ri-st.de/';
|
||||||
$svjf['editorVersion'] = '1.0.1';
|
$svjf['editorVersion'] = '1.0.2';
|
||||||
}
|
}
|
||||||
$svjf['webserviceUrl'] = $vC['portal']['hostUrl'] . '/webservices/remote_data.php';
|
$svjf['webserviceUrl'] = $vC['portal']['hostUrl'] . '/webservices/remote_data.php';
|
||||||
$svjf['grid'] = 24;
|
$svjf['grid'] = 24;
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ function fnc_buildUniqueFileName($prefix, $navId, $fileName, $fileExt)
|
|||||||
$return = str_replace($search, $replace, mb_strtolower($fileName, mb_detect_encoding($fileName)));
|
$return = str_replace($search, $replace, mb_strtolower($fileName, mb_detect_encoding($fileName)));
|
||||||
$return = str_replace($ent, '', $return);
|
$return = str_replace($ent, '', $return);
|
||||||
|
|
||||||
$result = glob(PATH_MED . $prefix . '/' . $navId . '/' . $return . '*_orig.' . $fileExt);
|
$result = glob(WEBSERVICE_MED . $prefix . '/' . $navId . '/' . $return . '*_orig.' . $fileExt);
|
||||||
$count = count($result);
|
$count = count($result);
|
||||||
$return = ($count > 0)
|
$return = ($count > 0)
|
||||||
? $return . '_' . $count
|
? $return . '_' . $count
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ $dataSet = explode('_', $_POST['dataSet']);
|
|||||||
$table = (is_numeric(end($dataSet)) || end($dataSet) === '')
|
$table = (is_numeric(end($dataSet)) || end($dataSet) === '')
|
||||||
? implode('_', explode('_', $_POST['dataSet'], -1))
|
? implode('_', explode('_', $_POST['dataSet'], -1))
|
||||||
: $_POST['dataSet'];
|
: $_POST['dataSet'];
|
||||||
$table = ($table === 'keyvisual')
|
$table = ($table === 'keyvisual' || $table === 'image')
|
||||||
? 'content_image'
|
? 'content_image'
|
||||||
: $table;
|
: $table;
|
||||||
if (strpos($table, 'navi_') !== false)
|
if (strpos($table, 'navi_') !== false)
|
||||||
@@ -230,7 +230,16 @@ else if ($_POST['request'] === 'updateData')
|
|||||||
{
|
{
|
||||||
if (isset ($_POST['formAction']) && $_POST['formAction'] === 'updateSort')
|
if (isset ($_POST['formAction']) && $_POST['formAction'] === 'updateSort')
|
||||||
{
|
{
|
||||||
$db->query('UPDATE ' . $_POST['prefix'] . '_' . TBL_NAVI . ' SET ' . $_POST['prefix'] . '_keyvisual = ' . $id . ' WHERE ' . $_POST['prefix'] . '_navId = ' . $_POST['navId'] . ' LIMIT 1;');
|
if (strpos($_POST['dataSet'], 'keyvisual_') !== false)
|
||||||
|
{
|
||||||
|
$db->query('UPDATE ' . $_POST['prefix'] . '_' . TBL_NAVI . ' SET ' . $_POST['prefix'] . '_keyvisual = ' . $id . ' WHERE ' . $_POST['prefix'] . '_navId = ' . $_POST['navId'] . ' LIMIT 1;');
|
||||||
|
}
|
||||||
|
elseif (strpos($_POST['dataSet'], 'content_image') !== false)
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* TODO: update content_textimage Element!
|
||||||
|
*/
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -631,7 +640,7 @@ else if ($_POST['request'] === 'insertData')
|
|||||||
elseif (isset ($_POST['formAction']) && $_POST['formAction'] === 'appendContent')
|
elseif (isset ($_POST['formAction']) && $_POST['formAction'] === 'appendContent')
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* TODO: Eventuell unnötig
|
* TODO: Ist das nötig?
|
||||||
*/
|
*/
|
||||||
$newId = $table . '_' . $db->insert_id;
|
$newId = $table . '_' . $db->insert_id;
|
||||||
$mainSet = explode('_', $_POST['mainContent']);
|
$mainSet = explode('_', $_POST['mainContent']);
|
||||||
@@ -674,18 +683,41 @@ else if ($_POST['request'] === 'insertData')
|
|||||||
else if ($_POST['request'] === 'deleteData')
|
else if ($_POST['request'] === 'deleteData')
|
||||||
{
|
{
|
||||||
$error = false;
|
$error = false;
|
||||||
|
if ($table === 'content_image')
|
||||||
|
{
|
||||||
|
$imageData = $db->query('SELECT * FROM ' . $_POST['prefix'] . '_' . $table . ' WHERE id = ' . $id . ';');
|
||||||
|
$image = $imageData->fetch_assoc();
|
||||||
|
$file_path = WEBSERVICE_MED . $_POST['prefix'] . '/' . $_POST['navId'] . '/' . $image['imgName'];
|
||||||
|
|
||||||
|
/* Alte Bilddaten löschen */
|
||||||
|
unlink($file_path . '.' . $image['imgExtension']);
|
||||||
|
unlink($file_path . '_orig.' . $image['imgExtension']);
|
||||||
|
unlink($file_path . '_thumb.' . $image['imgExtension']);
|
||||||
|
|
||||||
|
$contentData = $db->query('SELECT * FROM ' . $_POST['prefix'] . '_' . $table . ' WHERE id = "' . $_POST['firstImage'] . '";');
|
||||||
|
$content = $contentData->fetch_assoc();
|
||||||
|
$sliderContents = explode(';', $content['sliderContent']);
|
||||||
|
$sliderKey = array_keys($sliderContents, $id);
|
||||||
|
|
||||||
|
if (!empty($sliderKey))
|
||||||
|
{
|
||||||
|
unset($sliderContents[$sliderKey[0]]);
|
||||||
|
$db->query('UPDATE ' . $_POST['prefix'] . '_' . $table . ' SET sliderContent = "' . implode(';', $sliderContents) . '" WHERE id = "' . $content['id'] . '" LIMIT 1;');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$result = ($table === 'content')
|
$result = ($table === 'content')
|
||||||
? $db->query('DELETE FROM ' . $_POST['prefix'] . '_' . $table . ' WHERE siteId = "' . $id . '" LIMIT 1;')
|
? $db->query('DELETE FROM ' . $_POST['prefix'] . '_' . $table . ' WHERE siteId = "' . $id . '" LIMIT 1;')
|
||||||
: $db->query('DELETE FROM ' . $_POST['prefix'] . '_' . $table . ' WHERE id = "' . $id . '" LIMIT 1;');
|
: $db->query('DELETE FROM ' . $_POST['prefix'] . '_' . $table . ' WHERE id = "' . $id . '" LIMIT 1;');
|
||||||
|
|
||||||
if ($result && strpos($table, 'content_') !== false)
|
if ($result && $table !== 'content_image')
|
||||||
{
|
{
|
||||||
$content_part = str_replace('content_', '', $_POST['dataSet']);
|
$content_part = str_replace('content_', '', $_POST['dataSet']);
|
||||||
$content_data = $db->query('SELECT * FROM ' . $_POST['prefix'] . '_' . TBL_CONTENT . ' WHERE siteId = "' . $_POST['navId'] . '";');
|
$content_data = $db->query('SELECT * FROM ' . $_POST['prefix'] . '_' . TBL_CONTENT . ' WHERE siteId = "' . $_POST['navId'] . '";');
|
||||||
|
|
||||||
$content = $content_data->fetch_assoc();
|
$content = $content_data->fetch_assoc();
|
||||||
$siteContents = explode(';', $content['siteContents']);
|
$siteContents = explode(';', $content['siteContents']);
|
||||||
$content_key = array_keys($siteContents, $content_part);
|
$content_key = array_keys($siteContents, $id);
|
||||||
|
|
||||||
if (!empty($content_key))
|
if (!empty($content_key))
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user