Main Template CORE css/js, remove unused JS code, fix method names DB/IO

DB::IO all public names are prefixed with db. All others are set as
deprecated.
This commit is contained in:
Clemens Schwaighofer
2021-02-09 06:49:30 +09:00
parent 50073479d4
commit 80993a06ac
3 changed files with 96 additions and 50 deletions

View File

@@ -16,6 +16,9 @@
{if $STYLESHEET}
<link rel=stylesheet type="text/css" href="{$css}{$STYLESHEET}">
{/if}
{if $CSS_CORE_INCLUDE}
<link rel=stylesheet type="text/css" href="{$CSS_CORE_INCLUDE}">
{/if}
{if $CSS_INCLUDE}
<link rel=stylesheet type="text/css" href="{$CSS_INCLUDE}">
{/if}
@@ -23,9 +26,6 @@
<link rel=stylesheet type="text/css" href="{$CSS_SPECIAL_INCLUDE}">
{/if}
<script language="JavaScript" src="{$js}/firebug.js"></script>
{if $JAVASCRIPT}
<script language="JavaScript" src="{$js}{$JAVASCRIPT}"></script>
{/if}
{if $USE_JQUERY}
{* JQuery *}
<script type="text/javascript" src="{$js}/jquery.min.js"></script>
@@ -37,6 +37,12 @@
<script src="{$js}/scriptaculous/scriptaculous.js" type="text/javascript"></script>
{/if}
{/if}
{if $JAVASCRIPT}
<script language="JavaScript" src="{$js}{$JAVASCRIPT}"></script>
{/if}
{if $JS_CORE_INCLUDE}
<script language="JavaScript" src="{$JS_CORE_INCLUDE}"></script>
{/if}
{if $JS_INCLUDE}
<script language="JavaScript" src="{$JS_INCLUDE}"></script>
{/if}

View File

@@ -1065,35 +1065,6 @@ function html_options_block(name, data, selected = '', multiple = 0, options_onl
element_option = cel('option', '', value, '', options);
// attach it to the select element
ael(element_select, element_option);
/*
// get the original data for this key
var opt_value = r_value[opt_key];
// if it is an object, we assume a sub group [original data]
if (isObject(opt_value)) {
element_group = document.createElement('optgroup');
element_group.label = opt_key;
// loop through attached sub key elements in order (key is orignal)
$.each(data.form_reference_order[key][opt_key], function(opt_group_pos, opt_group_key) {
var opt_group_value = r_value[opt_key][opt_group_key];
element_sub = document.createElement('option');
// check if w is object, if yes, the element is a subset drop down
element_sub.label = opt_group_value;
element_sub.value = opt_group_key;
element_sub.innerHTML = opt_group_value;
element_group.appendChild(element_sub);
});
element.appendChild(element_group);
} else if (!isObject(opt_key)) {
// if this is a plain element, attach as is
// we also skip any objects in the reference order group as they are handled different
element_sub = document.createElement('option');
element_sub.label = opt_value;
element_sub.value = opt_key;
element_sub.innerHTML = opt_value;
element.appendChild(element_sub);
}
*/
}
// if with select part, convert to text
if (!options_only) {

View File

@@ -2037,7 +2037,7 @@ class IO extends \CoreLibs\Basic
* Empty string for unset
* Null for error
*/
public function getReturning()
public function dbGetReturning()
{
return $this->insert_id;
}
@@ -2049,9 +2049,9 @@ class IO extends \CoreLibs\Basic
* Empty string for unset
* Null for error
*/
public function getInsertPK()
public function dbGetInsertPK()
{
return $this->getReturning();
return $this->dbGetReturning();
}
/**
@@ -2064,7 +2064,7 @@ class IO extends \CoreLibs\Basic
* Empty string for unset
* Null for error
*/
public function getReturningExt($key = null)
public function dbGetReturningExt($key = null)
{
if ($key !== null) {
if (isset($this->insert_id_ext[$key])) {
@@ -2076,18 +2076,6 @@ class IO extends \CoreLibs\Basic
return $this->insert_id_ext;
}
/**
* old call for getInserReturnExt
* @param string|null $key See above
* @return array|string|null See above
* @deprecated use getReturningExt($key = null) instead
*/
public function getInsertReturn($key = null)
{
trigger_error('Method '.__METHOD__.' is deprecated, use getReturningExt($key = null)', E_USER_DEPRECATED);
return $this->getReturningExt($key);
}
/**
* returns the full array for cursor ext
* @param string|null $q Query string, if not null convert to md5
@@ -2096,7 +2084,7 @@ class IO extends \CoreLibs\Basic
* @return array|null Cursor Extended array
* Key is md5 string from query run
*/
public function getCursorExt($q = null)
public function dbGetCursorExt($q = null)
{
if ($q !== null) {
$q_md5 = md5($q);
@@ -2115,10 +2103,91 @@ class IO extends \CoreLibs\Basic
* null on empty
* @return int|null Number of rows
*/
public function getNumRows()
public function dbGetNumRows()
{
return $this->num_rows ?? null;
}
/**
* Switches db debug flag on or off
* returns current set stats
* @return bool True for debug is on, False for off
*/
public function dbToggleDebug()
{
return $this->db_debug = $this->db_debug ? false : true;
}
// DEPEREACTED CALLS
/**
* old call for getInserReturnExt
* @param string|null $key See above
* @return array|string|null See above
* @deprecated use getReturningExt($key = null) instead
*/
public function getInsertReturn($key = null)
{
trigger_error('Method '.__METHOD__.' is deprecated, use getReturningExt($key = null)', E_USER_DEPRECATED);
return $this->dbGetReturningExt($key);
}
/**
* DEPRECATED: getReturning
* @return array|string|int|null [DEPRECATED]
* @deprecated use dbGetReturning() instead
*/
public function getReturning()
{
trigger_error('Method '.__METHOD__.' is deprecated, use dbGetReturning()', E_USER_DEPRECATED);
return $this->dbGetReturning();
}
/**
* DEPRECATED: getInsertPK
* @return array|string|int|null [DEPRECATED]
* @deprecated use dbGetInsertPK() instead
*/
public function getInsertPK()
{
trigger_error('Method '.__METHOD__.' is deprecated, use dbGetInsertPK()', E_USER_DEPRECATED);
return $this->dbGetReturning();
}
/**
* DEPRECATED: getReturningExt
* @param string|null $lkey [DEPRECATED]
* @return array|string|null [DEPRECATED]
* @deprecated use dbGetReturningExt($key = null) instead
*/
public function getReturningExt($key = null)
{
trigger_error('Method '.__METHOD__.' is deprecated, use dbGetReturningExt($key = null)', E_USER_DEPRECATED);
return $this->dbGetReturningExt($key);
}
/**
* DEPRECATED: getCursorExt
* @param string|null $q [DEPRECATED]
* @return array|null [DEPRECATED]
* @deprecated use dbGetCursorExt($q = null) instead
*/
public function getCursorExt($q = null)
{
trigger_error('Method '.__METHOD__.' is deprecated, use dbGetCursorExt($q = null)', E_USER_DEPRECATED);
return $this->dbGetCursorExt($q);
}
/**
* DEPRECATED: getNumRows
* @return int|null [DEPRECATED]
* @deprecated use dbGetNumRows() instead
*/
public function getNumRows()
{
trigger_error('Method '.__METHOD__.' is deprecated, use dbGetNumRows()', E_USER_DEPRECATED);
return $this->getNumRows();
}
} // end if db class
// __END__