Author: dgoette
Date: Fri Feb 27 16:22:34 2009
New Revision: 39785
URL: http://svn.reactos.org/svn/reactos?rev=39785&view=rev
Log:
fix typo :)
no code change
Added:
branches/danny-web/reactos.org/htdocs/roscms/lib/om/Dependencies.class.php
- copied, changed from r39677, branches/danny-web/reactos.org/htdocs/roscms/lib/om/Depencies.class.php
Removed:
branches/danny-web/reactos.org/htdocs/roscms/lib/om/Depencies.class.php
Modified:
branches/danny-web/reactos.org/htdocs/roscms/config.phpbranches/danny-web/reactos.org/htdocs/roscms/convert3to4.sqlbranches/danny-web/reactos.org/htdocs/roscms/js/cms_maintain.jsbranches/danny-web/reactos.org/htdocs/roscms/js/cms_website.jsbranches/danny-web/reactos.org/htdocs/roscms/lib/backend/Backend_EntryTable…branches/danny-web/reactos.org/htdocs/roscms/lib/backend/Backend_Maintain.c…branches/danny-web/reactos.org/htdocs/roscms/lib/backend/Backend_ViewEditor…branches/danny-web/reactos.org/htdocs/roscms/lib/om/Entry.class.phpbranches/danny-web/reactos.org/htdocs/roscms/lib/om/Generate.class.phpbranches/danny-web/reactos.org/htdocs/roscms/lib/om/Revision.class.phpbranches/danny-web/reactos.org/htdocs/roscms/lib/view/HTML_CMS_Maintain.cla…
Modified: branches/danny-web/reactos.org/htdocs/roscms/config.php
URL: http://svn.reactos.org/svn/reactos/branches/danny-web/reactos.org/htdocs/ro…
==============================================================================
--- branches/danny-web/reactos.org/htdocs/roscms/config.php [iso-8859-1] (original)
+++ branches/danny-web/reactos.org/htdocs/roscms/config.php [iso-8859-1] Fri Feb 27 16:22:34 2009
@@ -53,28 +53,28 @@
// RosCMS Table Names
-$config->setTable('ROSCMST_AREA' , 'roscms_area');
-$config->setTable('ROSCMST_USERS' , 'roscms_accounts');
-$config->setTable('ROSCMST_FORBIDDEN' , 'roscms_accounts_forbidden');
-$config->setTable('ROSCMST_SESSIONS' , 'roscms_accounts_sessions');
-$config->setTable('ROSCMST_COUNTRIES' , 'roscms_countries');
-$config->setTable('ROSCMST_ENTRIES' , 'roscms_entries');
-$config->setTable('ROSCMST_ACCESS' , 'roscms_entries_access');
-$config->setTable('ROSCMST_RIGHTS' , 'roscms_entries_areas');
-$config->setTable('ROSCMST_REVISIONS' , 'roscms_entries_revisions');
-$config->setTable('ROSCMST_STEXT' , 'roscms_entries_stext');
-$config->setTable('ROSCMST_TAGS' , 'roscms_entries_tags');
-$config->setTable('ROSCMST_TEXT' , 'roscms_entries_text');
-$config->setTable('ROSCMST_FILTER' , 'roscms_filter');
-$config->setTable('ROSCMST_GROUPS' , 'roscms_groups');
-$config->setTable('ROSCMST_JOBS' , 'roscms_jobs');
-$config->setTable('ROSCMST_LANGUAGES' , 'roscms_languages');
-$config->setTable('ROSCMST_SUBSYS' , 'roscms_rel_accounts_subsys');
-$config->setTable('ROSCMST_MEMBERSHIPS', 'roscms_rel_groups_accounts');
-$config->setTable('ROSCMST_AREA_ACCESS', 'roscms_rel_groups_area');
-$config->setTable('ROSCMST_DEPENCIES' , 'roscms_rel_revisions_depencies');
-$config->setTable('ROSCMST_ACL' , 'roscms_rel_acl');
-$config->setTable('ROSCMST_TIMEZONES' , 'roscms_timezones');
+$config->setTable('ROSCMST_AREA' , 'roscms_area');
+$config->setTable('ROSCMST_USERS' , 'roscms_accounts');
+$config->setTable('ROSCMST_FORBIDDEN' , 'roscms_accounts_forbidden');
+$config->setTable('ROSCMST_SESSIONS' , 'roscms_accounts_sessions');
+$config->setTable('ROSCMST_COUNTRIES' , 'roscms_countries');
+$config->setTable('ROSCMST_ENTRIES' , 'roscms_entries');
+$config->setTable('ROSCMST_ACCESS' , 'roscms_entries_access');
+$config->setTable('ROSCMST_RIGHTS' , 'roscms_entries_areas');
+$config->setTable('ROSCMST_REVISIONS' , 'roscms_entries_revisions');
+$config->setTable('ROSCMST_STEXT' , 'roscms_entries_stext');
+$config->setTable('ROSCMST_TAGS' , 'roscms_entries_tags');
+$config->setTable('ROSCMST_TEXT' , 'roscms_entries_text');
+$config->setTable('ROSCMST_FILTER' , 'roscms_filter');
+$config->setTable('ROSCMST_GROUPS' , 'roscms_groups');
+$config->setTable('ROSCMST_JOBS' , 'roscms_jobs');
+$config->setTable('ROSCMST_LANGUAGES' , 'roscms_languages');
+$config->setTable('ROSCMST_SUBSYS' , 'roscms_rel_accounts_subsys');
+$config->setTable('ROSCMST_MEMBERSHIPS' , 'roscms_rel_groups_accounts');
+$config->setTable('ROSCMST_AREA_ACCESS' , 'roscms_rel_groups_area');
+$config->setTable('ROSCMST_DEPENDENCIES' , 'roscms_rel_revisions_dependencies');
+$config->setTable('ROSCMST_ACL' , 'roscms_rel_acl');
+$config->setTable('ROSCMST_TIMEZONES' , 'roscms_timezones');
// do not change, it's needed to apply those config settings
$config->apply();
Modified: branches/danny-web/reactos.org/htdocs/roscms/convert3to4.sql
URL: http://svn.reactos.org/svn/reactos/branches/danny-web/reactos.org/htdocs/ro…
==============================================================================
--- branches/danny-web/reactos.org/htdocs/roscms/convert3to4.sql [iso-8859-1] (original)
+++ branches/danny-web/reactos.org/htdocs/roscms/convert3to4.sql [iso-8859-1] Fri Feb 27 16:22:34 2009
@@ -107,9 +107,9 @@
-- --------------------------------------------------------
--- create depency table (nothing to convert, as it's new and will be filled later)
--- --------------------------------------------------------
-CREATE TABLE roscms_rel_revisions_depencies (
+-- create dependency table (nothing to convert, as it's new and will be filled later)
+-- --------------------------------------------------------
+CREATE TABLE roscms_rel_revisions_dependencies (
id bigint(20) NOT NULL auto_increment,
rev_id bigint(20) unsigned NOT NULL COMMENT '->revisions(id)',
child_id bigint(20) unsigned default NULL COMMENT '->entries(id)',
@@ -120,7 +120,7 @@
KEY rev_id (rev_id),
KEY child_id (child_id),
KEY child_name (child_name)
-) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='if depency_id is NULL-> set name & type';
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='if dependency_id is NULL-> set name & type';
@@ -170,7 +170,7 @@
(3, 'View History', 'history', 'view History tab'),
(4, 'View Fields', 'fields', 'view fields tab'),
(5, 'View Revision Tab', 'revision', 'view revision tab'),
-(6, 'View Depencies', 'depencies', 'view depencies tab'),
+(6, 'View Dependencies', 'dependencies', 'view dependencies tab'),
(7, 'System metadata', 'system_meta', 'modify System metadata'),
(8, 'Add Fields', 'add_fields', 'add new text fields'),
(9, 'Read', 'read', 'can view this entry');
@@ -218,7 +218,7 @@
OR (s.sec_allow LIKE CONCAT('%',s.sec_allow,'%') AND r.name_short='translate')
OR (g.security_level = 3 AND r.name_short='system_meta')
-OR (g.security_level > 1 AND r.name_short='depencies')
+OR (g.security_level > 1 AND r.name_short='dependencies')
OR r.name_short = 'metadata'
OR r.name_short = 'history')
@@ -277,7 +277,7 @@
(34, 'Show all filter', 'dont_hide_filter', 'don''t hide filter from users'),
(35, 'Make Entries Stable', 'make_stable', 'Make Entries Stable'),
(36, 'show system entries', 'show_sys_entry', 'show entries of type ''system'''),
-(37, 'Add manuel depencies', 'add_depencies', 'add new manuell depencies to entries');
+(37, 'Add manuel dependencies', 'add_dependencies', 'add new manuell dependencies to entries');
@@ -296,7 +296,7 @@
WHERE ((a.name_short = 'system_tags' OR a.name_short = 'entry_details' OR a.name_short = 'new_entry' OR a.name_short = 'deltag' OR a.name_short = 'del_entry' OR a.name_short = 'mix_priv_pub' OR a.name_short = 'show_sys_entry' OR a.name_short = 'addlvl1group' OR a.name_short = 'more_filter' OR a.name_short = 'make_stable' OR a.name_short = 'dont_hide_filter')
AND g.security_level > 1)
-OR ((a.name_short = 'delete_file' OR a.name_short = 'delmembership' OR a.name_short = 'disableaccount' OR a.name_short = 'user_details' OR a.name_short = 'other_drafts' OR a.name_short = 'stats' OR a.name_short = 'dynamic_pages' OR a.name_short = 'updatetag' OR a.name_short = 'del_wo_archiv' OR a.name_short = 'addlvl2group' OR a.name_short = 'user' OR a.name_short = 'addmembership' OR a.name_short = 'maintain' OR a.name_short = 'admin_filter' OR a.name_short = 'add_depencies')
+OR ((a.name_short = 'delete_file' OR a.name_short = 'delmembership' OR a.name_short = 'disableaccount' OR a.name_short = 'user_details' OR a.name_short = 'other_drafts' OR a.name_short = 'stats' OR a.name_short = 'dynamic_pages' OR a.name_short = 'updatetag' OR a.name_short = 'del_wo_archiv' OR a.name_short = 'addlvl2group' OR a.name_short = 'user' OR a.name_short = 'addmembership' OR a.name_short = 'maintain' OR a.name_short = 'admin_filter' OR a.name_short = 'add_dependencies')
AND g.security_level = 3)
OR ((a.name_short = 'admin' OR a.name_short = 'logs' OR a.name_short = 'addlvl3group')
@@ -721,19 +721,6 @@
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
INSERT INTO roscms_accounts_sessions SELECT * FROM user_sessions;
-
-
-
--- --------------------------------------------------------
--- create jobs (e.g. stuff that has to be performed while generating pages)
--- --------------------------------------------------------
-CREATE TABLE roscms_jobs (
- id bigint(20) unsigned NOT NULL,
- name varchar(32) collate utf8_unicode_ci NOT NULL,
- content text collate utf8_unicode_ci NOT NULL,
- PRIMARY KEY (id),
- KEY name (name)
-) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
Modified: branches/danny-web/reactos.org/htdocs/roscms/js/cms_maintain.js
URL: http://svn.reactos.org/svn/reactos/branches/danny-web/reactos.org/htdocs/ro…
==============================================================================
--- branches/danny-web/reactos.org/htdocs/roscms/js/cms_maintain.js [iso-8859-1] (original)
+++ branches/danny-web/reactos.org/htdocs/roscms/js/cms_maintain.js [iso-8859-1] Fri Feb 27 16:22:34 2009
@@ -110,16 +110,16 @@
/**
- * rebuild the depency tree
- */
-function rebuildDepencies( )
+ * rebuild the dependency tree
+ */
+function rebuildDependencies( )
{
var uf_check = confirm("Do you want to continue?");
if (uf_check) {
document.getElementById('maintainarea').style.display = 'block';
- document.getElementById('maintainarea').innerHTML = 'rebuilding depencies, this may take a while ...';
- makeRequest('?page=backend&type=maintain&action=rebuilddepencies', 'gen', '', 'text', 'GET');
+ document.getElementById('maintainarea').innerHTML = 'rebuilding dependencies, this may take a while ...';
+ makeRequest('?page=backend&type=maintain&action=rebuilddependencies', 'gen', '', 'text', 'GET');
}
}
Modified: branches/danny-web/reactos.org/htdocs/roscms/js/cms_website.js
URL: http://svn.reactos.org/svn/reactos/branches/danny-web/reactos.org/htdocs/ro…
==============================================================================
--- branches/danny-web/reactos.org/htdocs/roscms/js/cms_website.js [iso-8859-1] (original)
+++ branches/danny-web/reactos.org/htdocs/roscms/js/cms_website.js [iso-8859-1] Fri Feb 27 16:22:34 2009
@@ -1053,14 +1053,14 @@
/**
- * requests the depencies tab in the entry details
+ * requests the dependencies tab in the entry details
*
* @param int drid revision id
*/
-function showEditorTabDepencies( drid )
-{
- makeRequest('?page=backend&type=text&subtype=mef&d_fl=showdepencies&d_r_id='+drid, 'mef', 'frmedittagsc2', 'html', 'GET', '');
-} // end of function showEditorTabDepencies
+function showEditorTabDependencies( drid )
+{
+ makeRequest('?page=backend&type=text&subtype=mef&d_fl=showdependencies&d_r_id='+drid, 'mef', 'frmedittagsc2', 'html', 'GET', '');
+} // end of function showEditorTabDependencies
@@ -1570,9 +1570,9 @@
alertbox('Entry updated');
break;
- case 'updatedepencies':
+ case 'updatedependencies':
alertbox(http_request.responseText);
- makeRequest('?page=backend&type=text&subtype=mef&d_fl=showdepencies&d_r_id='+document.getElementById('mefrrevid').innerHTML, 'mef', 'frmedittagsc2', 'html', 'GET', '');
+ makeRequest('?page=backend&type=text&subtype=mef&d_fl=showdependencies&d_r_id='+document.getElementById('mefrrevid').innerHTML, 'mef', 'frmedittagsc2', 'html', 'GET', '');
break;
case 'updatetag':
@@ -2027,31 +2027,31 @@
/**
- * add a new manual depency
+ * add a new manual dependency
*
* @param int rev_id
*/
-function addDepency( rev_id )
+function addDependency( rev_id )
{
var name = document.getElementById('dep_name').value;
// check if name is given
if (name !== '') {
- makeRequest('?page=backend&type=text&subtype=mef&d_fl=adddepency&rev_id='+rev_id+'&dep_name='+encodeURIComponent(name)+'&dep_type='+encodeURIComponent(document.getElementById('dep_type').value), 'mef', 'updatedepencies', 'html', 'GET', '');
- }
-} // addDepency
-
-
-
-/**
- * delete a new manual depency
- *
- * @param int dep_id depency id
- */
-function deleteDepency( dep_id )
-{
- makeRequest('?page=backend&type=text&subtype=mef&d_fl=deletedepency&dep_id='+dep_id, 'mef', 'updatedepencies', 'html', 'GET', '');
-} // deleteDepency
+ makeRequest('?page=backend&type=text&subtype=mef&d_fl=adddependency&rev_id='+rev_id+'&dep_name='+encodeURIComponent(name)+'&dep_type='+encodeURIComponent(document.getElementById('dep_type').value), 'mef', 'updatedependencies', 'html', 'GET', '');
+ }
+} // addDependency
+
+
+
+/**
+ * delete a new manual dependency
+ *
+ * @param int dep_id dependency id
+ */
+function deleteDependency( dep_id )
+{
+ makeRequest('?page=backend&type=text&subtype=mef&d_fl=deletedependency&dep_id='+dep_id, 'mef', 'updatedependencies', 'html', 'GET', '');
+} // deleteDependency
Modified: branches/danny-web/reactos.org/htdocs/roscms/lib/backend/Backend_EntryTable…
URL: http://svn.reactos.org/svn/reactos/branches/danny-web/reactos.org/htdocs/ro…
==============================================================================
--- branches/danny-web/reactos.org/htdocs/roscms/lib/backend/Backend_EntryTable… [iso-8859-1] (original)
+++ branches/danny-web/reactos.org/htdocs/roscms/lib/backend/Backend_EntryTable… [iso-8859-1] Fri Feb 27 16:22:34 2009
@@ -277,10 +277,10 @@
}
}
- // update depencies for new rev
- $depency = new Depencies();
- if (!$depency->addRevision($revision['id'])) {
- echo 'Error while updating depencies';
+ // update dependencies for new rev
+ $dependency = new Dependencies();
+ if (!$dependency->addRevision($revision['id'])) {
+ echo 'Error while updating dependencies';
return false;
}
Modified: branches/danny-web/reactos.org/htdocs/roscms/lib/backend/Backend_Maintain.c…
URL: http://svn.reactos.org/svn/reactos/branches/danny-web/reactos.org/htdocs/ro…
==============================================================================
--- branches/danny-web/reactos.org/htdocs/roscms/lib/backend/Backend_Maintain.c… [iso-8859-1] (original)
+++ branches/danny-web/reactos.org/htdocs/roscms/lib/backend/Backend_Maintain.c… [iso-8859-1] Fri Feb 27 16:22:34 2009
@@ -46,8 +46,8 @@
$this->generateAll();
break;
- case 'rebuilddepencies':
- $this->rebuildDepencies();
+ case 'rebuilddependencies':
+ $this->rebuildDependencies();
break;
case 'genone':
@@ -66,7 +66,7 @@
private function optimize( )
{
// call optimize table MySQL function
- $stmt=&DBConnection::getInstance()->prepare("OPTIMIZE TABLE ".ROSCMST_AREA.",".ROSCMST_USERS.",".ROSCMST_FORBIDDEN.",".ROSCMST_SESSIONS.",".ROSCMST_COUNTRIES.",".ROSCMST_ENTRIES.",".ROSCMST_ACCESS.",".ROSCMST_RIGHTS.",".ROSCMST_REVISIONS.",".ROSCMST_STEXT.",".ROSCMST_TAGS.",".ROSCMST_TEXT.",".ROSCMST_FILTER.",".ROSCMST_GROUPS.",".ROSCMST_JOBS.",".ROSCMST_LANGUAGES.",".ROSCMST_SUBSYS.",".ROSCMST_MEMBERSHIPS.",".ROSCMST_AREA_ACCESS.",".ROSCMST_DEPENCIES.",".ROSCMST_ACL.",".ROSCMST_TIMEZONES);
+ $stmt=&DBConnection::getInstance()->prepare("OPTIMIZE TABLE ".ROSCMST_AREA.",".ROSCMST_USERS.",".ROSCMST_FORBIDDEN.",".ROSCMST_SESSIONS.",".ROSCMST_COUNTRIES.",".ROSCMST_ENTRIES.",".ROSCMST_ACCESS.",".ROSCMST_RIGHTS.",".ROSCMST_REVISIONS.",".ROSCMST_STEXT.",".ROSCMST_TAGS.",".ROSCMST_TEXT.",".ROSCMST_FILTER.",".ROSCMST_GROUPS.",".ROSCMST_JOBS.",".ROSCMST_LANGUAGES.",".ROSCMST_SUBSYS.",".ROSCMST_MEMBERSHIPS.",".ROSCMST_AREA_ACCESS.",".ROSCMST_DEPENDENCIES.",".ROSCMST_ACL.",".ROSCMST_TIMEZONES);
$stmt->execute();
Log::writeHigh('optimize database tables: done by '.ThisUser::getInstance()->id().' {data_maintain_out}');
@@ -140,21 +140,21 @@
*
* @access private
*/
- private function rebuildDepencies( )
+ private function rebuildDependencies( )
{
- Log::writeGenerateHigh('rebuilding depency tree - start');
+ Log::writeGenerateHigh('rebuilding dependency tree - start');
// start timer
$gentimeA = explode(' ',microtime());
$gentimeA = $gentimeA[1] + $gentimeA[0];
- // rebuild depencies
- $depencies = new Depencies();
- if ($depencies->rebuild()) {
+ // rebuild dependencies
+ $dependencies = new Dependencies();
+ if ($dependencies->rebuild()) {
echo 'done';
}
else {
- echo 'Error: a problem occoured while rebuilding depencies';
+ echo 'Error: a problem occoured while rebuilding dependencies';
}
// stop timer
@@ -165,8 +165,8 @@
$totaltimef = ($gentimeB - $gentimeA);
$showtimef = number_format($totaltimef, 4, '.', '');
- Log::writeGenerateHigh('rebuilding depency tree - end: '.$showtimef.' seconds');
- } // end of member function rebuildDepencies
+ Log::writeGenerateHigh('rebuilding dependency tree - end: '.$showtimef.' seconds');
+ } // end of member function rebuildDependencies
Modified: branches/danny-web/reactos.org/htdocs/roscms/lib/backend/Backend_ViewEditor…
URL: http://svn.reactos.org/svn/reactos/branches/danny-web/reactos.org/htdocs/ro…
==============================================================================
--- branches/danny-web/reactos.org/htdocs/roscms/lib/backend/Backend_ViewEditor… [iso-8859-1] (original)
+++ branches/danny-web/reactos.org/htdocs/roscms/lib/backend/Backend_ViewEditor… [iso-8859-1] Fri Feb 27 16:22:34 2009
@@ -31,12 +31,12 @@
// Type of detail
- const METADATA = 0;
- const FIELDS = 1;
- const HISTORY = 2;
- const SECURITY = 3;
- const REVISION = 4;
- const DEPENCIES= 5;
+ const METADATA = 0;
+ const FIELDS = 1;
+ const HISTORY = 2;
+ const SECURITY = 3;
+ const REVISION = 4;
+ const DEPENDENCIES = 5;
//
private $data_id;
@@ -109,28 +109,28 @@
$this->showEntryDetails(self::HISTORY);
break;
- // show Depencies
- case 'showdepencies':
- $this->showEntryDetails(self::DEPENCIES);
- break;
-
- // add Depencies
- case 'adddepency':
- if (Depencies::addManual($_GET['rev_id'],$_GET['dep_name'],$_GET['dep_type'])) {
- echo 'Adding user defined depency was successful.';
+ // show dependencies
+ case 'showdependencies':
+ $this->showEntryDetails(self::DEPENDENCIES);
+ break;
+
+ // add dependencies
+ case 'adddependency':
+ if (Dependencies::addManual($_GET['rev_id'],$_GET['dep_name'],$_GET['dep_type'])) {
+ echo 'Adding user defined dependency was successful.';
}
else {
- echo 'Error while adding user defined depency.';
+ echo 'Error while adding user defined dependency.';
}
break;
- // delete Depencies
- case 'deletedepency':
- if (Depencies::deleteManual($_GET['dep_id'])) {
- echo 'Deleting user defined depency was successful.';
+ // delete dependencies
+ case 'deletedependency':
+ if (Dependencies::deleteManual($_GET['dep_id'])) {
+ echo 'Deleting user defined dependency was successful.';
}
else {
- echo 'Error while deleting user defined depency.';
+ echo 'Error while deleting user defined dependency.';
}
break;
@@ -455,15 +455,15 @@
}
}
- // Depencies
- if (Entry::hasAccess($this->data_id,'depencies')) {
+ // dependencies
+ if (Entry::hasAccess($this->data_id,'dependencies')) {
echo ' | ';
- if ($mode == self::DEPENCIES) {
- echo '<strong>Depencies</strong>';
+ if ($mode == self::DEPENDENCIES) {
+ echo '<strong>Dependencies</strong>';
}
else {
- echo '<span class="detailmenu" onclick="'."showEditorTabDepencies(".$this->rev_id.")".'">Depencies</span>';
+ echo '<span class="detailmenu" onclick="'."showEditorTabDependencies(".$this->rev_id.")".'">Dependencies</span>';
}
}
@@ -518,8 +518,8 @@
case self::HISTORY:
$this->showEntryDetailsHistory();
break;
- case self::DEPENCIES:
- $this->showEntryDepencies($this->data_id);
+ case self::DEPENDENCIES:
+ $this->showEntryDependencies($this->data_id);
break;
case self::SECURITY:
$this->showEntryDetailsEntry();
@@ -650,17 +650,17 @@
/**
- * Interface for depenciess
- *
- * @access private
- */
- private function showEntryDepencies()
+ * Interface for dependencies
+ *
+ * @access private
+ */
+ private function showEntryDependencies()
{
- // add manual depency
- if (ThisUser::getInstance()->hasAccess('add_depencies')) {
+ // add manual dependency
+ if (ThisUser::getInstance()->hasAccess('add_dependencies')) {
echo_strip('
- <h3>Add Depency</h3>
+ <h3>Add Dependency</h3>
<fieldset>
<label for="dep_name">Name:</label>
<input type="text" name="dep_name" id="dep_name" /><br />
@@ -671,22 +671,22 @@
<option value="script">Script</option>
'.(ThisUser::getInstance()->hasAccess('dynamic_pages') ? '<option value="dynamic">Dynamic Page</option>' : '').'
</select><br />
- <button type="submit" onclick="'."addDepency(".$this->rev_id.")".'">add manual depency</button>
+ <button type="submit" onclick="'."addDependency(".$this->rev_id.")".'">add manual dependency</button>
</fieldset>');
}
- // print depency tree
+ // print dependency tree
echo '<h3>Dependent Entries</h3>';
- $this->buildDepencyTree($this->data_id);
+ $this->buildDependencyTree($this->data_id);
// required articles that don't exist
- $stmt=&DBConnection::getInstance()->prepare("SELECT DISTINCT child_name, include, id, user_defined FROM ".ROSCMST_DEPENCIES." WHERE rev_id=:rev_id AND child_id IS NULL ORDER BY include DESC, child_name ASC");
+ $stmt=&DBConnection::getInstance()->prepare("SELECT DISTINCT child_name, include, id, user_defined FROM ".ROSCMST_DEPENDENCIES." WHERE rev_id=:rev_id AND child_id IS NULL ORDER BY include DESC, child_name ASC");
$stmt->bindParam('rev_id',$this->rev_id, PDO::PARAM_INT);
$stmt->execute();
$required_fail = $stmt->fetchAll(PDO::FETCH_ASSOC);
// articles that exist
- $stmt=&DBConnection::getInstance()->prepare("SELECT DISTINCT d.name, d.type, w.include, w.id, w.user_defined FROM ".ROSCMST_DEPENCIES." w JOIN ".ROSCMST_ENTRIES." d ON d.id=w.child_id WHERE rev_id=:rev_id AND w.child_name IS NULL ORDER BY w.include DESC, d.name ASC, d.type ASC");
+ $stmt=&DBConnection::getInstance()->prepare("SELECT DISTINCT d.name, d.type, w.include, w.id, w.user_defined FROM ".ROSCMST_DEPENDENCIES." w JOIN ".ROSCMST_ENTRIES." d ON d.id=w.child_id WHERE rev_id=:rev_id AND w.child_name IS NULL ORDER BY w.include DESC, d.name ASC, d.type ASC");
$stmt->bindParam('rev_id',$this->rev_id, PDO::PARAM_INT);
$stmt->execute();
$required_exist = $stmt->fetchAll(PDO::FETCH_ASSOC);
@@ -700,9 +700,9 @@
foreach($required_exist as $required) {
echo '<li>['.$required['type'].'] '.$required['name'].' ('.($required['include']==true ? 'include' : 'link').')';
- // delete manual depency
- if (ThisUser::getInstance()->hasAccess('add_depencies') && $required['user_defined']) {
- echo ' <span class="deletebutton" onclick="'."deleteDepency(".$required['id'].")".'"><img src="'.RosCMS::getInstance()->pathRosCMS().'images/remove.gif" alt="" /> Delete</span>';
+ // delete manual dependency
+ if (ThisUser::getInstance()->hasAccess('add_dependencies') && $required['user_defined']) {
+ echo ' <span class="deletebutton" onclick="'."deleteDependency(".$required['id'].")".'"><img src="'.RosCMS::getInstance()->pathRosCMS().'images/remove.gif" alt="" /> Delete</span>';
}
echo '</li>';
@@ -717,9 +717,9 @@
foreach($required_fail as $required) {
echo '<li>'.$required['child_name'].' ('.($required['include']==true ? 'include' : 'link').')';
- // delete manual depency
- if (ThisUser::getInstance()->hasAccess('add_depencies') && $required['user_defined']) {
- echo ' <span class="deletebutton" onclick="'."deleteDepency(".$required['id'].")".'"><img src="'.RosCMS::getInstance()->pathRosCMS().'images/remove.gif" alt="" /> Delete</span>';
+ // delete manual dependency
+ if (ThisUser::getInstance()->hasAccess('add_dependencies') && $required['user_defined']) {
+ echo ' <span class="deletebutton" onclick="'."deleteDependency(".$required['id'].")".'"><img src="'.RosCMS::getInstance()->pathRosCMS().'images/remove.gif" alt="" /> Delete</span>';
}
echo '</li>';
@@ -727,37 +727,37 @@
echo '</ul>';
}
}
- } // end of member function showEntryDepencies
-
-
-
- /**
- * recursive function to build our depency tree
- *
- * @access private
- */
- private function buildDepencyTree( $data_id )
+ } // end of member function showEntryDependencies
+
+
+
+ /**
+ * recursive function to build our dependency tree
+ *
+ * @access private
+ */
+ private function buildDependencyTree( $data_id )
{
// get current childs
- $stmt=&DBConnection::getInstance()->prepare("SELECT d.name, l.name AS language, d.type, r.data_id, w.user_defined, w.id FROM ".ROSCMST_DEPENCIES." w JOIN ".ROSCMST_REVISIONS." r ON w.rev_id = r.id JOIN ".ROSCMST_ENTRIES." d ON d.id=r.data_id JOIN ".ROSCMST_LANGUAGES." l ON l.id=r.lang_id WHERE w.child_id=:data_id AND w.include IS TRUE ORDER BY l.name ASC, d.name ASC");
+ $stmt=&DBConnection::getInstance()->prepare("SELECT d.name, l.name AS language, d.type, r.data_id, w.user_defined, w.id FROM ".ROSCMST_DEPENDENCIES." w JOIN ".ROSCMST_REVISIONS." r ON w.rev_id = r.id JOIN ".ROSCMST_ENTRIES." d ON d.id=r.data_id JOIN ".ROSCMST_LANGUAGES." l ON l.id=r.lang_id WHERE w.child_id=:data_id AND w.include IS TRUE ORDER BY l.name ASC, d.name ASC");
$stmt->bindParam('data_id',$data_id, PDO::PARAM_INT);
$stmt->execute();
- $depencies = $stmt->fetchAll(PDO::FETCH_ASSOC);
+ $dependencies = $stmt->fetchAll(PDO::FETCH_ASSOC);
// output childs
- if (count($depencies) > 0) {
+ if (count($dependencies) > 0) {
echo '<ul>';
- // show Depencies
+ // show dependencies
$x=0;
- foreach ($depencies as $depency) {
+ foreach ($dependencies as $dependency) {
$x++;
- echo '<li style="color: #'.($x%2 ? '000' : '777').';">['.$depency['type'].'] '.$depency['name'].' <span style="color: #'.($x%2 ? 'AAA' : 'CCC').';">('.$depency['language'].')</span>';
+ echo '<li style="color: #'.($x%2 ? '000' : '777').';">['.$dependency['type'].'] '.$dependency['name'].' <span style="color: #'.($x%2 ? 'AAA' : 'CCC').';">('.$dependency['language'].')</span>';
// get childs
- if ($data_id != $depency['data_id']) {
- $this->buildDepencyTree( $depency['data_id']);
+ if ($data_id != $dependency['data_id']) {
+ $this->buildDependencyTree( $dependency['data_id']);
}
echo '</li>';
} // end foreach
@@ -767,7 +767,7 @@
elseif ($this->data_id === $data_id) {
echo 'Looks like, no other entries depend on this entry.';
}
- } // end of member function buildDepencyTree
+ } // end of member function buildDependencyTree
Removed: branches/danny-web/reactos.org/htdocs/roscms/lib/om/Depencies.class.php
URL: http://svn.reactos.org/svn/reactos/branches/danny-web/reactos.org/htdocs/ro…
==============================================================================
--- branches/danny-web/reactos.org/htdocs/roscms/lib/om/Depencies.class.php [iso-8859-1] (original)
+++ branches/danny-web/reactos.org/htdocs/roscms/lib/om/Depencies.class.php (removed)
@@ -1,296 +1,0 @@
-<?php
- /*
- RosCMS - ReactOS Content Management System
- Copyright (C) 2008 Danny Götte <dangerground(a)web.de>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-
-
-/**
- * @class Depencies
- *
- * Revisions are dependent from other entries, that means a revision can be dependent from a revision of the same language, or as fallback to any other language, preferable to the standard language
- * if not entry id exists, only a depency to the name is saved
- *
- */
-class Depencies
-{
-
- private $rev_id = 0;
- private $short = array('content'=>'cont','script'=>'include','page'=>'link','dynamic'=>'link');
-
-
-
- /**
- * delete the old tree, and build it new
- *
- * @return bool
- * @access public
- */
- public function rebuild( )
- {
- // try to force unlimited script runtime
- @set_time_limit(0);
-
- // remove old depencies
- DBConnection::getInstance()->exec("DELETE FROM ".ROSCMST_DEPENCIES." WHERE user_defined IS FALSE");
-
- // walk trough all stable
- $stmt=&DBConnection::getInstance()->prepare("SELECT id FROM ".ROSCMST_REVISIONS." WHERE archive IS FALSE AND status='stable'");
- if ($stmt->execute()) {
- while ($revision = $stmt->fetch(PDO::FETCH_ASSOC)) {
-
- // add depencies for current revision
- $this->addRevision($revision['id']);
- }
- return true;
- }
- return false;
- } // end of member function rebuild
-
-
-
- /**
- * adds depencies for this revision
- *
- * @param int rev_id
- * @return bool
- * @access public
- */
- public function addRevision( $rev_id )
- {
- $this->rev_id = $rev_id;
-
- // get text and parse it for depencies
- $stmt=&DBConnection::getInstance()->prepare("SELECT content FROM ".ROSCMST_TEXT." WHERE rev_id=:rev_id AND name='content'");
- $stmt->bindParam('rev_id',$rev_id,PDO::PARAM_INT);
- if ($stmt->execute()) {
- return preg_replace_callback('/\[#((inc|templ|cont|link)_([^][#[:space:]]+))\]/', array($this,'newDepency'), $stmt->fetchColumn());
- }
- return false;
- } // end of member function addRevision
-
-
-
- /**
- * @FILLME
- *
- * @param string from_name
- * @param string to_name
- * @param string from_type
- * @param string to_type
- * @return bool
- * @access public
- */
- public static function renameEntry( $from_name, $to_name, $from_type, $to_type )
- {
- //@TODO
- } // end of member function renameEntry
-
-
-
- /**
- * replaces a data_id with the link name, the data would have, if it would exist
- *
- * @param data_id
- * @return bool
- * @access public
- */
- public static function removeEntry( $data_id )
- {
- // get name & type
- $stmt=&DBConnection::getInstance()->exec("SELECT name, type FROM ".ROSCMST_ENTRIES." WHERE id=:data_id");
- $stmt->bindParam('data_id',$data_id,PDO::PARAM_INT);
- if ($stmt->execute()) {
- $data = $stmt->fetchOnce();
-
- // replace old depency per id to text depency
- $stmt=&DBConnection::getInstance()->exec("UPDATE ".ROSCMST_DEPENCIES." SET child_id = NULL, child_name = :depency_name WHERE child_id=:data_id");
- $stmt->bindParam('data_id',$data_id,PDO::PARAM_INT);
- $stmt->bindValue('depency_name',$this->short[$data['type']].'_'.$data['name']);
- return $stmt->execute();
- }
- return false;
- } // end of member function removeEntry
-
-
-
- /**
- * removes all depencies from a revision to all other data_ids
- *
- * @param int rev_id
- * @return bool
- * @access public
- */
- public static function removeRevision( $rev_id )
- {
- // remove old depencies
- $stmt=&DBConnection::getInstance()->prepare("DELETE FROM ".ROSCMST_DEPENCIES." WHERE reV_id = :rev_id");
- $stmt->bindParam('rev_id',$rev_id,PDO::PARAM_INT);
- return $stmt->execute();
- } // end of member function removeRevision
-
-
-
- /**
- * add a new user defined depency
- *
- * @param int rev_id
- * @param string name entry name
- * @param string type entry type
- * @return bool
- * @access public
- */
- public static function addManual( $rev_id, $name, $type )
- {
- // check access rights
- if (ThisUser::getInstance()->hasAccess('add_depencies')) {
- return self::insert($rev_id, $name, $type, true);
- }
- return false;
- } // end of member function addManual
-
-
-
- /**
- * deletes a user defined Depency
- *
- * @param int dep_id depency id
- * @return bool
- * @access public
- */
- public static function deleteManual( $dep_id )
- {
- // check access rights
- if (ThisUser::getInstance()->hasAccess('add_depencies')) {
-
- // delete depencies
- $stmt=&DBConnection::getInstance()->prepare("DELETE FROM ".ROSCMST_DEPENCIES." WHERE id = :dep_id AND user_defined IS TRUE");
- $stmt->bindParam('dep_id',$dep_id,PDO::PARAM_INT);
- return $stmt->execute();
- }
- return false;
- } // end of member function deleteManual
-
-
-
- /**
- * inserts/updates new depency into database
- *
- * @param string[] matches
- * @return bool
- * @access private
- */
- private function newDepency( $matches )
- {
- // get depency type for database
- switch ($matches[2]) {
- case 'cont':
- $type = 'content';
- break;
- case 'inc':
- $type = 'script';
- break;
- case 'link':
- $type = 'page';
- break;
- }
-
- return self::insert($this->rev_id, $matches[3], $type, false);
- } // end of member function newDepency
-
-
-
- /**
- * shared function to insert/update entries
- *
- * @param int rev_id parent
- * @param string name child
- * @param string type child
- * @param bool user_defined
- * @return bool
- * @access public
- */
- private static function insert( $rev_id, $name, $type, $user_defined )
- {
- // is include depency ?
- switch ($type) {
- case 'content':
- $depency_name = 'cont_'.$name;
- $include = true;
- break;
- case 'script':
- $depency_name = 'inc_'.$name;
- $include = true;
- break;
- case 'dynamic':
- $depency_name = 'link_'.$name;
- $include = true && $user_defined;
- break;
- case 'page':
- $depency_name = 'link_'.$name;
- $include = false;
- break;
- }
-
- // check for existing entry
- $stmt=&DBConnection::getInstance()->prepare("SELECT id FROM ".ROSCMST_ENTRIES." WHERE name = :name AND type = :type LIMIT 1");
- $stmt->bindParam('name',$name,PDO::PARAM_STR);
- $stmt->bindParam('type',$type,PDO::PARAM_STR);
- if ($stmt->execute()) {
- $data_id = $stmt->fetchColumn();
-
- // check if we already have an depency to this entry
- $stmt=&DBConnection::getInstance()->prepare("SELECT id FROM ".ROSCMST_DEPENCIES." WHERE child_name=:depency_name");
- $stmt->bindParam('depency_name',$depency_name,PDO::PARAM_STR);
- $stmt->execute();
- $depency_id = $stmt->fetchColumn();
-
- // update entry with data id instead of name&type
- if ($depency_id !== false) {
- $stmt=&DBConnection::getInstance()->prepare("UPDATE ".ROSCMST_DEPENCIES." SET child_name=NULL, child_id=:depency_id WHERE id=:depency_id");
- $stmt->bindParam('child_id',$data_id,PDO::PARAM_INT);
- $stmt->bindParam('depency_id',$depency_id,PDO::PARAM_INT);
- return $stmt->execute();
- }
-
- // insert new depency
- else {
-
- // insert depency with name
- if ($data_id === false) {
- $stmt=&DBConnection::getInstance()->prepare("INSERT INTO ".ROSCMST_DEPENCIES." (rev_id, child_name, include, user_defined) VALUES (:rev_id, :depency_name, :is_include, :user_defined)");
- $stmt->bindParam('depency_name',$depency_name,PDO::PARAM_STR);
- }
-
- // insert depency with id
- else {
- $stmt=&DBConnection::getInstance()->prepare("INSERT INTO ".ROSCMST_DEPENCIES." (rev_id, child_id, include, user_defined) VALUES (:rev_id, :depency_id, :is_include, :user_defined)");
- $stmt->bindParam('depency_id',$data_id,PDO::PARAM_INT);
- }
- $stmt->bindParam('rev_id',$rev_id,PDO::PARAM_INT);
- $stmt->bindParam('is_include',$include,PDO::PARAM_BOOL);
- $stmt->bindParam('user_defined',$user_defined,PDO::PARAM_BOOL);
- return $stmt->execute();
- }
- }
- return false;
- } // end of member function deleteManual
-
-
-
-} // end of Depencies
-?>
Copied: branches/danny-web/reactos.org/htdocs/roscms/lib/om/Dependencies.class.php (from r39677, branches/danny-web/reactos.org/htdocs/roscms/lib/om/Depencies.class.php)
URL: http://svn.reactos.org/svn/reactos/branches/danny-web/reactos.org/htdocs/ro…
==============================================================================
--- branches/danny-web/reactos.org/htdocs/roscms/lib/om/Depencies.class.php [iso-8859-1] (original)
+++ branches/danny-web/reactos.org/htdocs/roscms/lib/om/Dependencies.class.php [iso-8859-1] Fri Feb 27 16:22:34 2009
@@ -20,13 +20,13 @@
/**
- * @class Depencies
+ * @class Dependencies
*
* Revisions are dependent from other entries, that means a revision can be dependent from a revision of the same language, or as fallback to any other language, preferable to the standard language
- * if not entry id exists, only a depency to the name is saved
+ * if not entry id exists, only a dependency to the name is saved
*
*/
-class Depencies
+class Dependencies
{
private $rev_id = 0;
@@ -45,15 +45,15 @@
// try to force unlimited script runtime
@set_time_limit(0);
- // remove old depencies
- DBConnection::getInstance()->exec("DELETE FROM ".ROSCMST_DEPENCIES." WHERE user_defined IS FALSE");
+ // remove old dependencies
+ DBConnection::getInstance()->exec("DELETE FROM ".ROSCMST_DEPENDENCIES." WHERE user_defined IS FALSE");
// walk trough all stable
$stmt=&DBConnection::getInstance()->prepare("SELECT id FROM ".ROSCMST_REVISIONS." WHERE archive IS FALSE AND status='stable'");
if ($stmt->execute()) {
while ($revision = $stmt->fetch(PDO::FETCH_ASSOC)) {
- // add depencies for current revision
+ // add dependencies for current revision
$this->addRevision($revision['id']);
}
return true;
@@ -64,7 +64,7 @@
/**
- * adds depencies for this revision
+ * adds dependencies for this revision
*
* @param int rev_id
* @return bool
@@ -74,11 +74,11 @@
{
$this->rev_id = $rev_id;
- // get text and parse it for depencies
+ // get text and parse it for dependencies
$stmt=&DBConnection::getInstance()->prepare("SELECT content FROM ".ROSCMST_TEXT." WHERE rev_id=:rev_id AND name='content'");
$stmt->bindParam('rev_id',$rev_id,PDO::PARAM_INT);
if ($stmt->execute()) {
- return preg_replace_callback('/\[#((inc|templ|cont|link)_([^][#[:space:]]+))\]/', array($this,'newDepency'), $stmt->fetchColumn());
+ return preg_replace_callback('/\[#((inc|templ|cont|link)_([^][#[:space:]]+))\]/', array($this,'newDependency'), $stmt->fetchColumn());
}
return false;
} // end of member function addRevision
@@ -117,10 +117,10 @@
if ($stmt->execute()) {
$data = $stmt->fetchOnce();
- // replace old depency per id to text depency
- $stmt=&DBConnection::getInstance()->exec("UPDATE ".ROSCMST_DEPENCIES." SET child_id = NULL, child_name = :depency_name WHERE child_id=:data_id");
+ // replace old dependency per id to text dependency
+ $stmt=&DBConnection::getInstance()->exec("UPDATE ".ROSCMST_DEPENDENCIES." SET child_id = NULL, child_name = :dependency_name WHERE child_id=:data_id");
$stmt->bindParam('data_id',$data_id,PDO::PARAM_INT);
- $stmt->bindValue('depency_name',$this->short[$data['type']].'_'.$data['name']);
+ $stmt->bindValue('dependency_name',$this->short[$data['type']].'_'.$data['name']);
return $stmt->execute();
}
return false;
@@ -129,7 +129,7 @@
/**
- * removes all depencies from a revision to all other data_ids
+ * removes all dependencies from a revision to all other data_ids
*
* @param int rev_id
* @return bool
@@ -137,8 +137,8 @@
*/
public static function removeRevision( $rev_id )
{
- // remove old depencies
- $stmt=&DBConnection::getInstance()->prepare("DELETE FROM ".ROSCMST_DEPENCIES." WHERE reV_id = :rev_id");
+ // remove old dependencies
+ $stmt=&DBConnection::getInstance()->prepare("DELETE FROM ".ROSCMST_DEPENDENCIES." WHERE reV_id = :rev_id");
$stmt->bindParam('rev_id',$rev_id,PDO::PARAM_INT);
return $stmt->execute();
} // end of member function removeRevision
@@ -146,7 +146,7 @@
/**
- * add a new user defined depency
+ * add a new user defined dependency
*
* @param int rev_id
* @param string name entry name
@@ -157,7 +157,7 @@
public static function addManual( $rev_id, $name, $type )
{
// check access rights
- if (ThisUser::getInstance()->hasAccess('add_depencies')) {
+ if (ThisUser::getInstance()->hasAccess('add_dependencies')) {
return self::insert($rev_id, $name, $type, true);
}
return false;
@@ -166,19 +166,19 @@
/**
- * deletes a user defined Depency
- *
- * @param int dep_id depency id
+ * deletes a user defined dependency
+ *
+ * @param int dep_id dependency id
* @return bool
* @access public
*/
public static function deleteManual( $dep_id )
{
// check access rights
- if (ThisUser::getInstance()->hasAccess('add_depencies')) {
-
- // delete depencies
- $stmt=&DBConnection::getInstance()->prepare("DELETE FROM ".ROSCMST_DEPENCIES." WHERE id = :dep_id AND user_defined IS TRUE");
+ if (ThisUser::getInstance()->hasAccess('add_dependencies')) {
+
+ // delete dependencies
+ $stmt=&DBConnection::getInstance()->prepare("DELETE FROM ".ROSCMST_DEPENDENCIES." WHERE id = :dep_id AND user_defined IS TRUE");
$stmt->bindParam('dep_id',$dep_id,PDO::PARAM_INT);
return $stmt->execute();
}
@@ -188,15 +188,15 @@
/**
- * inserts/updates new depency into database
+ * inserts/updates new dependency into database
*
* @param string[] matches
* @return bool
* @access private
*/
- private function newDepency( $matches )
- {
- // get depency type for database
+ private function newDependency( $matches )
+ {
+ // get dependency type for database
switch ($matches[2]) {
case 'cont':
$type = 'content';
@@ -210,7 +210,7 @@
}
return self::insert($this->rev_id, $matches[3], $type, false);
- } // end of member function newDepency
+ } // end of member function newDependency
@@ -226,22 +226,22 @@
*/
private static function insert( $rev_id, $name, $type, $user_defined )
{
- // is include depency ?
+ // is include dependency ?
switch ($type) {
case 'content':
- $depency_name = 'cont_'.$name;
+ $dependency_name = 'cont_'.$name;
$include = true;
break;
case 'script':
- $depency_name = 'inc_'.$name;
+ $dependency_name = 'inc_'.$name;
$include = true;
break;
case 'dynamic':
- $depency_name = 'link_'.$name;
+ $dependency_name = 'link_'.$name;
$include = true && $user_defined;
break;
case 'page':
- $depency_name = 'link_'.$name;
+ $dependency_name = 'link_'.$name;
$include = false;
break;
}
@@ -253,33 +253,33 @@
if ($stmt->execute()) {
$data_id = $stmt->fetchColumn();
- // check if we already have an depency to this entry
- $stmt=&DBConnection::getInstance()->prepare("SELECT id FROM ".ROSCMST_DEPENCIES." WHERE child_name=:depency_name");
- $stmt->bindParam('depency_name',$depency_name,PDO::PARAM_STR);
+ // check if we already have an dependency to this entry
+ $stmt=&DBConnection::getInstance()->prepare("SELECT id FROM ".ROSCMST_DEPENDENCIES." WHERE child_name=:dependency_name");
+ $stmt->bindParam('dependency_name',$dependency_name,PDO::PARAM_STR);
$stmt->execute();
- $depency_id = $stmt->fetchColumn();
+ $dependency_id = $stmt->fetchColumn();
// update entry with data id instead of name&type
- if ($depency_id !== false) {
- $stmt=&DBConnection::getInstance()->prepare("UPDATE ".ROSCMST_DEPENCIES." SET child_name=NULL, child_id=:depency_id WHERE id=:depency_id");
+ if ($dependency_id !== false) {
+ $stmt=&DBConnection::getInstance()->prepare("UPDATE ".ROSCMST_DEPENDENCIES." SET child_name=NULL, child_id=:dependency_id WHERE id=:dependency_id");
$stmt->bindParam('child_id',$data_id,PDO::PARAM_INT);
- $stmt->bindParam('depency_id',$depency_id,PDO::PARAM_INT);
+ $stmt->bindParam('dependency_id',$dependency_id,PDO::PARAM_INT);
return $stmt->execute();
}
- // insert new depency
+ // insert new dependency
else {
- // insert depency with name
+ // insert dependency with name
if ($data_id === false) {
- $stmt=&DBConnection::getInstance()->prepare("INSERT INTO ".ROSCMST_DEPENCIES." (rev_id, child_name, include, user_defined) VALUES (:rev_id, :depency_name, :is_include, :user_defined)");
- $stmt->bindParam('depency_name',$depency_name,PDO::PARAM_STR);
+ $stmt=&DBConnection::getInstance()->prepare("INSERT INTO ".ROSCMST_DEPENDENCIES." (rev_id, child_name, include, user_defined) VALUES (:rev_id, :dependency_name, :is_include, :user_defined)");
+ $stmt->bindParam('dependency_name',$dependency_name,PDO::PARAM_STR);
}
- // insert depency with id
+ // insert dependency with id
else {
- $stmt=&DBConnection::getInstance()->prepare("INSERT INTO ".ROSCMST_DEPENCIES." (rev_id, child_id, include, user_defined) VALUES (:rev_id, :depency_id, :is_include, :user_defined)");
- $stmt->bindParam('depency_id',$data_id,PDO::PARAM_INT);
+ $stmt=&DBConnection::getInstance()->prepare("INSERT INTO ".ROSCMST_DEPENDENCIES." (rev_id, child_id, include, user_defined) VALUES (:rev_id, :dependency_id, :is_include, :user_defined)");
+ $stmt->bindParam('dependency_id',$data_id,PDO::PARAM_INT);
}
$stmt->bindParam('rev_id',$rev_id,PDO::PARAM_INT);
$stmt->bindParam('is_include',$include,PDO::PARAM_BOOL);
@@ -292,5 +292,5 @@
-} // end of Depencies
+} // end of Dependencies
?>
Modified: branches/danny-web/reactos.org/htdocs/roscms/lib/om/Entry.class.php
URL: http://svn.reactos.org/svn/reactos/branches/danny-web/reactos.org/htdocs/ro…
==============================================================================
--- branches/danny-web/reactos.org/htdocs/roscms/lib/om/Entry.class.php [iso-8859-1] (original)
+++ branches/danny-web/reactos.org/htdocs/roscms/lib/om/Entry.class.php [iso-8859-1] Fri Feb 27 16:22:34 2009
@@ -228,7 +228,7 @@
// update next number
Tag::update(Tag::getId($parent_rev,'next_index',-1),$next_index+1);
- Depencies::addManual($parent_rev, $data_name, 'content');
+ Dependencies::addManual($parent_rev, $data_name, 'content');
}
// create new stext contents for (dynamic) pages
Modified: branches/danny-web/reactos.org/htdocs/roscms/lib/om/Generate.class.php
URL: http://svn.reactos.org/svn/reactos/branches/danny-web/reactos.org/htdocs/ro…
==============================================================================
--- branches/danny-web/reactos.org/htdocs/roscms/lib/om/Generate.class.php [iso-8859-1] (original)
+++ branches/danny-web/reactos.org/htdocs/roscms/lib/om/Generate.class.php [iso-8859-1] Fri Feb 27 16:22:34 2009
@@ -88,15 +88,15 @@
$stmt->execute();
$content = $stmt->fetchColumn();
- // replace depencies
- $stmt=&DBConnection::getInstance()->prepare("SELECT d.type, d.name FROM ".ROSCMST_DEPENCIES." w JOIN ".ROSCMST_ENTRIES." d ON w.child_id=d.id WHERE w.rev_id=:rev_id AND w.include IS TRUE");
+ // replace dependencies
+ $stmt=&DBConnection::getInstance()->prepare("SELECT d.type, d.name FROM ".ROSCMST_DEPENDENCIES." w JOIN ".ROSCMST_ENTRIES." d ON w.child_id=d.id WHERE w.rev_id=:rev_id AND w.include IS TRUE");
$stmt->bindParam('rev_id',$rev_id,PDO::PARAM_INT);
$stmt->execute();
- while ($depency = $stmt->fetch(PDO::FETCH_ASSOC)) {
+ while ($dependency = $stmt->fetch(PDO::FETCH_ASSOC)) {
// replace
- if ($depency['type'] != 'script') {
- $content = str_replace('[#'.$this->short[$depency['type']].'_'.$depency['name'].']', $this->getCached(array(null, $this->short[$depency['type']].'_'.$depency['name'])), $content);
+ if ($dependency['type'] != 'script') {
+ $content = str_replace('[#'.$this->short[$dependency['type']].'_'.$dependency['name'].']', $this->getCached(array(null, $this->short[$dependency['type']].'_'.$dependency['name'])), $content);
}
}
@@ -217,15 +217,15 @@
// file content
$content = $revision['content'];
- // replace depencies
- $stmt_more=&DBConnection::getInstance()->prepare("SELECT d.id, d.type, d.name FROM ".ROSCMST_DEPENCIES." w JOIN ".ROSCMST_ENTRIES." d ON w.child_id=d.id WHERE w.rev_id=:rev_id AND w.include IS TRUE");
+ // replace dependencies
+ $stmt_more=&DBConnection::getInstance()->prepare("SELECT d.id, d.type, d.name FROM ".ROSCMST_DEPENDENCIES." w JOIN ".ROSCMST_ENTRIES." d ON w.child_id=d.id WHERE w.rev_id=:rev_id AND w.include IS TRUE");
$stmt_more->bindParam('rev_id',$revision['id'],PDO::PARAM_INT);
$stmt_more->execute();
- while ($depency = $stmt_more->fetch(PDO::FETCH_ASSOC)) {
+ while ($dependency = $stmt_more->fetch(PDO::FETCH_ASSOC)) {
// replace
- if ($depency['type'] != 'script') {
- $content = str_replace('[#'.$this->short[$depency['type']].'_'.$depency['name'].']', $this->getCached(array(null, $this->short[$depency['type']].'_'.$depency['name'])), $content);
+ if ($dependency['type'] != 'script') {
+ $content = str_replace('[#'.$this->short[$dependency['type']].'_'.$dependency['name'].']', $this->getCached(array(null, $this->short[$dependency['type']].'_'.$dependency['name'])), $content);
}
} // end foreach
@@ -293,14 +293,14 @@
// copy content
$content = $revision['content'];
- // replace depencies
- $stmt_more=&DBConnection::getInstance()->prepare("SELECT d.id, d.type, d.name FROM ".ROSCMST_DEPENCIES." w JOIN ".ROSCMST_ENTRIES." d ON w.child_id=d.id WHERE w.rev_id=:rev_id AND w.include IS TRUE AND d.type != 'script'");
+ // replace dependencies
+ $stmt_more=&DBConnection::getInstance()->prepare("SELECT d.id, d.type, d.name FROM ".ROSCMST_DEPENDENCIES." w JOIN ".ROSCMST_ENTRIES." d ON w.child_id=d.id WHERE w.rev_id=:rev_id AND w.include IS TRUE AND d.type != 'script'");
$stmt_more->bindParam('rev_id',$revision['id'],PDO::PARAM_INT);
$stmt_more->execute();
- while ($depency = $stmt_more->fetch(PDO::FETCH_ASSOC)) {
+ while ($dependency = $stmt_more->fetch(PDO::FETCH_ASSOC)) {
// replace
- $content = str_replace('[#'.$this->short[$depency['type']].'_'.$depency['name'].']', $this->getCached(array(null, $this->short[$depency['type']].'_'.$depency['name'])), $content);
+ $content = str_replace('[#'.$this->short[$dependency['type']].'_'.$dependency['name'].']', $this->getCached(array(null, $this->short[$dependency['type']].'_'.$dependency['name'])), $content);
} // end foreach
// replace scripts
@@ -344,7 +344,7 @@
if ($revision['type'] == 'page' || $revision['type'] == 'dynamic') {
- // in standard language we may have depencies to other languages, so better generate them all
+ // in standard language we may have dependencies to other languages, so better generate them all
if ($revision['lang_id'] == Language::getStandardId()){
$stmt=&DBConnection::getInstance()->prepare("SELECT id, name_short FROM ".ROSCMST_LANGUAGES." ORDER BY level DESC, name ASC");
}
@@ -381,25 +381,25 @@
SELECT DISTINCT
org.name, org.type, COALESCE( trans.id, org.id ) AS id, org.data_id
FROM (
- SELECT d.name, d.type, r.id, r.data_id FROM ".ROSCMST_DEPENCIES." w JOIN ".ROSCMST_REVISIONS." r ON r.id=w.rev_id JOIN ".ROSCMST_ENTRIES." d ON d.id=r.data_id WHERE w.child_id=:depency_id AND r.lang_id = :standard_lang AND w.rev_id NOT IN(:rev_id,:rev_id2) AND r.archive IS FALSE AND w.include IS TRUE
+ SELECT d.name, d.type, r.id, r.data_id FROM ".ROSCMST_DEPENDENCIES." w JOIN ".ROSCMST_REVISIONS." r ON r.id=w.rev_id JOIN ".ROSCMST_ENTRIES." d ON d.id=r.data_id WHERE w.child_id=:dependency_id AND r.lang_id = :standard_lang AND w.rev_id NOT IN(:rev_id,:rev_id2) AND r.archive IS FALSE AND w.include IS TRUE
) AS org LEFT OUTER JOIN (
- SELECT d.name, d.type, r.id, r.data_id FROM ".ROSCMST_DEPENCIES." w JOIN ".ROSCMST_REVISIONS." r ON r.id=w.rev_id JOIN ".ROSCMST_ENTRIES." d ON d.id=r.data_id WHERE w.child_id=:depency_id AND r.lang_id = :lang_id AND w.rev_id NOT IN(:rev_id,:rev_id2) AND r.archive IS FALSE AND w.include IS TRUE
+ SELECT d.name, d.type, r.id, r.data_id FROM ".ROSCMST_DEPENDENCIES." w JOIN ".ROSCMST_REVISIONS." r ON r.id=w.rev_id JOIN ".ROSCMST_ENTRIES." d ON d.id=r.data_id WHERE w.child_id=:dependency_id AND r.lang_id = :lang_id AND w.rev_id NOT IN(:rev_id,:rev_id2) AND r.archive IS FALSE AND w.include IS TRUE
) AS trans ON org.data_id = trans.data_id");
- $stmt->bindParam('depency_id',$revision['data_id'],PDO::PARAM_INT);
+ $stmt->bindParam('dependency_id',$revision['data_id'],PDO::PARAM_INT);
$stmt->bindParam('rev_id',$base_rev,PDO::PARAM_INT);
$stmt->bindParam('rev_id2',$rev_id,PDO::PARAM_INT);
$stmt->bindParam('standard_lang',Language::getStandardId(),PDO::PARAM_INT);
$stmt->bindParam('lang_id',$revision['lang_id'],PDO::PARAM_INT);
$stmt->execute();
- while ($depency = $stmt->fetch(PDO::FETCH_ASSOC)) {
+ while ($dependency = $stmt->fetch(PDO::FETCH_ASSOC)) {
// only run update once per $rev_id
- if ($depency['type'] != 'script') {
-
- $this->update($depency['id'], $dynamic_num);
+ if ($dependency['type'] != 'script') {
+
+ $this->update($dependency['id'], $dynamic_num);
break;
}
- } // end while depency
+ } // end while dependency
return true;
} // end of member function update
@@ -435,7 +435,7 @@
$stmt->execute();
// prepare for usage in loop
- $stmt_more=&DBConnection::getInstance()->prepare("SELECT w.child_id, d.type, d.name FROM ".ROSCMST_DEPENCIES." w JOIN ".ROSCMST_ENTRIES." d ON w.child_id=d.id WHERE w.rev_id=:rev_id AND w.include IS TRUE");
+ $stmt_more=&DBConnection::getInstance()->prepare("SELECT w.child_id, d.type, d.name FROM ".ROSCMST_DEPENDENCIES." w JOIN ".ROSCMST_ENTRIES." d ON w.child_id=d.id WHERE w.rev_id=:rev_id AND w.include IS TRUE");
while ($data = $stmt->fetch(PDO::FETCH_ASSOC)) {
@@ -466,23 +466,23 @@
// replace links
$content = preg_replace_callback('/\[#link_([^][#[:space:]]+)\]/', array($this, 'replaceWithHyperlink'), $content);
- // do we care about depencies ?
+ // do we care about dependencies ?
if ($recursive) {
- // process depencies first
+ // process dependencies first
$stmt_more->bindParam('rev_id',$revision['id'],PDO::PARAM_INT);
$stmt_more->execute();
- $depencies = $stmt_more->fetchAll(PDO::FETCH_ASSOC);
- foreach ($depencies as $depency) {
+ $dependencies = $stmt_more->fetchAll(PDO::FETCH_ASSOC);
+ foreach ($dependencies as $dependency) {
// cache dependent entries first
- $depency_file = $data['lang_id'].'/'.$this->short[$depency['type']].'_'.$depency['name'].'.rcf';
- if (!file_exists($this->cache_dir.$depency_file) || $this->begin > date('Y-m-d H:i:s',filemtime($this->cache_dir.$depency_file))) {
- $this->cacheFiles($depency['child_id']);
+ $dependency_file = $data['lang_id'].'/'.$this->short[$dependency['type']].'_'.$dependency['name'].'.rcf';
+ if (!file_exists($this->cache_dir.$dependency_file) || $this->begin > date('Y-m-d H:i:s',filemtime($this->cache_dir.$dependency_file))) {
+ $this->cacheFiles($dependency['child_id']);
}
// replace
- $content = str_replace('[#'.$this->short[$depency['type']].'_'.$depency['name'].']', $this->getCached(array(null, $this->short[$depency['type']].'_'.$depency['name'])), $content);
+ $content = str_replace('[#'.$this->short[$dependency['type']].'_'.$dependency['name'].']', $this->getCached(array(null, $this->short[$dependency['type']].'_'.$dependency['name'])), $content);
}
}
$this->writeFile($data['lang_id'],$filename, $content);
@@ -600,7 +600,7 @@
$stmt->execute();
$revision=$stmt->fetch(PDO::FETCH_ASSOC);
- // check if depency not available
+ // check if dependency not available
if ($revision === false) {
$stmt->bindParam('lang_id',Language::getStandardId(),PDO::PARAM_INT);
$stmt->execute();
Modified: branches/danny-web/reactos.org/htdocs/roscms/lib/om/Revision.class.php
URL: http://svn.reactos.org/svn/reactos/branches/danny-web/reactos.org/htdocs/ro…
==============================================================================
--- branches/danny-web/reactos.org/htdocs/roscms/lib/om/Revision.class.php [iso-8859-1] (original)
+++ branches/danny-web/reactos.org/htdocs/roscms/lib/om/Revision.class.php [iso-8859-1] Fri Feb 27 16:22:34 2009
@@ -147,7 +147,7 @@
/**
* delete a revision
- * removes also depencies to this revision
+ * removes also dependencies to this revision
*
* @param int rev_id
* @return bool
@@ -157,8 +157,8 @@
{
Log::writeMedium('delete entry: rev-id [rev-id: '.$rev_id.']');
- // delete Depencies
- $success = Depencies::removeRevision($rev_id);
+ // delete dependencies
+ $success = Dependencies::removeRevision($rev_id);
// get data id (check later if we can delete this)
$stmt=&DBConnection::getInstance()->prepare("SELECT data_id FROM ".ROSCMST_REVISIONS." WHERE id = :rev_id ");
@@ -405,8 +405,8 @@
*/
public static function toArchive( $rev_id )
{
- // remove depencies
- Depencies::removeRevision($rev_id);
+ // remove dependencies
+ Dependencies::removeRevision($rev_id);
// move into archive
$stmt=&DBConnection::getInstance()->prepare("UPDATE ".ROSCMST_REVISIONS." SET archive = TRUE WHERE id=:rev_id");
Modified: branches/danny-web/reactos.org/htdocs/roscms/lib/view/HTML_CMS_Maintain.cla…
URL: http://svn.reactos.org/svn/reactos/branches/danny-web/reactos.org/htdocs/ro…
==============================================================================
--- branches/danny-web/reactos.org/htdocs/roscms/lib/view/HTML_CMS_Maintain.cla… [iso-8859-1] (original)
+++ branches/danny-web/reactos.org/htdocs/roscms/lib/view/HTML_CMS_Maintain.cla… [iso-8859-1] Fri Feb 27 16:22:34 2009
@@ -180,9 +180,9 @@
<img src="'.RosCMS::getInstance()->pathRosCMS().'images/clear.gif" alt="" />
<span class="text">Optimize Tables</span>
</div>
- <div class="button" onclick="rebuildDepencies()">
+ <div class="button" onclick="rebuildDependencies()">
<img src="'.RosCMS::getInstance()->pathRosCMS().'images/tool.gif" alt="" />
- <span class="text">Rebuild Depency Tree</span>
+ <span class="text">Rebuild Dependency Tree</span>
</div>
<div class="button" onclick="generateAllPages()">
<img src="'.RosCMS::getInstance()->pathRosCMS().'images/active.gif" alt="" />