Compare commits
20 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
be03bc96cb | ||
|
|
4f73a88a8b | ||
|
|
b2019226da | ||
|
|
754c2edbd2 | ||
|
|
98e16e6143 | ||
|
|
005584e2ed | ||
|
|
7e34c5321d | ||
|
|
9d918f3b43 | ||
|
|
433b21ab6f | ||
|
|
826b5fdfd6 | ||
|
|
a923f07fc7 | ||
|
|
736415e939 | ||
|
|
2e8712d935 | ||
|
|
c6a15506c5 | ||
|
|
b2f5d439d5 | ||
|
|
071395bfe5 | ||
|
|
03ff1862c1 | ||
|
|
71ab3e27bd | ||
|
|
a190148125 | ||
|
|
fa5350baa2 |
21
4dev/composer/install.txt
Normal file
21
4dev/composer/install.txt
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
Install composer:
|
||||||
|
curl -sS https://getcomposer.org/installer | /usr/local/php-7.2-httpd-2.4/bin/php
|
||||||
|
|
||||||
|
Update composer phar file
|
||||||
|
/usr/local/php-7.2-httpd-2.4/bin/php composer.phar selfupdate
|
||||||
|
|
||||||
|
Install something:
|
||||||
|
/usr/local/php-7.2-httpd-2.4/bin/php composer.phar require something/something
|
||||||
|
|
||||||
|
Update all installed:
|
||||||
|
/usr/local/php-7.2-httpd-2.4/bin/php composer.phar update
|
||||||
|
|
||||||
|
Or update only one package:
|
||||||
|
/usr/local/php-7.2-httpd-2.4/bin/php composer.phar something/something
|
||||||
|
|
||||||
|
Install AWS SDK:
|
||||||
|
/usr/local/php-7.2-httpd-2.4/bin/php -d memory_limit=-1 composer.phar require aws/aws-sdk-php
|
||||||
|
|
||||||
|
Install zipStream:
|
||||||
|
/usr/local/php-7.2-httpd-2.4/bin/php composer.phar require maennchen/zipstream-php
|
||||||
|
|
||||||
@@ -1,14 +1,9 @@
|
|||||||
-- edit tables insert data in order
|
-- edit tables insert data in order
|
||||||
|
|
||||||
-- edit visible group
|
-- edit visible group
|
||||||
DELETE FROM edit_page_visible_group;
|
DELETE FROM edit_visible_group;
|
||||||
INSERT INTO edit_page_visible_group VALUES (1, 1);
|
INSERT INTO edit_visible_group (name, flag) VALUES ('Main Menu', 'main');
|
||||||
INSERT INTO edit_page_visible_group VALUES (2, 1);
|
INSERT INTO edit_visible_group (name, flag) VALUES ('Data popup Menu', 'datapopup');
|
||||||
INSERT INTO edit_page_visible_group VALUES (3, 1);
|
|
||||||
INSERT INTO edit_page_visible_group VALUES (4, 1);
|
|
||||||
INSERT INTO edit_page_visible_group VALUES (5, 1);
|
|
||||||
INSERT INTO edit_page_visible_group VALUES (6, 1);
|
|
||||||
INSERT INTO edit_page_visible_group VALUES (7, 1);
|
|
||||||
|
|
||||||
-- edit menu group
|
-- edit menu group
|
||||||
DELETE FROM edit_menu_group;
|
DELETE FROM edit_menu_group;
|
||||||
@@ -27,15 +22,30 @@ INSERT INTO edit_page (filename, name, order_number, online, menu) VALUES ('edit
|
|||||||
INSERT INTO edit_page (filename, name, order_number, online, menu) VALUES ('edit_access.php', 'Edit Access', 8, 1, 1);
|
INSERT INTO edit_page (filename, name, order_number, online, menu) VALUES ('edit_access.php', 'Edit Access', 8, 1, 1);
|
||||||
INSERT INTO edit_page (filename, name, order_number, online, menu) VALUES ('edit_order.php', 'Edit Order', 9, 1, 0);
|
INSERT INTO edit_page (filename, name, order_number, online, menu) VALUES ('edit_order.php', 'Edit Order', 9, 1, 0);
|
||||||
|
|
||||||
|
-- edit visible group
|
||||||
|
DELETE FROM edit_page_visible_group;
|
||||||
|
INSERT INTO edit_page_visible_group VALUES ((SELECT edit_page_id FROM edit_page WHERE name = 'Edit Pages'), (SELECT edit_visible_group_id FROM edit_visible_group WHERE flag = 'main'));
|
||||||
|
INSERT INTO edit_page_visible_group VALUES ((SELECT edit_page_id FROM edit_page WHERE name = 'Edit Users'), (SELECT edit_visible_group_id FROM edit_visible_group WHERE flag = 'main'));
|
||||||
|
INSERT INTO edit_page_visible_group VALUES ((SELECT edit_page_id FROM edit_page WHERE name = 'Edit Languages'), (SELECT edit_visible_group_id FROM edit_visible_group WHERE flag = 'main'));
|
||||||
|
INSERT INTO edit_page_visible_group VALUES ((SELECT edit_page_id FROM edit_page WHERE name = 'Edit Schemes'), (SELECT edit_visible_group_id FROM edit_visible_group WHERE flag = 'main'));
|
||||||
|
INSERT INTO edit_page_visible_group VALUES ((SELECT edit_page_id FROM edit_page WHERE name = 'Edit Groups'), (SELECT edit_visible_group_id FROM edit_visible_group WHERE flag = 'main'));
|
||||||
|
INSERT INTO edit_page_visible_group VALUES ((SELECT edit_page_id FROM edit_page WHERE name = 'Edit Visible Groups'), (SELECT edit_visible_group_id FROM edit_visible_group WHERE flag = 'main'));
|
||||||
|
INSERT INTO edit_page_visible_group VALUES ((SELECT edit_page_id FROM edit_page WHERE name = 'Edit Menu Groups'), (SELECT edit_visible_group_id FROM edit_visible_group WHERE flag = 'main'));
|
||||||
|
INSERT INTO edit_page_visible_group VALUES ((SELECT edit_page_id FROM edit_page WHERE name = 'Edit Access'), (SELECT edit_visible_group_id FROM edit_visible_group WHERE flag = 'main'));
|
||||||
|
-- INSERT INTO edit_page_visible_group VALUES ((SELECT edit_page_id FROM edit_page WHERE name = 'Edit Order'), (SELECT edit_visible_group_id FROM edit_visible_group WHERE flag = 'main'));
|
||||||
|
|
||||||
-- edit page menu group
|
-- edit page menu group
|
||||||
DELETE FROM edit_page_menu_group;
|
DELETE FROM edit_page_menu_group;
|
||||||
INSERT INTO edit_page_menu_group VALUES (1, 1);
|
INSERT INTO edit_page_menu_group VALUES ((SELECT edit_page_id FROM edit_page WHERE name = 'Edit Pages'), (SELECT edit_menu_group_id FROM edit_menu_group WHERE flag = 'admin'));
|
||||||
INSERT INTO edit_page_menu_group VALUES (2, 1);
|
INSERT INTO edit_page_menu_group VALUES ((SELECT edit_page_id FROM edit_page WHERE name = 'Edit Users'), (SELECT edit_menu_group_id FROM edit_menu_group WHERE flag = 'admin'));
|
||||||
INSERT INTO edit_page_menu_group VALUES (3, 1);
|
INSERT INTO edit_page_menu_group VALUES ((SELECT edit_page_id FROM edit_page WHERE name = 'Edit Languages'), (SELECT edit_menu_group_id FROM edit_menu_group WHERE flag = 'admin'));
|
||||||
INSERT INTO edit_page_menu_group VALUES (4, 1);
|
INSERT INTO edit_page_menu_group VALUES ((SELECT edit_page_id FROM edit_page WHERE name = 'Edit Schemes'), (SELECT edit_menu_group_id FROM edit_menu_group WHERE flag = 'admin'));
|
||||||
INSERT INTO edit_page_menu_group VALUES (5, 1);
|
INSERT INTO edit_page_menu_group VALUES ((SELECT edit_page_id FROM edit_page WHERE name = 'Edit Groups'), (SELECT edit_menu_group_id FROM edit_menu_group WHERE flag = 'admin'));
|
||||||
INSERT INTO edit_page_menu_group VALUES (6, 1);
|
INSERT INTO edit_page_menu_group VALUES ((SELECT edit_page_id FROM edit_page WHERE name = 'Edit Visible Groups'), (SELECT edit_menu_group_id FROM edit_menu_group WHERE flag = 'admin'));
|
||||||
INSERT INTO edit_page_menu_group VALUES (7, 1);
|
INSERT INTO edit_page_menu_group VALUES ((SELECT edit_page_id FROM edit_page WHERE name = 'Edit Menu Groups'), (SELECT edit_menu_group_id FROM edit_menu_group WHERE flag = 'admin'));
|
||||||
|
INSERT INTO edit_page_menu_group VALUES ((SELECT edit_page_id FROM edit_page WHERE name = 'Edit Access'), (SELECT edit_menu_group_id FROM edit_menu_group WHERE flag = 'admin'));
|
||||||
|
-- INSERT INTO edit_page_menu_group VALUES ((SELECT edit_page_id FROM edit_page WHERE name = 'Edit Order'), (SELECT edit_menu_group_id FROM edit_menu_group WHERE flag = 'admin'));
|
||||||
|
|
||||||
|
|
||||||
-- edit access right
|
-- edit access right
|
||||||
DELETE FROM edit_access_right;
|
DELETE FROM edit_access_right;
|
||||||
@@ -50,92 +60,88 @@ INSERT INTO edit_access_right (name, level, type) VALUES ('Site Admin', 90, 'sit
|
|||||||
INSERT INTO edit_access_right (name, level, type) VALUES ('Admin', 100, 'admin');
|
INSERT INTO edit_access_right (name, level, type) VALUES ('Admin', 100, 'admin');
|
||||||
|
|
||||||
-- edit scheme
|
-- edit scheme
|
||||||
|
DELETE FROM edit_scheme;
|
||||||
INSERT INTO edit_scheme (name, header_color, enabled) VALUES ('Default Scheme', 'E0E2FF', 1);
|
INSERT INTO edit_scheme (name, header_color, enabled) VALUES ('Default Scheme', 'E0E2FF', 1);
|
||||||
INSERT INTO edit_scheme (name, header_color, enabled) VALUES ('Admin', 'CC7E7E', 1);
|
INSERT INTO edit_scheme (name, header_color, enabled) VALUES ('Admin', 'CC7E7E', 1);
|
||||||
INSERT INTO edit_scheme (name, header_color, enabled) VALUES ('Visitor', 'B0C4B3', 1);
|
INSERT INTO edit_scheme (name, header_color, enabled) VALUES ('Visitor', 'B0C4B3', 1);
|
||||||
INSERT INTO edit_scheme (name, header_color, enabled) VALUES ('User', '1E789E', 1);
|
INSERT INTO edit_scheme (name, header_color, enabled) VALUES ('User', '1E789E', 1);
|
||||||
|
|
||||||
-- edit language
|
-- edit language
|
||||||
|
DELETE FROM edit_language;
|
||||||
INSERT INTO edit_language (short_name, long_name, iso_name, order_number, enabled, lang_default) VALUES ('en', 'English', 'UTF-8', 1, 1, 1);
|
INSERT INTO edit_language (short_name, long_name, iso_name, order_number, enabled, lang_default) VALUES ('en', 'English', 'UTF-8', 1, 1, 1);
|
||||||
INSERT INTO edit_language (short_name, long_name, iso_name, order_number, enabled, lang_default) VALUES ('ja', 'Japanese', 'UTF-8', 2, 1, 0);
|
INSERT INTO edit_language (short_name, long_name, iso_name, order_number, enabled, lang_default) VALUES ('ja', 'Japanese', 'UTF-8', 2, 1, 0);
|
||||||
|
|
||||||
-- edit group
|
-- edit group
|
||||||
INSERT INTO edit_group (name, enabled, edit_scheme_id, edit_access_right_id) VALUES ('Admin', 1,
|
DELETE FROM edit_group;
|
||||||
(SELECT edit_scheme_id FROM edit_scheme WHERE name = 'Admin'),
|
INSERT INTO edit_group (name, enabled, edit_scheme_id, edit_access_right_id) VALUES ('Admin', 1, (SELECT edit_scheme_id FROM edit_scheme WHERE name = 'Admin'), (SELECT edit_access_right_id FROM edit_access_right WHERE type = 'admin'));
|
||||||
(SELECT edit_access_right_id FROM edit_access_right WHERE type = 'admin')
|
INSERT INTO edit_group (name, enabled, edit_scheme_id, edit_access_right_id) VALUES ('User', 1, (SELECT edit_scheme_id FROM edit_scheme WHERE name = 'User'), (SELECT edit_access_right_id FROM edit_access_right WHERE type = 'write'));
|
||||||
);
|
|
||||||
INSERT INTO edit_group (name, enabled, edit_scheme_id, edit_access_right_id) VALUES ('User', 1,
|
|
||||||
(SELECT edit_scheme_id FROM edit_scheme WHERE name = 'User'),
|
|
||||||
(SELECT edit_access_right_id FROM edit_access_right WHERE type = 'write')
|
|
||||||
);
|
|
||||||
|
|
||||||
-- edit page access
|
-- edit page access
|
||||||
|
DELETE FROM edit_page_access;
|
||||||
INSERT INTO edit_page_access (enabled, edit_group_id, edit_page_id, edit_access_right_id) VALUES (1,
|
INSERT INTO edit_page_access (enabled, edit_group_id, edit_page_id, edit_access_right_id) VALUES (1,
|
||||||
(SELECT edit_group_id FROM edit_group WHERE name = 'Admin'),
|
(SELECT edit_group_id FROM edit_group WHERE name = 'Admin'),
|
||||||
1,
|
(SELECT edit_page_id FROM edit_page WHERE name = 'Edit Pages'),
|
||||||
(SELECT edit_access_right_id FROM edit_access_right WHERE type = 'admin')
|
(SELECT edit_access_right_id FROM edit_access_right WHERE type = 'admin')
|
||||||
);
|
);
|
||||||
INSERT INTO edit_page_access (enabled, edit_group_id, edit_page_id, edit_access_right_id) VALUES (1,
|
INSERT INTO edit_page_access (enabled, edit_group_id, edit_page_id, edit_access_right_id) VALUES (1,
|
||||||
(SELECT edit_group_id FROM edit_group WHERE name = 'Admin'),
|
(SELECT edit_group_id FROM edit_group WHERE name = 'Admin'),
|
||||||
2,
|
(SELECT edit_page_id FROM edit_page WHERE name = 'Edit Users'),
|
||||||
(SELECT edit_access_right_id FROM edit_access_right WHERE type = 'admin')
|
(SELECT edit_access_right_id FROM edit_access_right WHERE type = 'admin')
|
||||||
);
|
|
||||||
INSERT INTO edit_page_access (enabled, edit_group_id, edit_page_id, edit_access_right_id) VALUES (1,
|
|
||||||
(SELECT edit_group_id FROM edit_group WHERE name = 'Admin'),
|
|
||||||
3,
|
|
||||||
(SELECT edit_access_right_id FROM edit_access_right WHERE type = 'admin')
|
|
||||||
);
|
);
|
||||||
INSERT INTO edit_page_access (enabled, edit_group_id, edit_page_id, edit_access_right_id) VALUES (1,
|
INSERT INTO edit_page_access (enabled, edit_group_id, edit_page_id, edit_access_right_id) VALUES (1,
|
||||||
(SELECT edit_group_id FROM edit_group WHERE name = 'Admin'),
|
(SELECT edit_group_id FROM edit_group WHERE name = 'Admin'),
|
||||||
4,
|
(SELECT edit_page_id FROM edit_page WHERE name = 'Edit Languages'),
|
||||||
(SELECT edit_access_right_id FROM edit_access_right WHERE type = 'admin')
|
(SELECT edit_access_right_id FROM edit_access_right WHERE type = 'admin')
|
||||||
);
|
);
|
||||||
INSERT INTO edit_page_access (enabled, edit_group_id, edit_page_id, edit_access_right_id) VALUES (1,
|
INSERT INTO edit_page_access (enabled, edit_group_id, edit_page_id, edit_access_right_id) VALUES (1,
|
||||||
(SELECT edit_group_id FROM edit_group WHERE name = 'Admin'),
|
(SELECT edit_group_id FROM edit_group WHERE name = 'Admin'),
|
||||||
5,
|
(SELECT edit_page_id FROM edit_page WHERE name = 'Edit Schemes'),
|
||||||
(SELECT edit_access_right_id FROM edit_access_right WHERE type = 'admin')
|
(SELECT edit_access_right_id FROM edit_access_right WHERE type = 'admin')
|
||||||
);
|
);
|
||||||
INSERT INTO edit_page_access (enabled, edit_group_id, edit_page_id, edit_access_right_id) VALUES (1,
|
INSERT INTO edit_page_access (enabled, edit_group_id, edit_page_id, edit_access_right_id) VALUES (1,
|
||||||
(SELECT edit_group_id FROM edit_group WHERE name = 'Admin'),
|
(SELECT edit_group_id FROM edit_group WHERE name = 'Admin'),
|
||||||
6,
|
(SELECT edit_page_id FROM edit_page WHERE name = 'Edit Groups'),
|
||||||
(SELECT edit_access_right_id FROM edit_access_right WHERE type = 'admin'
|
(SELECT edit_access_right_id FROM edit_access_right WHERE type = 'admin')
|
||||||
);
|
|
||||||
INSERT INTO edit_page_access (enabled, edit_group_id, edit_page_id, edit_access_right_id) VALUES (1,
|
|
||||||
(SELECT edit_group_id FROM edit_group WHERE name = 'Admin'),
|
|
||||||
7,
|
|
||||||
(SELECT edit_access_right_id FROM edit_access_right WHERE type = 'admin'
|
|
||||||
);
|
);
|
||||||
INSERT INTO edit_page_access (enabled, edit_group_id, edit_page_id, edit_access_right_id) VALUES (1,
|
INSERT INTO edit_page_access (enabled, edit_group_id, edit_page_id, edit_access_right_id) VALUES (1,
|
||||||
(SELECT edit_group_id FROM edit_group WHERE name = 'Admin'),
|
(SELECT edit_group_id FROM edit_group WHERE name = 'Admin'),
|
||||||
8,
|
(SELECT edit_page_id FROM edit_page WHERE name = 'Edit Visible Groups'),
|
||||||
(SELECT edit_access_right_id FROM edit_access_right WHERE type = 'admin')
|
(SELECT edit_access_right_id FROM edit_access_right WHERE type = 'admin')
|
||||||
);
|
);
|
||||||
INSERT INTO edit_page_access (enabled, edit_group_id, edit_page_id, edit_access_right_id) VALUES (1,
|
INSERT INTO edit_page_access (enabled, edit_group_id, edit_page_id, edit_access_right_id) VALUES (1,
|
||||||
(SELECT edit_group_id FROM edit_group WHERE name = 'Admin'),
|
(SELECT edit_group_id FROM edit_group WHERE name = 'Admin'),
|
||||||
9,
|
(SELECT edit_page_id FROM edit_page WHERE name = 'Edit Menu Groups'),
|
||||||
(SELECT edit_access_right_id FROM edit_access_right WHERE type = 'admin')
|
(SELECT edit_access_right_id FROM edit_access_right WHERE type = 'admin')
|
||||||
|
);
|
||||||
|
INSERT INTO edit_page_access (enabled, edit_group_id, edit_page_id, edit_access_right_id) VALUES (1,
|
||||||
|
(SELECT edit_group_id FROM edit_group WHERE name = 'Admin'),
|
||||||
|
(SELECT edit_page_id FROM edit_page WHERE name = 'Edit Access'),
|
||||||
|
(SELECT edit_access_right_id FROM edit_access_right WHERE type = 'admin')
|
||||||
|
);
|
||||||
|
INSERT INTO edit_page_access (enabled, edit_group_id, edit_page_id, edit_access_right_id) VALUES (1,
|
||||||
|
(SELECT edit_group_id FROM edit_group WHERE name = 'Admin'),
|
||||||
|
(SELECT edit_page_id FROM edit_page WHERE name = 'Edit Order'),
|
||||||
|
(SELECT edit_access_right_id FROM edit_access_right WHERE type = 'admin')
|
||||||
);
|
);
|
||||||
|
|
||||||
-- edit user
|
-- edit user
|
||||||
-- inserts admin user so basic users can be created
|
-- inserts admin user so basic users can be created
|
||||||
DELETE FROM edit_user;
|
DELETE FROM edit_user;
|
||||||
INSERT INTO edit_user (username, password, enabled, debug, db_debug, email, protected, admin, edit_language_id, edit_group_id, edit_scheme_id, edit_access_right_id) VALUES ('admin', 'admin', 1, 1, 1, '', 1, 1,
|
INSERT INTO edit_user (username, password, enabled, debug, db_debug, email, protected, admin, edit_language_id, edit_group_id, edit_scheme_id, edit_access_right_id) VALUES ('admin', 'admin', 1, 1, 1, '', 1, 1,
|
||||||
(SELECT edit_language_id FROM edit_language WHERE short_name = 'en'),
|
(SELECT edit_language_id FROM edit_language WHERE short_name = 'en'),
|
||||||
(SELECT edit_group_id FROM edit_group WHERE name = 'Admin'),
|
(SELECT edit_group_id FROM edit_group WHERE name = 'Admin'),
|
||||||
(SELECT edit_scheme_id FROM edit_scheme WHERE name = 'Admin')
|
(SELECT edit_scheme_id FROM edit_scheme WHERE name = 'Admin'),
|
||||||
(SELECT edit_access_right_id FROM edit_access_right WHERE type = 'admin')
|
(SELECT edit_access_right_id FROM edit_access_right WHERE type = 'admin')
|
||||||
);
|
);
|
||||||
|
|
||||||
-- edit access
|
-- edit access
|
||||||
DELETE FROM edit_access;
|
DELETE FROM edit_access;
|
||||||
INSERT INTO edit_access (name, enabled, protected) VALUES ('Admin Access', 't', 1);
|
INSERT INTO edit_access (name, enabled, protected) VALUES ('Admin Access', 1, 1);
|
||||||
INSERT INTO edit_access (name, enabled, protected) VALUES ('User Access', 't', 1);
|
|
||||||
|
|
||||||
-- edit access user
|
-- edit access user
|
||||||
DELETE FROM edit_access_user;
|
DELETE FROM edit_access_user;
|
||||||
INSERT INTO edit_access_user (edit_default, edit_access_id, edit_user_id, edit_access_right_id) VALUES (1,
|
INSERT INTO edit_access_user (edit_default, enabled, edit_access_id, edit_user_id, edit_access_right_id) VALUES (1, 1,
|
||||||
(SELECT edit_access_id FROM edit_access WHERE uid = 'AdminAccess')
|
(SELECT edit_access_id FROM edit_access WHERE uid = 'AdminAccess'),
|
||||||
(SELECT edit_user_id FROM edit_user WHERE username = 'admin')
|
(SELECT edit_user_id FROM edit_user WHERE username = 'admin'),
|
||||||
(SELECT edit_access_right_id FROM edit_access_right WHERE type = 'admin')
|
(SELECT edit_access_right_id FROM edit_access_right WHERE type = 'admin')
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
59
4dev/database/function/edit_log_partition_insert.sql
Normal file
59
4dev/database/function/edit_log_partition_insert.sql
Normal file
@@ -0,0 +1,59 @@
|
|||||||
|
CREATE OR REPLACE FUNCTION edit_log_insert_trigger ()
|
||||||
|
RETURNS TRIGGER AS
|
||||||
|
$$
|
||||||
|
DECLARE
|
||||||
|
start_date DATE := '2010-01-01';
|
||||||
|
end_date DATE;
|
||||||
|
timeformat TEXT := 'YYYY';
|
||||||
|
selector TEXT := 'year';
|
||||||
|
_interval INTERVAL;
|
||||||
|
table_name TEXT;
|
||||||
|
BEGIN
|
||||||
|
-- get year and month from edit_log date so we can build the target edit_log table
|
||||||
|
|
||||||
|
-- move interval
|
||||||
|
_interval := '1 ' || selector;
|
||||||
|
-- current table name
|
||||||
|
table_name := 'edit_log_' || to_char(NEW.event_date, timeformat);
|
||||||
|
|
||||||
|
-- we are in valid start time area
|
||||||
|
IF (NEW.event_date >= start_date) THEN
|
||||||
|
BEGIN
|
||||||
|
EXECUTE 'INSERT INTO ' || quote_ident(table_name) || ' SELECT ($1).*' USING NEW;
|
||||||
|
-- if insert failed because of missing table, create new below
|
||||||
|
EXCEPTION
|
||||||
|
WHEN undefined_table THEN
|
||||||
|
-- another block, so in case the creation fails here too
|
||||||
|
BEGIN
|
||||||
|
-- create new talbe here + all indexes
|
||||||
|
start_date := date_trunc(selector, NEW.event_date);
|
||||||
|
end_date := date_trunc(selector, NEW.event_date + _interval);
|
||||||
|
-- creat table
|
||||||
|
EXECUTE 'CREATE TABLE IF NOT EXISTS ' || quote_ident(table_name) || ' ( CHECK ( event_date >= ' || quote_literal(start_date) || ' AND event_date < ' || quote_literal(end_date) || ' ) ) INHERITS (edit_log)';
|
||||||
|
-- create all indexes and triggers
|
||||||
|
EXECUTE 'ALTER TABLE ' || quote_ident(table_name) || ' ADD PRIMARY KEY (edit_log_id)';
|
||||||
|
-- FK constraints
|
||||||
|
EXECUTE 'ALTER TABLE ' || quote_ident(table_name) || ' ADD CONSTRAINT fk_' || quote_ident(table_name) || '_euid_fkey FOREIGN KEY (euid) REFERENCES edit_user (edit_user_id) MATCH FULL ON UPDATE CASCADE ON DELETE CASCADE';
|
||||||
|
-- generic trigger
|
||||||
|
EXECUTE 'CREATE TRIGGER trg_' || quote_ident(table_name) || ' BEFORE INSERT OR UPDATE ON ' || quote_ident(table_name) || ' FOR EACH ROW EXECUTE PROCEDURE set_edit_generic()';
|
||||||
|
|
||||||
|
-- insert try again
|
||||||
|
EXECUTE 'INSERT INTO ' || quote_ident(table_name) || ' SELECT ($1).*' USING NEW;
|
||||||
|
EXCEPTION
|
||||||
|
WHEN OTHERS THEN
|
||||||
|
-- if this faled, throw it into the overflow table (so we don't loose anything)
|
||||||
|
INSERT INTO edit_log_overflow VALUES (NEW.*);
|
||||||
|
END;
|
||||||
|
-- other errors, insert into overlow
|
||||||
|
WHEN OTHERS THEN
|
||||||
|
-- if this faled, throw it into the overflow table (so we don't loose anything)
|
||||||
|
INSERT INTO edit_log_overflow VALUES (NEW.*);
|
||||||
|
END;
|
||||||
|
ELSE
|
||||||
|
-- if outside valid date, insert into overflow
|
||||||
|
INSERT INTO edit_log_overflow VALUES (NEW.*);
|
||||||
|
END IF;
|
||||||
|
RETURN NULL;
|
||||||
|
END
|
||||||
|
$$
|
||||||
|
LANGUAGE 'plpgsql'
|
||||||
@@ -3,7 +3,7 @@
|
|||||||
CREATE OR REPLACE FUNCTION set_generic() RETURNS TRIGGER AS '
|
CREATE OR REPLACE FUNCTION set_generic() RETURNS TRIGGER AS '
|
||||||
BEGIN
|
BEGIN
|
||||||
IF TG_OP = ''INSERT'' THEN
|
IF TG_OP = ''INSERT'' THEN
|
||||||
NEW.cuid := random_string(random_length);
|
NEW.date_created := ''now'';
|
||||||
ELSIF TG_OP = ''UPDATE'' THEN
|
ELSIF TG_OP = ''UPDATE'' THEN
|
||||||
NEW.date_updated := ''now'';
|
NEW.date_updated := ''now'';
|
||||||
END IF;
|
END IF;
|
||||||
|
|||||||
12
4dev/database/function/set_uid.sql
Executable file
12
4dev/database/function/set_uid.sql
Executable file
@@ -0,0 +1,12 @@
|
|||||||
|
-- adds the created or updated date tags
|
||||||
|
|
||||||
|
CREATE OR REPLACE FUNCTION set_uid() RETURNS TRIGGER AS '
|
||||||
|
DECLARE
|
||||||
|
random_length INT = 12; -- that should be long enough
|
||||||
|
BEGIN
|
||||||
|
IF TG_OP = ''INSERT'' THEN
|
||||||
|
NEW.uid := random_string(random_length);
|
||||||
|
END IF;
|
||||||
|
RETURN NEW;
|
||||||
|
END;
|
||||||
|
' LANGUAGE 'plpgsql';
|
||||||
@@ -12,6 +12,7 @@ CREATE TABLE edit_access (
|
|||||||
description VARCHAR,
|
description VARCHAR,
|
||||||
color VARCHAR,
|
color VARCHAR,
|
||||||
uid VARCHAR,
|
uid VARCHAR,
|
||||||
enabled BOOLEAN DEFAULT 'true',
|
enabled SMALLINT NOT NULL DEFAULT 0,
|
||||||
protected INT
|
protected INT,
|
||||||
|
deleted SMALLINT DEFAULT 0
|
||||||
) INHERITS (edit_generic) WITHOUT OIDS;
|
) INHERITS (edit_generic) WITHOUT OIDS;
|
||||||
|
|||||||
@@ -12,5 +12,5 @@ CREATE TABLE edit_scheme (
|
|||||||
name VARCHAR,
|
name VARCHAR,
|
||||||
header_color VARCHAR,
|
header_color VARCHAR,
|
||||||
css_file VARCHAR,
|
css_file VARCHAR,
|
||||||
template VARCHARs
|
template VARCHAR
|
||||||
) INHERITS (edit_generic) WITHOUT OIDS;
|
) INHERITS (edit_generic) WITHOUT OIDS;
|
||||||
|
|||||||
@@ -26,8 +26,8 @@ CREATE TABLE edit_user (
|
|||||||
edit_scheme_id INT,
|
edit_scheme_id INT,
|
||||||
edit_access_right_id INT NOT NULL,
|
edit_access_right_id INT NOT NULL,
|
||||||
login_error_count INT,
|
login_error_count INT,
|
||||||
login_error_date_last TIMESTAMP WTIHOUT TIME ZONE,
|
login_error_date_last TIMESTAMP WITHOUT TIME ZONE,
|
||||||
login_error_date_first TIMESTAMP WTIHOUT TIME ZONE,
|
login_error_date_first TIMESTAMP WITHOUT TIME ZONE,
|
||||||
strict SMALLINT DEFAULT 0,
|
strict SMALLINT DEFAULT 0,
|
||||||
locked SMALLINT DEFAULT 0,
|
locked SMALLINT DEFAULT 0,
|
||||||
password_change_date TIMESTAMP WITHOUT TIME ZONE, -- only when password is first set or changed
|
password_change_date TIMESTAMP WITHOUT TIME ZONE, -- only when password is first set or changed
|
||||||
|
|||||||
@@ -2,3 +2,8 @@ DROP TRIGGER trg_edit_access ON edit_access;
|
|||||||
CREATE TRIGGER trg_edit_access
|
CREATE TRIGGER trg_edit_access
|
||||||
BEFORE INSERT OR UPDATE ON edit_access
|
BEFORE INSERT OR UPDATE ON edit_access
|
||||||
FOR EACH ROW EXECUTE PROCEDURE set_edit_generic();
|
FOR EACH ROW EXECUTE PROCEDURE set_edit_generic();
|
||||||
|
|
||||||
|
DROP TRIGGER trg_set_edit_access_uid ON edit_access;
|
||||||
|
CREATE TRIGGER trg_set_edit_access_uid
|
||||||
|
BEFORE INSERT OR UPDATE ON edit_access
|
||||||
|
FOR EACH ROW EXECUTE PROCEDURE set_edit_access_uid();
|
||||||
|
|||||||
@@ -2,3 +2,8 @@ DROP TRIGGER trg_edit_log ON edit_log;
|
|||||||
CREATE TRIGGER trg_edit_log
|
CREATE TRIGGER trg_edit_log
|
||||||
BEFORE INSERT OR UPDATE ON edit_log
|
BEFORE INSERT OR UPDATE ON edit_log
|
||||||
FOR EACH ROW EXECUTE PROCEDURE set_edit_generic();
|
FOR EACH ROW EXECUTE PROCEDURE set_edit_generic();
|
||||||
|
|
||||||
|
DROP TRIGGER trg_edit_log_insert_partition ON edit_log;
|
||||||
|
CREATE TRIGGER trg_edit_log_insert_partition
|
||||||
|
BEFORE INSERT OR UPDATE ON edit_log
|
||||||
|
FOR EACH ROW EXECUTE PROCEDURE edit_log_insert_trigger();
|
||||||
|
|||||||
@@ -1,4 +0,0 @@
|
|||||||
-- DROP TRIGGER trg_set_edit_access_uid ON edit_access;
|
|
||||||
CREATE TRIGGER trg_set_edit_access_uid
|
|
||||||
BEFORE INSERT OR UPDATE ON edit_access
|
|
||||||
FOR EACH ROW EXECUTE PROCEDURE set_edit_access_uid();
|
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
php_value xdebug.profiler_output_dir /home/developer/html/adidas/20081208_catalogue/4dev/xdebug/
|
# all .inc files are denied access from outside
|
||||||
php_value xdebug.profiler_output_name timestamp
|
<Files "*.inc">
|
||||||
php_value xdebug.profiler_enable 0
|
Require all denied
|
||||||
|
</Files>
|
||||||
|
|||||||
@@ -14,7 +14,8 @@ ob_start();
|
|||||||
// basic class test file
|
// basic class test file
|
||||||
define('USE_DATABASE', true);
|
define('USE_DATABASE', true);
|
||||||
// sample config
|
// sample config
|
||||||
require("config.inc");
|
// require("config.inc");
|
||||||
|
require 'config.php';
|
||||||
// set session name
|
// set session name
|
||||||
if (!defined('SET_SESSION_NAME')) {
|
if (!defined('SET_SESSION_NAME')) {
|
||||||
DEFINE('SET_SESSION_NAME', EDIT_SESSION_NAME);
|
DEFINE('SET_SESSION_NAME', EDIT_SESSION_NAME);
|
||||||
@@ -31,7 +32,7 @@ ob_end_flush();
|
|||||||
|
|
||||||
// set + check edit access id
|
// set + check edit access id
|
||||||
$edit_access_id = 3;
|
$edit_access_id = 3;
|
||||||
if (array_key_exists('unit', $login->acl)) {
|
if (isset($login) && is_object($login) && isset($login->acl['unit'])) {
|
||||||
print "ACL UNIT: ".print_r(array_keys($login->acl['unit']), 1)."<br>";
|
print "ACL UNIT: ".print_r(array_keys($login->acl['unit']), 1)."<br>";
|
||||||
print "ACCESS CHECK: ".$login->loginCheckEditAccess($edit_access_id)."<br>";
|
print "ACCESS CHECK: ".$login->loginCheckEditAccess($edit_access_id)."<br>";
|
||||||
if ($login->loginCheckEditAccess($edit_access_id)) {
|
if ($login->loginCheckEditAccess($edit_access_id)) {
|
||||||
@@ -67,14 +68,16 @@ print "CALLER BACKTRACE: ".$basic->getCallerMethod()."<br>";
|
|||||||
$basic->debug('SOME MARK', 'Some error output');
|
$basic->debug('SOME MARK', 'Some error output');
|
||||||
|
|
||||||
print "EDIT ACCESS ID: ".$basic->edit_access_id."<br>";
|
print "EDIT ACCESS ID: ".$basic->edit_access_id."<br>";
|
||||||
// print "ACL: <br>".$basic->print_ar($login->acl)."<br>";
|
if (isset($login)) {
|
||||||
$basic->debug('ACL', "ACL: ".$basic->printAr($login->acl));
|
// print "ACL: <br>".$basic->print_ar($login->acl)."<br>";
|
||||||
// print "DEFAULT ACL: <br>".$basic->print_ar($login->default_acl_list)."<br>";
|
$basic->debug('ACL', "ACL: ".$basic->printAr($login->acl));
|
||||||
// print "DEFAULT ACL: <br>".$basic->print_ar($login->default_acl_list)."<br>";
|
// print "DEFAULT ACL: <br>".$basic->print_ar($login->default_acl_list)."<br>";
|
||||||
// $result = array_flip(array_filter(array_flip($login->default_acl_list), function ($key) { if (is_numeric($key)) return $key; }));
|
// print "DEFAULT ACL: <br>".$basic->print_ar($login->default_acl_list)."<br>";
|
||||||
// print "DEFAULT ACL: <br>".$basic->print_ar($result)."<br>";
|
// $result = array_flip(array_filter(array_flip($login->default_acl_list), function ($key) { if (is_numeric($key)) return $key; }));
|
||||||
// DEPRICATED CALL
|
// print "DEFAULT ACL: <br>".$basic->print_ar($result)."<br>";
|
||||||
// $basic->adbSetACL($login->acl);
|
// DEPRICATED CALL
|
||||||
|
// $basic->adbSetACL($login->acl);
|
||||||
|
}
|
||||||
|
|
||||||
// DB client encoding
|
// DB client encoding
|
||||||
print "DB Client encoding: ".$basic->dbGetEncoding()."<br>";
|
print "DB Client encoding: ".$basic->dbGetEncoding()."<br>";
|
||||||
@@ -97,6 +100,9 @@ print "DIRECT MULTIPLE INSERT STATUS: $status | PRIMARY KEYS: ".print_r($basic->
|
|||||||
// no returning, but not needed ;
|
// no returning, but not needed ;
|
||||||
$status = $basic->dbExec("INSERT INTO foo (test) VALUES ('FOO; TEST ".time()."');");
|
$status = $basic->dbExec("INSERT INTO foo (test) VALUES ('FOO; TEST ".time()."');");
|
||||||
print "DIRECT INSERT STATUS: $status | PRIMARY KEY: ".$basic->insert_id." | PRIMARY KEY EXT: ".print_r($basic->insert_id_ext, 1)."<br>";
|
print "DIRECT INSERT STATUS: $status | PRIMARY KEY: ".$basic->insert_id." | PRIMARY KEY EXT: ".print_r($basic->insert_id_ext, 1)."<br>";
|
||||||
|
// UPDATE WITH RETURNING
|
||||||
|
$status = $basic->dbExec("UPDATE foo SET test = 'SOMETHING DIFFERENT' WHERE foo_id = 3688452 RETURNING test");
|
||||||
|
print "UPDATE STATUS: $status | RETURNING EXT: ".print_r($basic->insert_id_ext, 1)."<br>";
|
||||||
|
|
||||||
# db write class test
|
# db write class test
|
||||||
$table = 'foo';
|
$table = 'foo';
|
||||||
@@ -161,14 +167,14 @@ print "DB Version bigger than $to_db_version: ".$basic->dbCompareVersion('>='.$t
|
|||||||
print "DB Version bigger $to_db_version: ".$basic->dbCompareVersion('>'.$to_db_version)."<br>";
|
print "DB Version bigger $to_db_version: ".$basic->dbCompareVersion('>'.$to_db_version)."<br>";
|
||||||
|
|
||||||
/* $q = "SELECT FOO FRO BAR";
|
/* $q = "SELECT FOO FRO BAR";
|
||||||
// $q = "Select * from foo";
|
// $q = "Select * from foo";
|
||||||
$foo = $basic->dbExecAsync($q);
|
$foo = $basic->dbExecAsync($q);
|
||||||
print "[ERR] Query: ".$q."<br>";
|
print "[ERR] Query: ".$q."<br>";
|
||||||
print "[ERR] RESOURCE: $foo<br>";
|
print "[ERR] RESOURCE: $foo<br>";
|
||||||
while (($ret = $basic->dbCheckAsync()) === true)
|
while (($ret = $basic->dbCheckAsync()) === true)
|
||||||
{
|
{
|
||||||
print "[ERR]: $ret<br>";
|
print "[ERR]: $ret<br>";
|
||||||
// sleep(5);
|
sleep(5);
|
||||||
} */
|
} */
|
||||||
|
|
||||||
// search path check
|
// search path check
|
||||||
@@ -202,8 +208,11 @@ $date_1 = '2017/1/5';
|
|||||||
$date_2 = '2017-01-05';
|
$date_2 = '2017-01-05';
|
||||||
print "COMPARE DATE: ".$basic->compareDate($date_1, $date_2)."<br>";
|
print "COMPARE DATE: ".$basic->compareDate($date_1, $date_2)."<br>";
|
||||||
|
|
||||||
|
|
||||||
|
// array re
|
||||||
|
|
||||||
// print error messages
|
// print error messages
|
||||||
print $login->printErrorMsg();
|
// print $login->printErrorMsg();
|
||||||
print $basic->printErrorMsg();
|
print $basic->printErrorMsg();
|
||||||
|
|
||||||
print "</body></html>";
|
print "</body></html>";
|
||||||
|
|||||||
@@ -1 +0,0 @@
|
|||||||
../configs/config.inc
|
|
||||||
1
www/admin/config.php
Symbolic link
1
www/admin/config.php
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
../configs/config.php
|
||||||
@@ -1 +1 @@
|
|||||||
edit_base.inc
|
../includes/edit_base.inc
|
||||||
@@ -1 +1 @@
|
|||||||
edit_base.inc
|
../includes/edit_base.inc
|
||||||
@@ -1 +1 @@
|
|||||||
edit_base.inc
|
../includes/edit_base.inc
|
||||||
@@ -1 +1 @@
|
|||||||
edit_base.inc
|
../includes/edit_base.inc
|
||||||
@@ -16,7 +16,7 @@ $DB_DEBUG = 1;
|
|||||||
extract($_GET, EXTR_SKIP);
|
extract($_GET, EXTR_SKIP);
|
||||||
extract($_POST, EXTR_SKIP);
|
extract($_POST, EXTR_SKIP);
|
||||||
|
|
||||||
include("config.inc");
|
require 'config.php';
|
||||||
// set session name
|
// set session name
|
||||||
define('SET_SESSION_NAME', EDIT_SESSION_NAME);
|
define('SET_SESSION_NAME', EDIT_SESSION_NAME);
|
||||||
// overrride debug flags
|
// overrride debug flags
|
||||||
@@ -71,6 +71,9 @@ if (defined('LAYOUT')) {
|
|||||||
// there are the POSITION stored, that should CHANGE there order (up/down)
|
// there are the POSITION stored, that should CHANGE there order (up/down)
|
||||||
// $row_data_id ... has ALL ids from the sorting part
|
// $row_data_id ... has ALL ids from the sorting part
|
||||||
// $row_data_order ... has ALL order positions from the soirting part
|
// $row_data_order ... has ALL order positions from the soirting part
|
||||||
|
if (!is_array($position)) {
|
||||||
|
$position = array ();
|
||||||
|
}
|
||||||
if (count($position)) {
|
if (count($position)) {
|
||||||
$original_id = $row_data_id;
|
$original_id = $row_data_id;
|
||||||
|
|
||||||
@@ -146,9 +149,12 @@ if ($error) {
|
|||||||
$DATA['form_error_msg'] = $messages;
|
$DATA['form_error_msg'] = $messages;
|
||||||
|
|
||||||
// all the row data
|
// all the row data
|
||||||
$options_id = array();
|
$options_id = array ();
|
||||||
$options_name = array();
|
$options_name = array ();
|
||||||
$options_selected = array();
|
$options_selected = array ();
|
||||||
|
if (!is_array($row_data)) {
|
||||||
|
$row_data = array ();
|
||||||
|
}
|
||||||
for ($i = 0; $i < count($row_data); $i ++) {
|
for ($i = 0; $i < count($row_data); $i ++) {
|
||||||
$options_id[] = $i;
|
$options_id[] = $i;
|
||||||
$options_name[] = $row_data[$i]["name"];
|
$options_name[] = $row_data[$i]["name"];
|
||||||
@@ -165,8 +171,8 @@ $DATA['options_name'] = $options_name;
|
|||||||
$DATA['options_selected'] = $options_selected;
|
$DATA['options_selected'] = $options_selected;
|
||||||
|
|
||||||
// hidden list for the data (id, order number)
|
// hidden list for the data (id, order number)
|
||||||
$row_data_id = array();
|
$row_data_id = array ();
|
||||||
$row_data_order = array();
|
$row_data_order = array ();
|
||||||
for ($i = 0; $i < count($row_data); $i++) {
|
for ($i = 0; $i < count($row_data); $i++) {
|
||||||
$row_data_id[] = $row_data[$i]["id"];
|
$row_data_id[] = $row_data[$i]["id"];
|
||||||
$row_data_order[] = $row_data[$i]["order"];
|
$row_data_order[] = $row_data[$i]["order"];
|
||||||
@@ -184,7 +190,7 @@ $DEBUG_DATA['DEBUG'] = $DEBUG_TMPL;
|
|||||||
// create main data array
|
// create main data array
|
||||||
$CONTENT_DATA = array_merge($HEADER, $DATA, $DEBUG_DATA);
|
$CONTENT_DATA = array_merge($HEADER, $DATA, $DEBUG_DATA);
|
||||||
// data is 1:1 mapping (all vars, values, etc)
|
// data is 1:1 mapping (all vars, values, etc)
|
||||||
while (list($key, $value) = each($CONTENT_DATA)) {
|
foreach ($CONTENT_DATA as $key => $value) {
|
||||||
$smarty->assign($key, $value);
|
$smarty->assign($key, $value);
|
||||||
}
|
}
|
||||||
$smarty->display('edit_order.tpl');
|
$smarty->display('edit_order.tpl');
|
||||||
@@ -192,5 +198,4 @@ $smarty->display('edit_order.tpl');
|
|||||||
echo $login->printErrorMsg();
|
echo $login->printErrorMsg();
|
||||||
echo $db->printErrorMsg();
|
echo $db->printErrorMsg();
|
||||||
|
|
||||||
# __END__
|
// __END__
|
||||||
|
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
edit_base.inc
|
../includes/edit_base.inc
|
||||||
@@ -1 +1 @@
|
|||||||
edit_base.inc
|
../includes/edit_base.inc
|
||||||
@@ -1 +1 @@
|
|||||||
edit_base.inc
|
../includes/edit_base.inc
|
||||||
@@ -1 +1 @@
|
|||||||
edit_base.inc
|
../includes/edit_base.inc
|
||||||
@@ -10,7 +10,7 @@ if ($DEBUG_ALL) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// sample config
|
// sample config
|
||||||
require("config.inc");
|
require 'config.php';
|
||||||
echo "FILE: ".BASE.LIB."Error.Handling.inc<br>";
|
echo "FILE: ".BASE.LIB."Error.Handling.inc<br>";
|
||||||
require(BASE.LIB."Error.Handling.inc");
|
require(BASE.LIB."Error.Handling.inc");
|
||||||
|
|
||||||
|
|||||||
@@ -1,480 +0,0 @@
|
|||||||
<?php
|
|
||||||
/********************************************************************
|
|
||||||
* AUTHOR: Clemens Schwaighofer
|
|
||||||
* CREATED: 2005/07/13
|
|
||||||
* SHORT DESCRIPTION:
|
|
||||||
* Create categories for CMS
|
|
||||||
* HISTORY:
|
|
||||||
* 2005/08/19 (cs) changed the mime type get from the _FILE to mime get fkt
|
|
||||||
*********************************************************************/
|
|
||||||
|
|
||||||
// DEBUG vars here
|
|
||||||
$DEBUG_ALL = 1;
|
|
||||||
$DB_DEBUG = 1;
|
|
||||||
$DEBUG_TMPL = 1;
|
|
||||||
|
|
||||||
//------------------------------ header
|
|
||||||
require("header.inc");
|
|
||||||
$MASTER_TEMPLATE_NAME = 'cms_popup.tpl';
|
|
||||||
$TEMPLATE_NAME = 'cms_files.tpl';
|
|
||||||
$PAGE_WIDTH = 750;
|
|
||||||
require("set_paths.inc");
|
|
||||||
//------------------------------ header
|
|
||||||
|
|
||||||
//------------------------------ processing data start
|
|
||||||
$form_name = $_GET['form'];
|
|
||||||
$value_name = $_GET['name'];
|
|
||||||
$data_id = $_GET['id'];
|
|
||||||
$show_type = $_GET['type']; // P (pic), F (flash), V (video), D (document: word), A (document: pdf), B (binary); , separated string
|
|
||||||
|
|
||||||
// default view is list
|
|
||||||
if (!$view && !$data_id) {
|
|
||||||
$view = 'list';
|
|
||||||
} elseif (!$view && $data_id) {
|
|
||||||
$view = 'list';
|
|
||||||
}
|
|
||||||
// default is online
|
|
||||||
if (!isset($online)) {
|
|
||||||
$online = 't';
|
|
||||||
}
|
|
||||||
// if not set, it is a fresh load
|
|
||||||
if (!$show_amount) {
|
|
||||||
$fresh_load = 1;
|
|
||||||
}
|
|
||||||
// the next two are for page view
|
|
||||||
if (!$start_row) {
|
|
||||||
$start_row = 0;
|
|
||||||
}
|
|
||||||
if (!$show_amount) {
|
|
||||||
$show_amount = 12;
|
|
||||||
}
|
|
||||||
if (!$show_type) {
|
|
||||||
$show_type = 'P';
|
|
||||||
}
|
|
||||||
|
|
||||||
// set edit access array
|
|
||||||
$edit_access_ids = array_keys($cms->user_unit);
|
|
||||||
|
|
||||||
// yes no list (online)
|
|
||||||
$yesno_list['f'] = 'No';
|
|
||||||
$yesno_list['t'] = 'Yes';
|
|
||||||
// order list
|
|
||||||
$sort_order_list['date_created'] = 'ID / Insert time'; // default
|
|
||||||
$sort_order_list['file_name'] = 'File Name';
|
|
||||||
$sort_order_list['file_size'] = 'File Size';
|
|
||||||
$sort_order_list['mime_type'] = 'Mime Type';
|
|
||||||
$sort_order_list['name_en'] = 'Alt Name English';
|
|
||||||
$sort_order_list['name_ja'] = 'Alt Name Japanese';
|
|
||||||
$sort_order_list['date_updated'] = 'Updated';
|
|
||||||
if (!$sort_order) {
|
|
||||||
$sort_order = 'date_created';
|
|
||||||
}
|
|
||||||
$sort_direction_list['ASC'] = 'Normal';
|
|
||||||
$sort_direction_list['DESC'] = 'Reverse';
|
|
||||||
if (!$sort_direction) {
|
|
||||||
$sort_direction = 'ASC';
|
|
||||||
}
|
|
||||||
// set if we need to write to any of the set live queues
|
|
||||||
// a) on page save with set_live
|
|
||||||
// b) global page with live_queue
|
|
||||||
// set via QUEUE variable
|
|
||||||
|
|
||||||
// create 0 entries for: templates, menu, data_group?
|
|
||||||
if ($cms->action == 'new' && $cms->action_yes == 'true') {
|
|
||||||
unset($file_uid);
|
|
||||||
unset($file_id);
|
|
||||||
unset($file_type);
|
|
||||||
$new_okay = 1;
|
|
||||||
}
|
|
||||||
// file type: P picture, M mouse over picutre, F flash, V video, B binary
|
|
||||||
if ($cms->action == 'save') {
|
|
||||||
if (!$file_type) {
|
|
||||||
$file_type = 'B';
|
|
||||||
}
|
|
||||||
$file_ok = false;
|
|
||||||
if (!$_FILES['file_up']['name'] && !$file_uid) {
|
|
||||||
$cms->messages[] = array('msg' => 'No file name given', 'class' => 'error');
|
|
||||||
$error = 1;
|
|
||||||
}
|
|
||||||
if (!$_FILES['file_up']['name'] && $file_uid) {
|
|
||||||
$file_ok = true;
|
|
||||||
}
|
|
||||||
// echo "FILE TYPE: ".$_FILES['file_up']['type']."<br>";
|
|
||||||
foreach (split(',', $show_type) as $_show_type) {
|
|
||||||
// check if the uploaded filename matches to the given type
|
|
||||||
if ($_FILES['file_up']['name'] && preg_match("/jpeg|png|gif/", $_FILES['file_up']['type']) && preg_match("/P/", $show_type)) {
|
|
||||||
$file_ok = true;
|
|
||||||
}
|
|
||||||
if ($_FILES['file_up']['name'] && preg_match("/swf/", $_FILES['file_up']['type']) && preg_match("/F/", $show_type)) {
|
|
||||||
$file_ok = true;
|
|
||||||
}
|
|
||||||
if ($_FILES['file_up']['name'] && preg_match("/video/", $_FILES['file_up']['type']) && preg_match("/V/", $show_type)) {
|
|
||||||
$file_ok = true;
|
|
||||||
}
|
|
||||||
if ($_FILES['file_up']['name'] && preg_match("/msword|vnd.oasis.opendocument.text/", $_FILES['file_up']['type']) && preg_match("/D/", $show_type)) {
|
|
||||||
$file_ok = true;
|
|
||||||
}
|
|
||||||
if ($_FILES['file_up']['name'] && preg_match("/pdf/", $_FILES['file_up']['type']) && preg_match("/A/", $show_type)) {
|
|
||||||
$file_ok = true;
|
|
||||||
}
|
|
||||||
if ($_FILES['file_up']['name'] && preg_match("/B/", $show_type)) {
|
|
||||||
$file_ok = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// write out error messages according to show type
|
|
||||||
if (!$file_ok) {
|
|
||||||
if (preg_match("/P/", $show_type)) {
|
|
||||||
$cms->messages[] = array('msg' => 'File is not a JPEG/PNG/GIF file', 'class' => 'error');
|
|
||||||
$error = 1;
|
|
||||||
}
|
|
||||||
if (preg_match("/F/", $show_type)) {
|
|
||||||
$cms->messages[] = array('msg' => 'File is not a Flash File', 'class' => 'error');
|
|
||||||
$error = 1;
|
|
||||||
}
|
|
||||||
if (preg_match("/V/", $show_type)) {
|
|
||||||
$cms->messages[] = array('msg' => 'File is not a Video', 'class' => 'error');
|
|
||||||
$error = 1;
|
|
||||||
}
|
|
||||||
if (preg_match("/D/", $show_type)) {
|
|
||||||
$cms->messages[] = array('msg' => 'File is not a DOC/ODT file', 'class' => 'error');
|
|
||||||
$error = 1;
|
|
||||||
}
|
|
||||||
if (preg_match("/A/", $show_type)) {
|
|
||||||
$cms->messages[] = array('msg' => 'File is not a PDF file', 'class' => 'error');
|
|
||||||
$error = 1;
|
|
||||||
}
|
|
||||||
if (preg_match("/B/", $show_type)) {
|
|
||||||
$cms->messages[] = array('msg' => 'No valid file was given', 'class' => 'error');
|
|
||||||
$error = 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// binary: all okay
|
|
||||||
// if no error, save data
|
|
||||||
if (!$error) {
|
|
||||||
if ($_FILES['file_up']['name']) {
|
|
||||||
$mime_type = $_FILES['file_up']['type'];
|
|
||||||
$file_size = $_FILES['file_up']['size'];
|
|
||||||
$file_name = $_FILES['file_up']['name'];
|
|
||||||
// get picture size
|
|
||||||
list($width, $height) = getimagesize($_FILES['file_up']['tmp_name']);
|
|
||||||
$cms->debug('upload', "Width: $width X Height: $height");
|
|
||||||
// set the file type and the target folder
|
|
||||||
if (preg_match("/jpeg|png|gif/", $mime_type)) {
|
|
||||||
$file_type = 'P';
|
|
||||||
} elseif (preg_match("/swf/", $mime_type)) {
|
|
||||||
$file_type = 'F';
|
|
||||||
} elseif (preg_match("/video/", $mime_type)) {
|
|
||||||
$file_type = 'V';
|
|
||||||
} elseif (preg_match("/msword|vnd.oasis.opendocument.text/", $mime_type)) {
|
|
||||||
$file_type = 'D';
|
|
||||||
} elseif (preg_match("/pdf/", $mime_type)) {
|
|
||||||
$file_type = 'A';
|
|
||||||
} elseif ($mime_type) {
|
|
||||||
$file_type = 'B';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// if we have an id -> updated
|
|
||||||
if ($file_uid) {
|
|
||||||
$q = "UPDATE file SET";
|
|
||||||
$q_set = " name_en = '".addslashes($name_en)."', name_ja = '".addslashes($name_ja)."', file_name = '".addslashes($file_name)."', online = '".$online."' ";
|
|
||||||
if ($_FILES['file_up']['name']) {
|
|
||||||
$q_set .= ", type = '".$file_type."', mime_type = '$mime_type', file_size = $file_size, size_x = $width, size_y = $height ";
|
|
||||||
}
|
|
||||||
$q .= $q_set."WHERE file_uid = '".$file_uid."'";
|
|
||||||
$cms->db_exec($q);
|
|
||||||
if (QUEUE == 'live_queue') {
|
|
||||||
$sql_action = 'UPDATE';
|
|
||||||
$sql_data = $q_set;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
// insert new data
|
|
||||||
$file_uid = md5(uniqid(rand(), true));
|
|
||||||
$q = "INSERT INTO file (name_en, name_ja, file_name, online, mime_type, file_size, size_x, size_y, file_uid, type) VALUES (";
|
|
||||||
$q .= "'".addslashes($name_en)."', '".addslashes($name_ja)."', '".addslashes($file_name)."', '".$online."', '".$mime_type."', ";
|
|
||||||
$q .= "$file_size, ".(($width) ? $width : 'NULL').", ".(($height) ? $height : 'NULL').", '".$file_uid."', '".$file_type."')";
|
|
||||||
$cms->db_exec($q);
|
|
||||||
$file_id = $cms->insert_id;
|
|
||||||
// if queue
|
|
||||||
if (QUEUE == 'live_queue') {
|
|
||||||
$sql_data = $q;
|
|
||||||
$sql_action = 'INSERT';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$size_x = $width;
|
|
||||||
$size_y = $height;
|
|
||||||
$file = DEV_SCHEMA."_".$file_uid;
|
|
||||||
// now upload the file
|
|
||||||
if ($_FILES['file_up']['name']) {
|
|
||||||
$upload_file = BASE.MEDIA.$cms->data_path[$file_type].$file;
|
|
||||||
// wipe out any old tmp data for this new upload
|
|
||||||
if (is_array(glob(BASE.TMP."thumb_".$file."*"))) {
|
|
||||||
foreach (glob(BASE.TMP."thumb_".$file."*") as $filename) {
|
|
||||||
@unlink($filename);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
# copy file to correct path
|
|
||||||
$error = move_uploaded_file($_FILES['file_up']['tmp_name'], $upload_file);
|
|
||||||
|
|
||||||
$cms->debug('file_upload', "UP: $upload_file");
|
|
||||||
$cms->debug('file_upload', "Orig: ".$cms->printAr($_FILES['file_up']));
|
|
||||||
|
|
||||||
// because I get bogus error info from move_uploaded_file ...
|
|
||||||
$error = 0;
|
|
||||||
if ($error) {
|
|
||||||
$cms->debug('file_upload', "ERROR: $error | INI FSize: ".ini_get("upload_max_filesize"));
|
|
||||||
$cms->messages[] = array('msg' => 'File upload failed', 'class' => 'error');
|
|
||||||
$q = "DELETE FROM file WHERE file_uid = '".$file_uid."'";
|
|
||||||
$cms->db_exec($q);
|
|
||||||
unset($file_id);
|
|
||||||
unset($file_uid);
|
|
||||||
$view = 'list';
|
|
||||||
} else {
|
|
||||||
$cms->messages[] = array('msg' => 'File upload successful', 'class' => 'warning');
|
|
||||||
// $view = 'list';
|
|
||||||
}
|
|
||||||
} // if file upload
|
|
||||||
// create thumbs + file size
|
|
||||||
$picture = $cms->cache_pictures.$cms->adbCreateThumbnail($file, 400, 280, $file_type, '', $cms->cache_pictures_root);
|
|
||||||
$picture_small = $cms->cache_pictures.$cms->adbCreateThumbnail($file, 80, 60, $file_type, '', $cms->cache_pictures_root);
|
|
||||||
$file_size = $cms->adbByteStringFormat($file_size);
|
|
||||||
// for live queue this is here needed
|
|
||||||
if (QUEUE == 'live_queue') {
|
|
||||||
$q = "INSERT INTO ".GLOBAL_DB_SCHEMA.".live_queue (queue_key, key_value, key_name, type, target, data, group_key, action";
|
|
||||||
if ($_FILES['file_up']['name']) {
|
|
||||||
$q .= ", file";
|
|
||||||
}
|
|
||||||
$q .= ") VALUES ('".$cms->queue_name."', '".$file_uid."', 'file_uid', '".$sql_action."', 'file', '".$cms->db_escape_string($sql_data)."', '".$cms->queue_key."', '".$cms->action."'";
|
|
||||||
if ($_FILES['file_up']['name']) {
|
|
||||||
$q .= ", '".BASE.MEDIA.$cms->data_path[$file_type].$file."#".BASE.MEDIA.$cms->data_path[$file_type].PUBLIC_SCHEMA."_".$file_uid."'";
|
|
||||||
}
|
|
||||||
$q .= ")";
|
|
||||||
$cms->db_exec($q);
|
|
||||||
}
|
|
||||||
} // if not error
|
|
||||||
}
|
|
||||||
if ($cms->action == 'delete' && $cms->action_yes == 'true') {
|
|
||||||
$file_uid = $cms->action_id;
|
|
||||||
$q = "SELECT type FROM file WHERE file_uid = '".$file_uid."'";
|
|
||||||
list ($file_type) = $cms->db_return_row($q);
|
|
||||||
// get the file type for the file path
|
|
||||||
$q = "DELETE FROM file WHERE file_uid = '".$file_uid."'";
|
|
||||||
$cms->db_exec($q);
|
|
||||||
if (QUEUE == 'set_live') {
|
|
||||||
$q = "INSERT INTO ".GLOBAL_DB_SCHEMA.".set_live (table_name, pkid, delete_flag) VALUES ('".$cms->page_name."', ".$file_uid.", 't')";
|
|
||||||
$cms->db_exec($q);
|
|
||||||
}
|
|
||||||
if (QUEUE == 'live_queue') {
|
|
||||||
$q = "INSERT INTO ".GLOBAL_DB_SCHEMA.".live_queue (queue_key, key_value, key_name, type, target, data, group_key, action, file) VALUES (";
|
|
||||||
$q .= "'".$cms->queue_name."', '".$file_uid."', 'file_uid', 'DELETE', 'file', '', '".$cms->queue_key."', '".$cms->action."', '".
|
|
||||||
$q .= BASE.MEDIA.$cms->data_path[$file_type].PUBLIC_SCHEMA."_".$file_uid."')";
|
|
||||||
}
|
|
||||||
@unlink(BASE.MEDIA.$cms->data_path[$file_type].DEV_SCHEMA."_".$file_uid);
|
|
||||||
// wipe out any old cache data for this new upload
|
|
||||||
if (is_array(glob($cms->cache_pictures."thumb_".TEST_SCHEMA."_".$file_uid."*"))) {
|
|
||||||
foreach (glob($cms->cache_pictures."thumb_".TEST_SCHEMA."_".$file_uid."*") as $filename) {
|
|
||||||
@unlink($filename);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
unset($file_uid);
|
|
||||||
unset($file_id);
|
|
||||||
$delete_done = 1;
|
|
||||||
$view = 'list';
|
|
||||||
}
|
|
||||||
if ($cms->action == 'load') {
|
|
||||||
$file_uid = $cms->action_id;
|
|
||||||
// load the data
|
|
||||||
$q = "SELECT file_id, name_en, name_ja, file_name, online, mime_type, file_size, size_x, size_y, type FROM file WHERE file_uid = '".$file_uid."'";
|
|
||||||
list($file_id, $name_en, $name_ja, $file_name, $online, $mime_type, $file_size, $size_x, $size_y, $file_type) = $cms->db_return_row($q);
|
|
||||||
// create thumbnail for edit view
|
|
||||||
$file = DEV_SCHEMA."_".$file_uid;
|
|
||||||
// thumbnails are only valid for pictures
|
|
||||||
$picture = $cms->cache_pictures.$cms->adbCreateThumbnail($file, 400, 280, $file_type, '', $cms->cache_pictures_root);
|
|
||||||
$picture_small = $cms->cache_pictures.$cms->adbCreateThumbnail($file, 80, 60, $file_type, '', $cms->cache_pictures_root);
|
|
||||||
$file_size = $cms->adbByteStringFormat($file_size);
|
|
||||||
// view to edit
|
|
||||||
$view = 'edit';
|
|
||||||
}
|
|
||||||
if ($cms->action == 'add_new') {
|
|
||||||
$view = 'edit';
|
|
||||||
}
|
|
||||||
if ($cms->action == 'view_files' && $cms->action_yes == 'true') {
|
|
||||||
$view = 'list';
|
|
||||||
}
|
|
||||||
// set delete live
|
|
||||||
if ($cms->action_flag == 'set_live' && $cms->action = 'set_delete') {
|
|
||||||
$q = "SELECT file_uid, pkid, type FROM ".LOGIN_DB_SCHEMA.".set_live sl, file f WHERE sl.pkid = f.file_uid table_name = '".$cms->page_name."' AND delete_flag = 't'";
|
|
||||||
while ($res = $cms->db_return($q)) {
|
|
||||||
$q_del = "DELETE FROM ".PUBLIC_SCHEMA.".file WHERE file_uid = '".$res['pkid'].'"';
|
|
||||||
$cms->db_exec($q_del);
|
|
||||||
@unlink(BASE.MEDIA.$cms->data_path[$res['type']].PUBLIC_SCHEMA."_".$res['file_uid']);
|
|
||||||
// wipe out any old cache data for this new upload
|
|
||||||
if (is_array(glob($cms->cache_pictures."thumb_".LIVE_SCHEMA."_".$file_uid."*"))) {
|
|
||||||
foreach (glob($cms->cache_pictures."thumb_".LIVE_SCHEMA."_".$file_uid."*") as $filename) {
|
|
||||||
@unlink($filename);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$q = "DELETE FROM ".LOGIN_DB_SCHEMA.".set_live WHERE table_name = '".$cms->page_name."' AND delete_flag = 't'";
|
|
||||||
$cms->db_exec($q);
|
|
||||||
}
|
|
||||||
if (DEV_SCHEMA != PUBLIC_SCHEMA) {
|
|
||||||
// read out possible deleted, to add "delete from live"
|
|
||||||
$q = "SELECT pkid FROM ".LOGIN_DB_SCHEMA.".set_live WHERE table_name = '".$cms->page_name."' AND delete_flag = 't'";
|
|
||||||
if ($cms->access_rights['base_acl'] < 90) {
|
|
||||||
$q .= "AND edit_access_id IN (".join(',', $edit_access_ids).") ";
|
|
||||||
}
|
|
||||||
while ($res = $cms->db_return($q, 3)) {
|
|
||||||
$cms->DATA['set_delete'][]['pkid'] = $res['pkid'];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// get th max entries
|
|
||||||
$q = "SELECT COUNT(file_uid) FROM file ";
|
|
||||||
$q_search_where = "WHERE ";
|
|
||||||
// only for current edit_access id, unless it is an admin user, then he can see all of them
|
|
||||||
if ($cms->access_rights['base_acl'] < 90) {
|
|
||||||
$q_search_where .= "edit_access_id IN (".join(',', $edit_access_ids).") AND ";
|
|
||||||
}
|
|
||||||
$q_search_where .= "type in ('".str_replace(',', "','", $show_type)."') ";
|
|
||||||
if ($search_what) {
|
|
||||||
$q_search_where .= "AND LOWER(name_en) LIKE '%".addslashes(strtolower($search_what))."%' OR name_ja LIKE '%".addslashes($search_what)."%' OR LOWER(file_name) LIKE '%".addslashes(strtolower($search_what))."%' ";
|
|
||||||
}
|
|
||||||
$q .= $q_search_where;
|
|
||||||
// get selection from show_type
|
|
||||||
list ($file_count) = $cms->db_return_row($q);
|
|
||||||
|
|
||||||
if ($cms->action == 'browse') {
|
|
||||||
// browse in the list of data
|
|
||||||
switch ($cms->action_id) {
|
|
||||||
case "<<<<":
|
|
||||||
$start_row = 0;
|
|
||||||
break;
|
|
||||||
case "<":
|
|
||||||
$start_row -= $show_amount;
|
|
||||||
break;
|
|
||||||
case ">":
|
|
||||||
$start_row += $show_amount;
|
|
||||||
break;
|
|
||||||
case ">>>>":
|
|
||||||
$start_row = $file_count - $show_amount;
|
|
||||||
break;
|
|
||||||
case "gopage":
|
|
||||||
// for page is page -1, so page 1 start from 0, etc
|
|
||||||
$start_row = ((($cms->action_value - 1) > 0) ? ($cms->action_value - 1) * $show_amount : 0);
|
|
||||||
$current_page = $cms->action_value;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// check overflow
|
|
||||||
if ($start_row < 0) {
|
|
||||||
$start_row = 0;
|
|
||||||
}
|
|
||||||
if ($start_row > $file_count) {
|
|
||||||
$start_row = $file_count - $show_amount;
|
|
||||||
}
|
|
||||||
|
|
||||||
// if we have a "fresh_load"
|
|
||||||
if ($fresh_load) {
|
|
||||||
$count = 1;
|
|
||||||
$q = "SELECT file_uid FROM file ";
|
|
||||||
if ($q_search_where) {
|
|
||||||
$q .= $q_search_where;
|
|
||||||
}
|
|
||||||
$q .= "ORDER BY ".$sort_order." ".$sort_direction." ";
|
|
||||||
while ($res = $cms->db_return($q)) {
|
|
||||||
// if data_id is set and not file_id, go to the page where the current highlight is, but only if this is a "virgin" load of the page
|
|
||||||
if ($data_id && ($data_id == $res['file_uid'])) {
|
|
||||||
$current_page = floor(($count / $show_amount));
|
|
||||||
$start_row = $current_page * $show_amount;
|
|
||||||
$current_page ++;
|
|
||||||
}
|
|
||||||
$count ++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// page forward/back buttons settings
|
|
||||||
if ($start_row > 0) {
|
|
||||||
$cms->DATA['show_back'] = 1;
|
|
||||||
}
|
|
||||||
$cms->DATA['page_number'] = ceil($start_row / $show_amount) + 1;
|
|
||||||
$cms->DATA['page_count'] = ceil($file_count / $show_amount);
|
|
||||||
if ($cms->DATA['page_count'] > 2 && !$current_page) {
|
|
||||||
$current_page = 1;
|
|
||||||
}
|
|
||||||
if (($start_row + $show_amount) < $file_count) {
|
|
||||||
$cms->DATA['show_forward'] = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
$q = "SELECT file_id, name_en, name_ja, file_name, online, mime_type, file_size, size_x, size_y, file_uid, type FROM file ";
|
|
||||||
// if search what, search in name_en, name_ja, file_name for the string
|
|
||||||
if ($q_search_where) {
|
|
||||||
$q .= $q_search_where;
|
|
||||||
}
|
|
||||||
$q .= "ORDER BY ".$sort_order." ".$sort_direction." ";
|
|
||||||
$q .= "LIMIT ".$show_amount." OFFSET ".$start_row;
|
|
||||||
while ($res = $cms->db_return($q)) {
|
|
||||||
$data_files[] = array (
|
|
||||||
'id' => $res['file_id'],
|
|
||||||
'name_en' => $res['name_en'],
|
|
||||||
'name_ja' => $res['name_ja'],
|
|
||||||
'file_name' => $res['file_name'],
|
|
||||||
'online' => $res['online'],
|
|
||||||
'mime_type' => $res['mime_type'],
|
|
||||||
'file_size' => $cms->adbByteStringFormat($res['file_size']),
|
|
||||||
'size_x' => $res['size_x'],
|
|
||||||
'size_y' => $res['size_y'],
|
|
||||||
'file_uid' => $res['file_uid'],
|
|
||||||
'file_type' => $res['type'],
|
|
||||||
'picture' => $cms->cache_pictures.$cms->adbCreateThumbnail(DEV_SCHEMA.'_'.$res['file_uid'], 80, 60, $res['type'], '', $cms->cache_pictures_root)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
$cms->DATA['show_type'] = $show_type;
|
|
||||||
$cms->DATA['data_files'] = $data_files;
|
|
||||||
$cms->DATA['view'] = $view;
|
|
||||||
$cms->DATA['images_path'] = MEDIA.$cms->data_path[$file_type];
|
|
||||||
// get vars for position (only when)
|
|
||||||
$cms->DATA['form_name'] = $form_name;
|
|
||||||
$cms->DATA['value_name'] = $value_name;
|
|
||||||
$cms->DATA['file_id'] = $file_id;
|
|
||||||
$cms->DATA['file_uid'] = $file_uid;
|
|
||||||
|
|
||||||
// write back all the other vars
|
|
||||||
if (!($delete_done || $new_okay)) {
|
|
||||||
// data name
|
|
||||||
$cms->DATA['file_name'] = $file_name;
|
|
||||||
$cms->DATA['name_en'] = $name_en;
|
|
||||||
$cms->DATA['name_ja'] = $name_ja;
|
|
||||||
$cms->DATA['mime_type'] = $mime_type;
|
|
||||||
$cms->DATA['file_size'] = $file_size;
|
|
||||||
$cms->DATA['size_x'] = $size_x;
|
|
||||||
$cms->DATA['size_y'] = $size_y;
|
|
||||||
$cms->DATA['online'] = $online;
|
|
||||||
$cms->DATA['picture'] = $picture;
|
|
||||||
$cms->DATA['picture_small'] = $picture_small;
|
|
||||||
$cms->DATA['file_type'] = $file_type;
|
|
||||||
}
|
|
||||||
$cms->DATA['sort_order_list'] = $sort_order_list;
|
|
||||||
$cms->DATA['sort_order'] = $sort_order;
|
|
||||||
$cms->DATA['sort_direction_list'] = $sort_direction_list;
|
|
||||||
$cms->DATA['sort_direction'] = $sort_direction;
|
|
||||||
$cms->DATA['search_what'] = $search_what;
|
|
||||||
$cms->DATA['current_page'] = $current_page;
|
|
||||||
$cms->DATA['yesno_list'] = $yesno_list;
|
|
||||||
$cms->DATA['start_row'] = $start_row;
|
|
||||||
$cms->DATA['show_amount'] = $show_amount;
|
|
||||||
if ($data_id) {
|
|
||||||
$cms->DATA['data_id'] = $data_id;
|
|
||||||
}
|
|
||||||
$cms->DATA['top'] = 0;
|
|
||||||
$cms->DATA['left'] = 0;
|
|
||||||
|
|
||||||
//------------------------------ processing data end
|
|
||||||
|
|
||||||
//------------------------------ smarty start
|
|
||||||
require("smarty.inc");
|
|
||||||
//------------------------------ smarty end
|
|
||||||
|
|
||||||
//------------------------------ footer
|
|
||||||
require("footer.inc");
|
|
||||||
//------------------------------ footer
|
|
||||||
@@ -1,51 +0,0 @@
|
|||||||
<?
|
|
||||||
/********************************************************************
|
|
||||||
* AUTHOR: Clemens Schwaighofer
|
|
||||||
* CREATED: 2005/07/19
|
|
||||||
* SHORT DESCRIPTION:
|
|
||||||
* preset date variables
|
|
||||||
* HISTORY:
|
|
||||||
*********************************************************************/
|
|
||||||
|
|
||||||
$day_short[1] = "Mon";
|
|
||||||
$day_short[2] = "Tue";
|
|
||||||
$day_short[3] = "Wed";
|
|
||||||
$day_short[4] = "Thu";
|
|
||||||
$day_short[5] = "Fri";
|
|
||||||
$day_short[6] = "Sat";
|
|
||||||
$day_short[7] = "Sun";
|
|
||||||
|
|
||||||
$day_long[1] = "Monday";
|
|
||||||
$day_long[2] = "Tuesday";
|
|
||||||
$day_long[3] = "Wednesday";
|
|
||||||
$day_long[4] = "Thursday";
|
|
||||||
$day_long[5] = "Friday";
|
|
||||||
$day_long[6] = "Saturday";
|
|
||||||
$day_long[7] = "Sunday";
|
|
||||||
|
|
||||||
// monate
|
|
||||||
$month_long[1] = "January";
|
|
||||||
$month_long[2] = "February";
|
|
||||||
$month_long[3] = "March";
|
|
||||||
$month_long[4] = "April";
|
|
||||||
$month_long[5] = "May";
|
|
||||||
$month_long[6] = "June";
|
|
||||||
$month_long[7] = "July";
|
|
||||||
$month_long[8] = "August";
|
|
||||||
$month_long[9] = "September";
|
|
||||||
$month_long[10] = "October";
|
|
||||||
$month_long[11] = "November";
|
|
||||||
$month_long[12] = "December";
|
|
||||||
|
|
||||||
$month_short[1] = "Jan";
|
|
||||||
$month_short[2] = "Feb";
|
|
||||||
$month_short[3] = "Mar";
|
|
||||||
$month_short[4] = "Apr";
|
|
||||||
$month_short[5] = "May";
|
|
||||||
$month_short[6] = "Jun";
|
|
||||||
$month_short[7] = "Jul";
|
|
||||||
$month_short[8] = "Aug";
|
|
||||||
$month_short[9] = "Sep";
|
|
||||||
$month_short[10] = "Oct";
|
|
||||||
$month_short[11] = "Nov";
|
|
||||||
$month_short[12] = "Dec";
|
|
||||||
17
www/admin/l10n_test.php
Executable file
17
www/admin/l10n_test.php
Executable file
@@ -0,0 +1,17 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
// debug for L10n issues in php 7.3
|
||||||
|
|
||||||
|
// namespace test
|
||||||
|
ob_start();
|
||||||
|
|
||||||
|
$lang = 'en_utf8';
|
||||||
|
|
||||||
|
// admin class tests
|
||||||
|
require 'config.php';
|
||||||
|
$l = new CoreLibs\Language\L10n($lang);
|
||||||
|
|
||||||
|
echo "OK<br>";
|
||||||
|
|
||||||
|
ob_end_flush();
|
||||||
|
// __END__
|
||||||
@@ -11,7 +11,7 @@ $DB_DEBUG = 1;
|
|||||||
ob_start();
|
ob_start();
|
||||||
|
|
||||||
// admin class tests
|
// admin class tests
|
||||||
require 'config.inc' ;
|
require 'config.php';
|
||||||
DEFINE('SET_SESSION_NAME', EDIT_SESSION_NAME);
|
DEFINE('SET_SESSION_NAME', EDIT_SESSION_NAME);
|
||||||
|
|
||||||
echo "DIR: ".DIR."<br>ROOT: ".ROOT."<br>BASE: ".BASE."<br>";
|
echo "DIR: ".DIR."<br>ROOT: ".ROOT."<br>BASE: ".BASE."<br>";
|
||||||
|
|||||||
46
www/admin/qq_file_upload_ajax.php
Executable file
46
www/admin/qq_file_upload_ajax.php
Executable file
@@ -0,0 +1,46 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
$DEBUG_ALL = 1;
|
||||||
|
$ECHO_ALL = 0;
|
||||||
|
$PRINT_ALL = 1;
|
||||||
|
|
||||||
|
// load the Basic && qq file uploader here
|
||||||
|
require 'config.php';
|
||||||
|
// class load
|
||||||
|
$base = new CoreLibs\Basic();
|
||||||
|
$base->debug('AJAX UPLOAD', 'START Backend');
|
||||||
|
// set max upload size
|
||||||
|
$MAX_UPLOAD_SIZE = $base->StringByteFormat(ini_get('upload_max_filesize'));
|
||||||
|
|
||||||
|
// test for qqFileUploader (AJAX side)
|
||||||
|
$allowedExtensions = array ('csv', 'zip', 'jpg', 'pdf', 'bz2');
|
||||||
|
$sizeLimit = $MAX_UPLOAD_SIZE; // as set in php ini
|
||||||
|
$base->debug('AJAX UPLOAD', 'Size: '.$sizeLimit.', Memory Limit: '.ini_get('memory_limit'));
|
||||||
|
$uploader = new CoreLibs\Upload\qqFileUploader($allowedExtensions, $sizeLimit);
|
||||||
|
// either in post or get
|
||||||
|
$_action= $_POST['action'] ? $_POST['action'] : $_GET['action'];
|
||||||
|
$_task_uid = $_POST['task_uid'] ? $_POST['task_uid'] : $_GET['task_uid'];
|
||||||
|
$get_post['start'] = microtime(true);
|
||||||
|
$base->debug('AJAX UPLOAD', 'Action: '.$_action.', Task UID: '.$_task_uid.' => '.$base->dateStringFormat($get_post['start']));
|
||||||
|
|
||||||
|
$upload_path = ROOT.MEDIA.UPLOADS;
|
||||||
|
$get_post['result'] = $uploader->handleUpload($upload_path, false);
|
||||||
|
$base->debug('AJAX UPLOAD', 'Memory peak: '.$base->ByteStringFormat(memory_get_usage()).' | '.$base->ByteStringFormat(memory_get_peak_usage()));
|
||||||
|
|
||||||
|
// set file name
|
||||||
|
$get_post['filename'] = $uploader->uploadFileName;
|
||||||
|
$get_post['type'] = $uploader->uploadFileExt;
|
||||||
|
$get_post['filesize'] = filesize($uploader->uploadFileName);
|
||||||
|
$get_post['filesize_formated'] = $base->ByteStringFormat($get_post['filesize']);
|
||||||
|
$get_post['end'] = microtime(true);
|
||||||
|
$get_post['time'] = $get_post['end'] - $get_post['start'];
|
||||||
|
|
||||||
|
$base->debug('AJAX RESULT', $base->printAr($get_post));
|
||||||
|
// return data
|
||||||
|
$output = htmlspecialchars(json_encode($get_post), ENT_NOQUOTES);
|
||||||
|
// $base->debug('AJAX JSON', $output);
|
||||||
|
print $output;
|
||||||
|
|
||||||
|
$base->printErrorMsg();
|
||||||
|
|
||||||
|
// __END__
|
||||||
225
www/admin/qq_file_upload_front.php
Executable file
225
www/admin/qq_file_upload_front.php
Executable file
@@ -0,0 +1,225 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
$DEBUG_ALL = 1;
|
||||||
|
$ECHO_ALL = 0;
|
||||||
|
$PRINT_ALL = 1;
|
||||||
|
|
||||||
|
// test file for qqFileUploader (HTML side)
|
||||||
|
// load the Basic class here
|
||||||
|
require 'config.php';
|
||||||
|
$base = new CoreLibs\Basic();
|
||||||
|
// set max upload size
|
||||||
|
$MAX_UPLOAD_SIZE = $base->StringByteFormat(ini_get('upload_max_filesize'));
|
||||||
|
$base->debug('UPLOADED FRONT', 'With max size: '.$MAX_UPLOAD_SIZE);
|
||||||
|
|
||||||
|
// very basic template output with super basic div for two file upload
|
||||||
|
?>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>File upload AJAX</title>
|
||||||
|
<link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css">
|
||||||
|
<style type="text/css">
|
||||||
|
.normal {
|
||||||
|
width: 25%;
|
||||||
|
}
|
||||||
|
.flx-s {
|
||||||
|
align-content: stretch;
|
||||||
|
display: flex;
|
||||||
|
flex: 1 100%;
|
||||||
|
}
|
||||||
|
.uploadError {
|
||||||
|
font-weight: bold;
|
||||||
|
color: red;
|
||||||
|
}
|
||||||
|
.uploadCancel {
|
||||||
|
font-weight: bold;
|
||||||
|
color: orange;
|
||||||
|
}
|
||||||
|
|
||||||
|
.qq-file-upload-button {
|
||||||
|
border: 1px solid #999999;
|
||||||
|
border-radius: 2px 2px 2px 2px;
|
||||||
|
box-shadow: 0 10px rgba(255, 255, 255, 0.3) inset, 0 10px rgba(255, 255, 255, 0.2) inset, 0 10px 2px rgba(255, 255, 255, 0.25) inset, 0 -1px 2px rgba(0, 0, 0, 0.3) inset;
|
||||||
|
text-align: center;
|
||||||
|
padding: 3px 5px 3px;
|
||||||
|
background-color: #cacaca;
|
||||||
|
margin: 2px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.qq-file-upload-button:hover {
|
||||||
|
box-shadow: 0 10px 2px rgba(107, 107, 107, 0.2) inset, 0 12px rgba(107, 107, 107, 0.05) inset, 0 12px 2px rgba(107, 107, 107, 0.1) inset, 0 -1px 2px rgba(255, 255, 255, 0.3) inset;
|
||||||
|
}
|
||||||
|
|
||||||
|
.qq-file-upload-button:active {
|
||||||
|
border: 1px solid red;
|
||||||
|
background-color: rgba(80, 80, 80, 0.5);
|
||||||
|
}
|
||||||
|
|
||||||
|
.qq-upload-cancel {
|
||||||
|
border: 1px solid red;
|
||||||
|
border-radius: 2px;
|
||||||
|
text-align: center;
|
||||||
|
padding: 3px 5px 3px;
|
||||||
|
background-color: #eb652d;
|
||||||
|
margin: 2px;
|
||||||
|
}
|
||||||
|
.qq-upload-cancel:hover {
|
||||||
|
background-color: #eb8686;
|
||||||
|
}
|
||||||
|
.qq-upload-cancel:active {
|
||||||
|
border: 1px solid black;
|
||||||
|
background-color: #eb2d2d;
|
||||||
|
}
|
||||||
|
|
||||||
|
.progressBarOutside {
|
||||||
|
background-color: #f1f1f1;
|
||||||
|
color: black;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.progressBarInside {
|
||||||
|
background-color: #1e9e84;
|
||||||
|
border-radius: 4px;
|
||||||
|
padding: 0.01em;
|
||||||
|
text-align: center;
|
||||||
|
font-size: 0.8em;
|
||||||
|
}
|
||||||
|
|
||||||
|
</style>
|
||||||
|
<script src="layout/default/javascript/prototype.js" type="text/javascript"></script>
|
||||||
|
<script src="layout/default/javascript/file-uploader/fileuploader.js" type="text/javascript"></script>
|
||||||
|
<script type="text/javascript">
|
||||||
|
function formatBytes(bytes)
|
||||||
|
{
|
||||||
|
var i = -1;
|
||||||
|
do {
|
||||||
|
bytes = bytes / 1024;
|
||||||
|
i++;
|
||||||
|
} while (bytes > 99);
|
||||||
|
|
||||||
|
// return Math.max(bytes, 0.1).toFixed(1) + ['kB', 'MB', 'GB', 'TB', 'PB', 'EB'][i];
|
||||||
|
return parseFloat(Math.round(bytes * Math.pow(10, 2)) / Math.pow(10, 2)) + ['kB', 'MB', 'GB', 'TB', 'PB', 'EB'][i];
|
||||||
|
}
|
||||||
|
var MAX_UPLOAD_SIZE = <?=$MAX_UPLOAD_SIZE;?>;
|
||||||
|
// function to add an AJAX uploadeder to the set
|
||||||
|
function createUploaderSin(divName, divNumber) {
|
||||||
|
divID = divName + '_' + divNumber;
|
||||||
|
console.log('Div: %s, Number: %s => ID: %s', divName, divNumber, divID);
|
||||||
|
$(divID + '_Cancel').hide();
|
||||||
|
var uploader = new qq.FileUploaderBasic({
|
||||||
|
// element: document.getElementById(divID),
|
||||||
|
element: $(divID),
|
||||||
|
cancel: $(divID + '_Cancel'),
|
||||||
|
action: 'qq_file_upload_ajax.php',
|
||||||
|
multiple: false,
|
||||||
|
button: $(divID),
|
||||||
|
allowedExtensions: ['csv', 'zip', 'jpg', 'pdf', 'bz2'],
|
||||||
|
sizeLimit: MAX_UPLOAD_SIZE, // size set from php ini
|
||||||
|
name: divID,
|
||||||
|
params: {
|
||||||
|
'file_pos': divNumber, // we need to add here ID or something
|
||||||
|
'action': 'upload',
|
||||||
|
'task_uid': divNumber // -> test for some internal uid
|
||||||
|
},
|
||||||
|
onSubmit: function(id, filename, target) {
|
||||||
|
console.log('File upload: "%s", ID: "%s" => "%s"', filename, id, target);
|
||||||
|
// remove any assigned error classes and flags
|
||||||
|
if ($(target + '_ProgressText').hasClassName('uploadError') || $(target + '_ProgressText').hasClassName('uploadCancel')) {
|
||||||
|
$(target + '_ProgressText').className = '';
|
||||||
|
$(target + '_Error').value = 0;
|
||||||
|
}
|
||||||
|
$(target + '_ProgressText').innerHTML = 'Start uploading file: ' + filename;
|
||||||
|
$(target + '_Cancel').show();
|
||||||
|
// disabled stuff here
|
||||||
|
},
|
||||||
|
onProgress: function(id, filename, loaded, total, target) {
|
||||||
|
console.log('Progress for file: "%s", ID: "%s", loaded: "%s", total: "%s" => "%s"', id, filename, loaded, total, target);
|
||||||
|
var percent = Math.round((loaded / total) * 100);
|
||||||
|
$(target + '_ProgressBar').innerHTML = percent + '%';
|
||||||
|
$(target + '_ProgressBar').style.width = percent + '%';
|
||||||
|
$(target + '_ProgressText').innerHTML = 'Uploading: ' + filename + ', ' + formatBytes(loaded) + '/' + formatBytes(total);
|
||||||
|
},
|
||||||
|
onComplete: function(id, filename, responseJSON, target) {
|
||||||
|
console.log('File upload for file "%s", id "%s" done with status "%s" => "%s", And success: %s', filename, id, responseJSON, target, responseJSON.result.success);
|
||||||
|
if (responseJSON.result.success) {
|
||||||
|
$(target + '_ProgressBar').innerHTML = '100%';
|
||||||
|
$(target + '_ProgressBar').style.width = '100%';
|
||||||
|
$(target + '_ProgressText').innerHTML = 'Uploaded: ' + filename + ' (' + responseJSON.filesize_formated + ')';
|
||||||
|
// also write hidden vars for this (file name, etc)
|
||||||
|
// for that we replace the divName part from the target and get just the pos number ?
|
||||||
|
// $(target + 'Name').value = filename;
|
||||||
|
// $(target + 'NameUpload').value = responseJSON.filename;
|
||||||
|
// $(target + 'Type').value = responseJSON.type;
|
||||||
|
// $(target + 'Size').value = responseJSON.filesize;
|
||||||
|
} else {
|
||||||
|
// set the error class
|
||||||
|
$(target + '_ProgressText').className = 'uploadError';
|
||||||
|
// flag error
|
||||||
|
$(target + '_Error').value = 1;
|
||||||
|
// and write the error
|
||||||
|
$(target + '_ProgressText').innerHTML = 'UPLOAD FAILED FOR FILE: ' + filename;
|
||||||
|
}
|
||||||
|
// renable stuff here
|
||||||
|
$(target + '_Cancel').hide();
|
||||||
|
},
|
||||||
|
onCancel: function (id, filename, target) {
|
||||||
|
// cancel upload
|
||||||
|
console.log('File upload cancled for file "%s", id "%s"', filename, id);
|
||||||
|
// upload cancel
|
||||||
|
$(target + '_ProgressText').className = 'uploadCancel';
|
||||||
|
$(target + '_Error').value = 1;
|
||||||
|
$(target + '_ProgressText').innerHTML = 'UPLOAD CANCELED FOR FILE: ' + filename;
|
||||||
|
$(target + '_Cancel').hide();
|
||||||
|
},
|
||||||
|
/*showMessage: function(message) {
|
||||||
|
console.log('MESSAGE: %s', message);
|
||||||
|
}, */
|
||||||
|
debug: true
|
||||||
|
});
|
||||||
|
// console.log('INIT Nr %s => cnt: %s', divNumber, uploader);
|
||||||
|
return uploader;
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<div id="masterGroup">
|
||||||
|
<div>File upload via AJAX (MAX SIZE: <?=$base->byteStringFormat($MAX_UPLOAD_SIZE);?>)</div>
|
||||||
|
<div class="flx-s">
|
||||||
|
<div id="Uploader_3WD7MAFmjAux_dlvvu13tezNj_XeSO0Ovauli0_MF5tISORiay7" class="normal qq-file-upload-button" style="width: 20%">Upload File</div>
|
||||||
|
<div style="width: 5%">
|
||||||
|
<div id="Uploader_3WD7MAFmjAux_dlvvu13tezNj_XeSO0Ovauli0_MF5tISORiay7_Cancel" class="qq-upload-cancel">X</div>
|
||||||
|
</div>
|
||||||
|
<div style="width: 75%; padding: 5px;">
|
||||||
|
<div id="Uploader_3WD7MAFmjAux_dlvvu13tezNj_XeSO0Ovauli0_MF5tISORiay7_ProgressText"></div>
|
||||||
|
<div class="progressBarOutside">
|
||||||
|
<div class="progressBarInside" id="Uploader_3WD7MAFmjAux_dlvvu13tezNj_XeSO0Ovauli0_MF5tISORiay7_ProgressBar" style="width: 0%">0%</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<input type="hidden" name="Uploader_3WD7MAFmjAux_dlvvu13tezNj_XeSO0Ovauli0_MF5tISORiay7_Error" id="Uploader_3WD7MAFmjAux_dlvvu13tezNj_XeSO0Ovauli0_MF5tISORiay7_Error" value="">
|
||||||
|
</div>
|
||||||
|
<div class="flx-s">
|
||||||
|
<div id="Uploader_3WD7MAFmjAux_dlvvu13tezNj_XeSO0Ovauli0_Ww9iWKrl3Xou" class="normal qq-file-upload-button" style="width: 20%">Upload File</div>
|
||||||
|
<div style="width: 5%">
|
||||||
|
<div id="Uploader_3WD7MAFmjAux_dlvvu13tezNj_XeSO0Ovauli0_Ww9iWKrl3Xou_Cancel" class="qq-upload-cancel">X</div>
|
||||||
|
</div>
|
||||||
|
<div style="width: 75%; padding: 5px;">
|
||||||
|
<div id="Uploader_3WD7MAFmjAux_dlvvu13tezNj_XeSO0Ovauli0_Ww9iWKrl3Xou_ProgressText"></div>
|
||||||
|
<div class="progressBarOutside">
|
||||||
|
<div class="progressBarInside" id="Uploader_3WD7MAFmjAux_dlvvu13tezNj_XeSO0Ovauli0_Ww9iWKrl3Xou_ProgressBar" style="width: 0%">0%</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<input type="hidden" name="Uploader_3WD7MAFmjAux_dlvvu13tezNj_XeSO0Ovauli0_Ww9iWKrl3Xou_Error" id="Uploader_3WD7MAFmjAux_dlvvu13tezNj_XeSO0Ovauli0_Ww9iWKrl3Xou_Error" value="">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
<script type="text/javascript">
|
||||||
|
// attach uploader to div areas
|
||||||
|
createUploaderSin('Uploader', '3WD7MAFmjAux_dlvvu13tezNj_XeSO0Ovauli0_MF5tISORiay7');
|
||||||
|
createUploaderSin('Uploader', '3WD7MAFmjAux_dlvvu13tezNj_XeSO0Ovauli0_Ww9iWKrl3Xou');
|
||||||
|
</script>
|
||||||
|
<?php
|
||||||
|
$base->printErrorMsg();
|
||||||
|
|
||||||
|
// __END__
|
||||||
29
www/admin/smarty_test.php
Normal file → Executable file
29
www/admin/smarty_test.php
Normal file → Executable file
@@ -7,14 +7,35 @@ $DB_DEBUG = 1;
|
|||||||
$LOG_PER_RUN = 1;
|
$LOG_PER_RUN = 1;
|
||||||
|
|
||||||
define('USE_DATABASE', true);
|
define('USE_DATABASE', true);
|
||||||
require("header.inc");
|
define('USE_HEADER', true);
|
||||||
|
require 'config.php';
|
||||||
|
require BASE.INCLUDES.'admin_header.inc';
|
||||||
$MASTER_TEMPLATE_NAME = 'main_body.tpl';
|
$MASTER_TEMPLATE_NAME = 'main_body.tpl';
|
||||||
$TEMPLATE_NAME = 'smarty_test.tpl';
|
$TEMPLATE_NAME = 'smarty_test.tpl';
|
||||||
$PAGE_WIDTH = 750;
|
$PAGE_WIDTH = 750;
|
||||||
require("set_paths.inc");
|
require BASE.INCLUDES.'admin_set_paths.inc';
|
||||||
|
|
||||||
// smarty test
|
// smarty test
|
||||||
$cms->DATA['SMARTY_TEST'] = 'Test Data';
|
$cms->DATA['SMARTY_TEST'] = 'Test Data';
|
||||||
|
|
||||||
require("smarty.inc");
|
// drop down test with optgroups
|
||||||
require("footer.inc");
|
$options = array (
|
||||||
|
'' => '選択してください',
|
||||||
|
'4/25(木)' => array (
|
||||||
|
'4/25(木) 11:00-11:50' => '4/25(木) 11:00-11:50',
|
||||||
|
'4/25(木) 12:20-13:00' => '4/25(木) 12:20-13:00'
|
||||||
|
),
|
||||||
|
'4/26(金)' => array (
|
||||||
|
'4/26(金) 11:00-11:50' => '4/26(金) 11:00-11:50',
|
||||||
|
'4/26(金) 12:20-13:00' => '4/26(金) 12:20-13:00'
|
||||||
|
),
|
||||||
|
'4/27(土)' => array (
|
||||||
|
'4/27(土) 11:00-11:50' => '4/27(土) 11:00-11:50',
|
||||||
|
'4/27(土) 12:20-13:00' => '4/27(土) 12:20-13:00'
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
$cms->DATA['drop_down_test'] = $options;
|
||||||
|
|
||||||
|
require BASE.INCLUDES.'admin_smarty.inc';
|
||||||
|
require BASE.INCLUDES.'admin_footer.inc';
|
||||||
|
|||||||
106
www/admin/various_class_test.php
Executable file
106
www/admin/various_class_test.php
Executable file
@@ -0,0 +1,106 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
$DEBUG_ALL_OVERRIDE = 0; // set to 1 to debug on live/remote server locations
|
||||||
|
$DEBUG_ALL = 1;
|
||||||
|
$PRINT_ALL = 1;
|
||||||
|
$DB_DEBUG = 1;
|
||||||
|
|
||||||
|
// admin class tests
|
||||||
|
// require 'config.inc';
|
||||||
|
require 'config.php';
|
||||||
|
DEFINE('SET_SESSION_NAME', EDIT_SESSION_NAME);
|
||||||
|
$base = new CoreLibs\Basic();
|
||||||
|
|
||||||
|
print "THIS HOST: ".HOST_NAME.", with PROTOCOL: ".HOST_PROTOCOL." is running SSL: ".HOST_SSL."<br>";
|
||||||
|
print "DIR: ".DIR."<br>";
|
||||||
|
print "BASE: ".BASE."<br>";
|
||||||
|
print "ROOT: ".ROOT."<br>";
|
||||||
|
print "HOST: ".$HOST_NAME." => DB HOST: ".$DB_HOST[$HOST_NAME]." => ".MAIN_DB."<br>";
|
||||||
|
|
||||||
|
$text = 'I am some text
|
||||||
|
with some
|
||||||
|
line breaks
|
||||||
|
in there. Theis
|
||||||
|
is sucky';
|
||||||
|
|
||||||
|
print "LB remove: ".$base->removeLB($text)."<br>";
|
||||||
|
print "LB remove: ".$base->removeLB($text, '##BR##')."<br>";
|
||||||
|
|
||||||
|
// $test = array (
|
||||||
|
// 'A' => array (
|
||||||
|
// 'B' => array (),
|
||||||
|
// 'C' => array (
|
||||||
|
// 'D' => array (),
|
||||||
|
// 'E' => array (
|
||||||
|
// 'F' => array ()
|
||||||
|
// )
|
||||||
|
// )
|
||||||
|
// ),
|
||||||
|
// '1' => array (),
|
||||||
|
// '2' => array (),
|
||||||
|
// '3' => array (
|
||||||
|
// 'G' => array ()
|
||||||
|
// )
|
||||||
|
// );
|
||||||
|
|
||||||
|
$base->debug('ARRAY', $base->printAr($test));
|
||||||
|
|
||||||
|
function rec($pre, $cur, $node = array ())
|
||||||
|
{
|
||||||
|
if (!is_array($node)) {
|
||||||
|
$node = array ();
|
||||||
|
}
|
||||||
|
print "<div style='color: green;'>#### PRE: ".$pre.", CUR: ".$cur.", N-c: ".count($node)." [".join('|', array_keys($node))."]</div>";
|
||||||
|
if (!$pre) {
|
||||||
|
print "** <span style='color: red;'>NEW</span><br>";
|
||||||
|
$node[$cur] = array ();
|
||||||
|
} else {
|
||||||
|
if (array_key_exists($pre, $node)) {
|
||||||
|
print "+ <span style='color: orange;'>KEY FOUND:</span> ".$pre.", add: ".$cur."<br>";
|
||||||
|
$node[$pre][$cur] = array ();
|
||||||
|
} else {
|
||||||
|
print "- NOT FOUND: loop<br>";
|
||||||
|
foreach ($node as $_pre => $_cur) {
|
||||||
|
print "> TRY: ".$_pre." => ".count($_cur)." [".join('|', array_keys($_cur))."]<br>";
|
||||||
|
if (count($_cur) > 0) {
|
||||||
|
$node[$_pre] = rec($pre, $cur, $_cur);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $node;
|
||||||
|
}
|
||||||
|
|
||||||
|
function flattenArrayKey(array $array, array $return = array ())
|
||||||
|
{
|
||||||
|
foreach ($array as $key => $sub) {
|
||||||
|
$return[] = $key;
|
||||||
|
if (count($sub) > 0) {
|
||||||
|
$return = flattenArrayKey($sub, $return);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// core
|
||||||
|
$test = rec('', 'A', $test);
|
||||||
|
$test = rec('', '1', $test);
|
||||||
|
$test = rec('', '2', $test);
|
||||||
|
$test = rec('', '3', $test);
|
||||||
|
$test = rec('3', 'G', $test);
|
||||||
|
$test = rec('A', 'B', $test);
|
||||||
|
$test = rec('A', 'C', $test);
|
||||||
|
$test = rec('C', 'D', $test);
|
||||||
|
$test = rec('C', 'E', $test);
|
||||||
|
$test = rec('E', 'F', $test);
|
||||||
|
// new
|
||||||
|
$test = rec('C', 'U', $test);
|
||||||
|
$test = rec('F', 'U', $test);
|
||||||
|
$test = rec('', 'Al', $test);
|
||||||
|
$test = rec('B', 'B1', $test);
|
||||||
|
$base->debug('REC', $base->printAr($test));
|
||||||
|
print "FLATTEN: ".$base->printAr(flattenArrayKey($test))."<br>";
|
||||||
|
|
||||||
|
print $base->printErrorMsg();
|
||||||
|
|
||||||
|
// __END__
|
||||||
BIN
www/composer.phar
Executable file
BIN
www/composer.phar
Executable file
Binary file not shown.
25
www/configs/config.db.inc
Executable file
25
www/configs/config.db.inc
Executable file
@@ -0,0 +1,25 @@
|
|||||||
|
<?php
|
||||||
|
/********************************************************************
|
||||||
|
* AUTHOR: Clemens Schwaighofer
|
||||||
|
* CREATED: 2018/10/11
|
||||||
|
* SHORT DESCRIPTION:
|
||||||
|
* configuration file for database settings
|
||||||
|
* HISTORY:
|
||||||
|
*********************************************************************/
|
||||||
|
|
||||||
|
// please be VERY carefull only to change the right side
|
||||||
|
$DB_CONFIG = array (
|
||||||
|
'test' => array (
|
||||||
|
'db_name' => 'gullevek',
|
||||||
|
'db_user' => 'gullevek',
|
||||||
|
'db_pass' => 'gullevek',
|
||||||
|
'db_host' => 'db.tokyo.tequila.jp',
|
||||||
|
'db_port' => '5432',
|
||||||
|
'db_schema' => 'public',
|
||||||
|
'db_type' => 'pgsql',
|
||||||
|
'db_encoding' => '',
|
||||||
|
'db_ssl' => 'disable' // allow, disable, require, prefer
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
// __END__
|
||||||
33
www/configs/config.host.inc
Executable file
33
www/configs/config.host.inc
Executable file
@@ -0,0 +1,33 @@
|
|||||||
|
<?php
|
||||||
|
/********************************************************************
|
||||||
|
* AUTHOR: Clemens Schwaighofer
|
||||||
|
* CREATED: 2018/10/11
|
||||||
|
* SHORT DESCRIPTION:
|
||||||
|
* configuration file for core host settings
|
||||||
|
* - DB access name (array group from config.db)
|
||||||
|
* - location (test/stage/live)
|
||||||
|
* - debug flag (true/false)
|
||||||
|
* - DB path (eg PUBLIC_SCHEMA)
|
||||||
|
* - stie lang
|
||||||
|
* HISTORY:
|
||||||
|
*********************************************************************/
|
||||||
|
|
||||||
|
// each host has a different db_host
|
||||||
|
// development host
|
||||||
|
$DB_HOST['soba.tokyo.tequila.jp'] = 'test';
|
||||||
|
// target host (live)
|
||||||
|
// $DB_TARGET_HOST['soba'] = '<DB ID>';
|
||||||
|
// url redirect database
|
||||||
|
// $DB_URL_REDIRECT_HOST['soba'] = '<DB ID>';
|
||||||
|
// location flagging
|
||||||
|
// test/dev/live
|
||||||
|
$LOCATION['soba.tokyo.tequila.jp'] = 'test';
|
||||||
|
// show DEBUG override
|
||||||
|
// true/false
|
||||||
|
$DEBUG_FLAG['soba.tokyo.tequila.jp'] = true;
|
||||||
|
// set postgresql paths (schemas)
|
||||||
|
$DB_PATH['soba.tokyo.tequila.jp'] = PUBLIC_SCHEMA;
|
||||||
|
// site language
|
||||||
|
$SITE_LANG['soba.tokyo.tequila.jp'] = 'en_utf8';
|
||||||
|
|
||||||
|
// __END__
|
||||||
25
www/configs/config.php
Executable file
25
www/configs/config.php
Executable file
@@ -0,0 +1,25 @@
|
|||||||
|
<?php
|
||||||
|
/********************************************************************
|
||||||
|
* AUTHOR: Clemens Schwaighofer
|
||||||
|
* CREATED: 2018/10/11
|
||||||
|
* SHORT DESCRIPTION:
|
||||||
|
* pre config included -> includes master config
|
||||||
|
* HISTORY:
|
||||||
|
*********************************************************************/
|
||||||
|
|
||||||
|
define('CONFIG_PATH', 'configs'.DIRECTORY_SEPARATOR);
|
||||||
|
// config path prefix search, start with 0, got down each level __DIR__ has, if nothing found -> bail
|
||||||
|
$CONFIG_PATH_PREFIX = '';
|
||||||
|
for ($dir_pos = 0, $dir_max = count(explode('/', __DIR__)); $dir_pos <= $dir_max; $dir_pos ++) {
|
||||||
|
$CONFIG_PATH_PREFIX .= '..'.DIRECTORY_SEPARATOR;
|
||||||
|
if (file_exists($CONFIG_PATH_PREFIX.CONFIG_PATH.'config.inc')) {
|
||||||
|
require $CONFIG_PATH_PREFIX.CONFIG_PATH.'config.inc';
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// fail if no base DS is not set
|
||||||
|
if (!defined('DS')) {
|
||||||
|
exit('Base config unloadable');
|
||||||
|
}
|
||||||
|
|
||||||
|
// __END__
|
||||||
@@ -1,259 +0,0 @@
|
|||||||
<?php
|
|
||||||
/********************************************************************
|
|
||||||
* AUTHOR: Clemens Schwaighofer
|
|
||||||
* CREATED: 2003/06/10
|
|
||||||
* SHORT DESCRIPTION:
|
|
||||||
* configuration file
|
|
||||||
* HISTORY:
|
|
||||||
*********************************************************************/
|
|
||||||
|
|
||||||
/************* SESSION NAMES *************/
|
|
||||||
// backend
|
|
||||||
DEFINE('EDIT_SESSION_NAME', "<ADMIN SESSION NAME>");
|
|
||||||
// frontend
|
|
||||||
DEFINE('SESSION_NAME', "<SESSION NAME>");
|
|
||||||
// set the session name
|
|
||||||
define('SET_SESSION_NAME', EDIT_SESSION_NAME);
|
|
||||||
|
|
||||||
/************* LANGUAGE / ENCODING *******/
|
|
||||||
DEFINE('DEFAULT_LANG', "en_utf8");
|
|
||||||
// default web page encoding setting
|
|
||||||
DEFINE('DEFAULT_ENCODING', "UTF-8");
|
|
||||||
|
|
||||||
/************* PATHS *********************/
|
|
||||||
// directory seperator
|
|
||||||
DEFINE('DS', DIRECTORY_SEPARATOR);
|
|
||||||
// ** NEW/BETTER DIR DECLARATIONS **
|
|
||||||
// path to original file (if symlink)
|
|
||||||
DEFINE('DIR', __DIR__.DS);
|
|
||||||
// base dir root folder level
|
|
||||||
DEFINE('BASE', str_replace('configs', '', __DIR__));
|
|
||||||
|
|
||||||
// ** OLD DIR DECLARATIONS **
|
|
||||||
// path to document root of file called
|
|
||||||
DEFINE('ROOT', getcwd().DS);
|
|
||||||
// libs path
|
|
||||||
DEFINE('LIB', 'lib'.DS);
|
|
||||||
DEFINE('LIBS', 'lib'.DS);
|
|
||||||
// includes (strings, arrays for static, etc)
|
|
||||||
DEFINE('INCLUDES', 'includes'.DS);
|
|
||||||
// layout base path
|
|
||||||
DEFINE('LAYOUT', 'layout'.DS);
|
|
||||||
// pic-root (compatible to CMS)
|
|
||||||
DEFINE('PICTURES', "images".DS);
|
|
||||||
// images
|
|
||||||
DEFINE('IMAGES', "images".DS);
|
|
||||||
// icons (below the images/ folder)
|
|
||||||
DEFINE('ICONS', 'icons'.DS);
|
|
||||||
// media
|
|
||||||
DEFINE('MEDIA', "media".DS);
|
|
||||||
// flash-root (below media)
|
|
||||||
DEFINE('FLASH', "flash".DS);
|
|
||||||
// uploads (anything to keep)
|
|
||||||
DEFINE('UPLOADS', "uploads".DS);
|
|
||||||
// files (binaries) (below media)
|
|
||||||
DEFINE('BINARIES', "binaries".DS);
|
|
||||||
// files (videos) (below media)
|
|
||||||
DEFINE('VIDEOS', "videos".DS);
|
|
||||||
// files (documents) (below media)
|
|
||||||
DEFINE('DOCUMENTS', "documents".DS);
|
|
||||||
// files (pdfs) (below media)
|
|
||||||
DEFINE('PDFS', "documents".DS);
|
|
||||||
// CSV
|
|
||||||
DEFINE('CSV', 'csv'.DS);
|
|
||||||
// css
|
|
||||||
DEFINE('CSS', "css".DS);
|
|
||||||
// js
|
|
||||||
DEFINE('JS', "javascript".DS);
|
|
||||||
// table arrays
|
|
||||||
DEFINE('TABLE_ARRAYS', "table_arrays".DS);
|
|
||||||
// smarty libs path
|
|
||||||
DEFINE('SMARTY', "Smarty".DS);
|
|
||||||
// po langs
|
|
||||||
DEFINE('LANG', "lang".DS);
|
|
||||||
// cache path
|
|
||||||
DEFINE('CACHE', "cache".DS);
|
|
||||||
// temp path
|
|
||||||
DEFINE('TMP', "tmp".DS);
|
|
||||||
// log files
|
|
||||||
DEFINE('LOG', 'log'.DS);
|
|
||||||
// compiled template folder
|
|
||||||
DEFINE('TEMPLATES_C', 'templates_c'.DS);
|
|
||||||
// template base
|
|
||||||
DEFINE('TEMPLATES', "templates".DS);
|
|
||||||
// frontend template dir', only for admin
|
|
||||||
DEFINE('TEMPLATES_FRONTEND', "templates_frontend".DS);
|
|
||||||
// default template
|
|
||||||
DEFINE('DEFAULT_TEMPLATE', "default".DS);
|
|
||||||
// default template file
|
|
||||||
DEFINE('DEFAULT_TEMPLATE_FILE', 'default.tpl');
|
|
||||||
|
|
||||||
/************* HASH / ACL DEFAULT / ERROR SETTINGS / SMARTY *************/
|
|
||||||
// default hash type
|
|
||||||
DEFINE('DEFAULT_HASH', 'sha256');
|
|
||||||
// default acl level
|
|
||||||
DEFINE('DEFAULT_ACL_LEVEL', 80);
|
|
||||||
// default levels for certain actions
|
|
||||||
/* DEFINE('DEFAULT_ACL_READ', 20);
|
|
||||||
DEFINE('DEFAULT_ACL_CONFIRM', 35);
|
|
||||||
DEFINE('DEFAULT_ACL_MOD', 40);
|
|
||||||
DEFINE('DEFAULT_ACL_WRITE', 60);
|
|
||||||
DEFINE('DEFAULT_ACL_SEND', 70);
|
|
||||||
DEFINE('DEFAULT_ACL_DEL', 80);
|
|
||||||
DEFINE('DEFAULT_ACL_ADMIN', 100); */
|
|
||||||
// SSL host name
|
|
||||||
// DEFINE('SSL_HOST', "ssl.host.name");
|
|
||||||
// error page strictness, Default is 3
|
|
||||||
// 1: only show error page as the last mesure if really no mid & aid can be loaded and found at all
|
|
||||||
// 2: if template not found, do not search, show error template
|
|
||||||
// 3: if default template is not found, show error template, do not fall back to default tree
|
|
||||||
// 4: very strict, even on normal fixable errors through error
|
|
||||||
// DEFINE('ERROR_STRICT', 3);
|
|
||||||
// allow page caching in general, set to "FALSE" if you do debugging or development!
|
|
||||||
// DEFINE('ALLOW_SMARTY_CACHE', FALSE);
|
|
||||||
// cache life time, in seconds, default here is 2 days (172800s)
|
|
||||||
// -1 is never expire cache
|
|
||||||
// DEFINE('SMARTY_CACHE_LIFETIME', -1);
|
|
||||||
|
|
||||||
/************* LOGOUT ********************/
|
|
||||||
// logout target
|
|
||||||
DEFINE('LOGOUT_TARGET', '');
|
|
||||||
// password change allowed
|
|
||||||
DEFINE('PASSWORD_CHANGE', false);
|
|
||||||
|
|
||||||
/************* AJAX / ACCESS *************/
|
|
||||||
// ajax request type
|
|
||||||
DEFINE('AJAX_REQUEST_TYPE', 'POST');
|
|
||||||
// what AJAX type to use
|
|
||||||
DEFINE('USE_PROTOTYPE', true);
|
|
||||||
DEFINE('USE_SCRIPTACULOUS', false);
|
|
||||||
DEFINE('USE_JQUERY', false);
|
|
||||||
|
|
||||||
/************* LAYOUT WIDTHS *************/
|
|
||||||
DEFINE('PAGE_WIDTH', 800);
|
|
||||||
// the default template name
|
|
||||||
DEFINE('MASTER_TEMPLATE_NAME', 'main_body.tpl');
|
|
||||||
|
|
||||||
/************* QUEUE TABLE *************/
|
|
||||||
// if we have a dev/live system
|
|
||||||
// set_live is a per page/per item
|
|
||||||
// live_queue is a global queue system
|
|
||||||
// DEFINE('QUEUE', 'live_queue');
|
|
||||||
|
|
||||||
/************* DB PATHS (PostgreSQL) *****************/
|
|
||||||
// schema names, can also be defined per <DB INFO>
|
|
||||||
DEFINE('PUBLIC_SCHEMA', 'public');
|
|
||||||
DEFINE('DEV_SCHEMA', 'public');
|
|
||||||
DEFINE('TEST_SCHEMA', 'public');
|
|
||||||
DEFINE('LIVE_SCHEMA', 'public');
|
|
||||||
|
|
||||||
// non constant part
|
|
||||||
/************* DB ACCESS *****************/
|
|
||||||
// please be VERY carefull only to change the right side
|
|
||||||
$DB_CONFIG = array (
|
|
||||||
"<DB ID>" => array (
|
|
||||||
"db_name" => "<DB NAME>",
|
|
||||||
"db_user" => "<DB USER>",
|
|
||||||
"db_pass" => "<DB PASSWORD>",
|
|
||||||
"db_host" => "<DB HOST>",
|
|
||||||
"db_port" => "5432",
|
|
||||||
"db_schema" => "<DB SCHEMA>", // if not set, uses public
|
|
||||||
"db_type" => "pgsql",
|
|
||||||
"db_encoding" => '',
|
|
||||||
"db_ssl" => 'disable' // allow, disable, require, prefer
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
// File and Folder paths
|
|
||||||
// ID is TARGET (first array element)
|
|
||||||
// $PATHS["test"]["csv_path"] = "";
|
|
||||||
// $PATHS["test"]["perl_bin"] = "";
|
|
||||||
// $PATHS["test"]["redirect_url"] = "";
|
|
||||||
|
|
||||||
// each host has a different db_host
|
|
||||||
// development host
|
|
||||||
$DB_HOST['<HOST NAME>'] = "<DB ID>";
|
|
||||||
// target host (live)
|
|
||||||
// $DB_TARGET_HOST['<HOST NAME>'] = "<DB ID>";
|
|
||||||
// url redirect database
|
|
||||||
// $DB_URL_REDIRECT_HOST['<HOST NAME>'] = "<DB ID>";
|
|
||||||
// location flagging
|
|
||||||
// test/dev/live
|
|
||||||
$LOCATION['<HOST NAME>'] = '<test|live|remote|etc>';
|
|
||||||
// show DEBUG override
|
|
||||||
// true/false
|
|
||||||
$DEBUG_FLAG['<HOST NAME>'] = true;
|
|
||||||
// set postgresql paths (schemas)
|
|
||||||
$DB_PATH['<HOST NAME>'] = PUBLIC_SCHEMA;
|
|
||||||
|
|
||||||
// set the USE_DATABASE var, if there is nothing set, we assume TRUE
|
|
||||||
$USE_DATABASE = defined('USE_DATABASE') ? USE_DATABASE : true;
|
|
||||||
|
|
||||||
// live frontend pages
|
|
||||||
// ** missing live domains **
|
|
||||||
// get the name without the port
|
|
||||||
list($HOST_NAME, $PORT) = array_pad(explode(":", $_SERVER['HTTP_HOST'], 2), 2, null);
|
|
||||||
if (!$DB_HOST[$HOST_NAME] && $USE_DATABASE) {
|
|
||||||
echo "No matching DB config found. Contact Admin<br>";
|
|
||||||
exit -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
// define the static names
|
|
||||||
DEFINE('LOGIN_DB', $DB_HOST[$HOST_NAME]);
|
|
||||||
DEFINE('MAIN_DB', $DB_HOST[$HOST_NAME]);
|
|
||||||
DEFINE('DB_SCHEMA', $DB_PATH[$HOST_NAME]);
|
|
||||||
// DEFINE('TARGET_DB', $DB_TARGET_HOST[$HOST_NAME]);
|
|
||||||
// DEFINE('URL_REDIRECT_DB', $DB_URL_REDIRECT_HOST[$HOST_NAME]);
|
|
||||||
// next three if top is not set
|
|
||||||
// DEFINE('DEV_SCHEMA', $DB_CONFIG[MAIN_DB]['db_schema']);
|
|
||||||
// DEFINE('TEST_SCHEMA', $DB_CONFIG[MAIN_DB]['db_schema']);
|
|
||||||
// DEFINE('PUBLIC_SCHEMA', $DB_CONFIG[TARGET_DB]['db_schema']);
|
|
||||||
DEFINE('LOGIN_DB_SCHEMA', 'public'); // where the edit* tables are
|
|
||||||
DEFINE('GLOBAL_DB_SCHEMA', 'public'); // where global tables are that are used by all schemas (eg queue tables for online, etc)
|
|
||||||
DEFINE('TARGET', $LOCATION[$HOST_NAME]);
|
|
||||||
// DEFINE('CSV_PATH', $PATHS[TARGET]['csv_path']);
|
|
||||||
// DEFINE('EXPORT_SCRIPT', $PATHS[TARGET]['perl_bin']);
|
|
||||||
// DEFINE('REDIRECT_URL', $PATHS[TARGET]['redirect_url']);
|
|
||||||
DEFINE('DEBUG', $DEBUG_FLAG[$HOST_NAME]);
|
|
||||||
DEFINE('SHOW_ALL_ERRORS', false); // show all errors if debug_all & show_error_handling are enabled
|
|
||||||
|
|
||||||
/************* GENERAL PAGE TITLE ********/
|
|
||||||
$G_TITLE = '<OVERALL PAGE TITLE>';
|
|
||||||
|
|
||||||
/************ STYLE SHEETS / JS **********/
|
|
||||||
$EDIT_STYLESHEET = "edit.css";
|
|
||||||
$EDIT_JAVASCRIPT = "edit.js";
|
|
||||||
|
|
||||||
$STYLESHEET = "frontend.css";
|
|
||||||
$JAVASCRIPT = "frontend.js";
|
|
||||||
|
|
||||||
/************* CONVERT *******************/
|
|
||||||
$paths = array (
|
|
||||||
'/bin',
|
|
||||||
'/usr/bin',
|
|
||||||
'/usr/local/bin'
|
|
||||||
);
|
|
||||||
// find convert
|
|
||||||
foreach ($paths as $path) {
|
|
||||||
if (file_exists($path."/convert") && is_file($path."/convert")) {
|
|
||||||
// image magick convert location
|
|
||||||
DEFINE('CONVERT', $path."/convert");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// turn off debug if debug flag is OFF
|
|
||||||
if (DEBUG == false) {
|
|
||||||
$ECHO_ALL = 0;
|
|
||||||
$DEBUG_ALL = 0;
|
|
||||||
$PRINT_ALL = 0;
|
|
||||||
$DB_DEBUG = 0;
|
|
||||||
$ENABLE_ERROR_HANDLING = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
// any other global definitons here
|
|
||||||
// DEFINE('SOME_ID', <SOME VALUE>);
|
|
||||||
|
|
||||||
// read auto loader
|
|
||||||
require BASE.LIB.'autoloader.php';
|
|
||||||
|
|
||||||
# __END__
|
|
||||||
61
www/includes/Date.Vars.inc
Normal file
61
www/includes/Date.Vars.inc
Normal file
@@ -0,0 +1,61 @@
|
|||||||
|
<?php
|
||||||
|
/********************************************************************
|
||||||
|
* AUTHOR: Clemens Schwaighofer
|
||||||
|
* CREATED: 2005/07/19
|
||||||
|
* SHORT DESCRIPTION:
|
||||||
|
* preset date variables
|
||||||
|
* HISTORY:
|
||||||
|
*********************************************************************/
|
||||||
|
|
||||||
|
$day_short = array (
|
||||||
|
1 => 'Mon',
|
||||||
|
2 => 'Tue',
|
||||||
|
3 => 'Wed',
|
||||||
|
4 => 'Thu',
|
||||||
|
5 => 'Fri',
|
||||||
|
6 => 'Sat',
|
||||||
|
7 => 'Sun'
|
||||||
|
);
|
||||||
|
|
||||||
|
$day_long = array (
|
||||||
|
1 => 'Monday',
|
||||||
|
2 => 'Tuesday',
|
||||||
|
3 => 'Wednesday',
|
||||||
|
4 => 'Thursday',
|
||||||
|
5 => 'Friday',
|
||||||
|
6 => 'Saturday',
|
||||||
|
7 => 'Sunday'
|
||||||
|
);
|
||||||
|
|
||||||
|
// months
|
||||||
|
$month_long = array (
|
||||||
|
1 => 'January',
|
||||||
|
2 => 'February',
|
||||||
|
3 => 'March',
|
||||||
|
4 => 'April',
|
||||||
|
5 => 'May',
|
||||||
|
6 => 'June',
|
||||||
|
7 => 'July',
|
||||||
|
8 => 'August',
|
||||||
|
9 => 'September',
|
||||||
|
10 => 'October',
|
||||||
|
11 => 'November',
|
||||||
|
12 => 'December'
|
||||||
|
);
|
||||||
|
|
||||||
|
$month_short = array (
|
||||||
|
1 => 'Jan',
|
||||||
|
2 => 'Feb',
|
||||||
|
3 => 'Mar',
|
||||||
|
4 => 'Apr',
|
||||||
|
5 => 'May',
|
||||||
|
6 => 'Jun',
|
||||||
|
7 => 'Jul',
|
||||||
|
8 => 'Aug',
|
||||||
|
9 => 'Sep',
|
||||||
|
10 => 'Oct',
|
||||||
|
11 => 'Nov',
|
||||||
|
12 => 'Dec'
|
||||||
|
);
|
||||||
|
|
||||||
|
// __END__
|
||||||
@@ -10,3 +10,5 @@
|
|||||||
// print debug messages
|
// print debug messages
|
||||||
echo $login->printErrorMsg();
|
echo $login->printErrorMsg();
|
||||||
echo $cms->printErrorMsg();
|
echo $cms->printErrorMsg();
|
||||||
|
|
||||||
|
// __END__
|
||||||
@@ -10,7 +10,7 @@
|
|||||||
//------------------------------ variable init start
|
//------------------------------ variable init start
|
||||||
// for dev test we set full error reporting; writes everything, except E_ERROR into logs/php_error-<day>.log
|
// for dev test we set full error reporting; writes everything, except E_ERROR into logs/php_error-<day>.log
|
||||||
if ($DEBUG_ALL && $ENABLE_ERROR_HANDLING) {
|
if ($DEBUG_ALL && $ENABLE_ERROR_HANDLING) {
|
||||||
include("libs/Error.Handling.inc");
|
include(BASE.LIBS."Error.Handling.inc");
|
||||||
}
|
}
|
||||||
// predefine vars
|
// predefine vars
|
||||||
$lang = '';
|
$lang = '';
|
||||||
@@ -22,7 +22,6 @@ extract($_POST, EXTR_SKIP);
|
|||||||
//------------------------------ library include start
|
//------------------------------ library include start
|
||||||
// set output to quiet for load of classes & session settings
|
// set output to quiet for load of classes & session settings
|
||||||
ob_start();
|
ob_start();
|
||||||
require("config.inc");
|
|
||||||
//------------------------------ library include end
|
//------------------------------ library include end
|
||||||
|
|
||||||
//------------------------------ basic variable settings start
|
//------------------------------ basic variable settings start
|
||||||
@@ -95,3 +94,5 @@ if ((TARGET == 'live' || TARGET == 'remote') && !$DEBUG_ALL_OVERRIDE) {
|
|||||||
$cms->print_output_all = 0;
|
$cms->print_output_all = 0;
|
||||||
}
|
}
|
||||||
$cms->DATA['JS_DEBUG'] = DEBUG;
|
$cms->DATA['JS_DEBUG'] = DEBUG;
|
||||||
|
|
||||||
|
// __END__
|
||||||
@@ -32,7 +32,7 @@ if ($_SESSION['DEFAULT_CHARSET']) {
|
|||||||
if ($_SESSION['DEFAULT_LANG']) {
|
if ($_SESSION['DEFAULT_LANG']) {
|
||||||
$lang = $_SESSION['DEFAULT_LANG'];
|
$lang = $_SESSION['DEFAULT_LANG'];
|
||||||
} elseif (!$lang) {
|
} elseif (!$lang) {
|
||||||
$lang = DEFAULT_LANG;
|
$lang = defined('SITE_LANG') ? SITE_LANG : DEFAULT_LANG;
|
||||||
}
|
}
|
||||||
// create the char lang encoding
|
// create the char lang encoding
|
||||||
$lang_short = substr($lang, 0, 2);
|
$lang_short = substr($lang, 0, 2);
|
||||||
@@ -55,13 +55,16 @@ $cms->CSS_SPECIAL_TEMPLATE_NAME = @$CSS_NAME;
|
|||||||
$cms->JS_SPECIAL_TEMPLATE_NAME = @$JS_NAME;
|
$cms->JS_SPECIAL_TEMPLATE_NAME = @$JS_NAME;
|
||||||
|
|
||||||
// set basic template path (tmp)
|
// set basic template path (tmp)
|
||||||
$smarty->setTemplateDir(LAYOUT.$TEMPLATE_DIR.TEMPLATES);
|
$cms->template_path = LAYOUT.$TEMPLATE_DIR.TEMPLATES;
|
||||||
$cms->lang_dir = LAYOUT.$TEMPLATE_DIR.LANG;
|
if ($smarty) {
|
||||||
$cms->includes = LAYOUT.$TEMPLATE_DIR.INCLUDES;
|
$smarty->setTemplateDir($cms->template_path);
|
||||||
|
}
|
||||||
|
$cms->lang_dir = LAYOUT.$TEMPLATE_DIR.LANG; // no outside
|
||||||
|
$cms->includes = BASE.INCLUDES; // no longer in templates, only global
|
||||||
$cms->javascript = LAYOUT.$TEMPLATE_DIR.JS;
|
$cms->javascript = LAYOUT.$TEMPLATE_DIR.JS;
|
||||||
$cms->css = LAYOUT.$TEMPLATE_DIR.CSS;
|
$cms->css = LAYOUT.$TEMPLATE_DIR.CSS;
|
||||||
$cms->pictures = LAYOUT.$TEMPLATE_DIR.IMAGES;
|
$cms->pictures = LAYOUT.$TEMPLATE_DIR.IMAGES;
|
||||||
$cms->cache_pictures = LAYOUT.$TEMPLATE_DIR.CACHE.IMAGES;
|
$cms->cache_pictures = LAYOUT.$TEMPLATE_DIR.CACHE;
|
||||||
$cms->cache_pictures_root = ROOT.$cms->cache_pictures;
|
$cms->cache_pictures_root = ROOT.$cms->cache_pictures;
|
||||||
if (!is_dir($cms->cache_pictures_root)) {
|
if (!is_dir($cms->cache_pictures_root)) {
|
||||||
mkdir($cms->cache_pictures_root);
|
mkdir($cms->cache_pictures_root);
|
||||||
@@ -80,20 +83,13 @@ if (!file_exists(ROOT.$smarty->getTemplateDir()[0].DS.MASTER_TEMPLATE_NAME)) {
|
|||||||
$smarty->setTemplateDir(LAYOUT.DEFAULT_TEMPLATE.TEMPLATES);
|
$smarty->setTemplateDir(LAYOUT.DEFAULT_TEMPLATE.TEMPLATES);
|
||||||
$template_set = DEFAULT_TEMPLATE;
|
$template_set = DEFAULT_TEMPLATE;
|
||||||
}
|
}
|
||||||
// loop to check if dir exists
|
|
||||||
// check if file exists, if not reset to default path
|
|
||||||
|
|
||||||
// check if the javascript folder exists in the template path, if not fall back to default
|
|
||||||
if (!is_dir($cms->javascript)) {
|
|
||||||
$cms->javascript = LAYOUT.DEFAULT_TEMPLATE.JS;
|
|
||||||
}
|
|
||||||
// check if lang_dir folder exists in the template path, if not fall back to default
|
// check if lang_dir folder exists in the template path, if not fall back to default
|
||||||
if (!is_dir($cms->lang_dir)) {
|
if (!is_dir($cms->lang_dir)) {
|
||||||
$cms->lang_dir = LAYOUT.DEFAULT_TEMPLATE.LANG;
|
$cms->lang_dir = LAYOUT.DEFAULT_TEMPLATE.LANG;
|
||||||
}
|
}
|
||||||
// check if include folder exists in the template path, if not fall back to default
|
// check if the javascript folder exists in the template path, if not fall back to default
|
||||||
if (!is_dir($cms->includes)) {
|
if (!is_dir($cms->javascript)) {
|
||||||
$cms->includes = LAYOUT.DEFAULT_TEMPLATE.INCLUDES;
|
$cms->javascript = LAYOUT.DEFAULT_TEMPLATE.JS;
|
||||||
}
|
}
|
||||||
// check if css folder exists in the template path, if not fall back to default
|
// check if css folder exists in the template path, if not fall back to default
|
||||||
if (!is_dir($cms->css)) {
|
if (!is_dir($cms->css)) {
|
||||||
@@ -103,19 +99,49 @@ if (!is_dir($cms->pictures)) {
|
|||||||
$cms->pictures = LAYOUT.DEFAULT_TEMPLATE.PICTURES;
|
$cms->pictures = LAYOUT.DEFAULT_TEMPLATE.PICTURES;
|
||||||
}
|
}
|
||||||
if (!is_dir($cms->cache_pictures)) {
|
if (!is_dir($cms->cache_pictures)) {
|
||||||
$cms->cache_pictures = LAYOUT.DEFAULT_TEMPLATE.CACHE.IMAGES;
|
$cms->cache_pictures = LAYOUT.DEFAULT_TEMPLATE.CACHE;
|
||||||
|
$cms->cache_pictures_root = ROOT.$cms->cache_pictures;
|
||||||
}
|
}
|
||||||
|
|
||||||
// if the template_dir is != DEFAULT_TEMPLATE, then try to make a lang switch
|
// if the template_dir is != DEFAULT_TEMPLATE, then try to make a lang switch
|
||||||
// if the default lang is not like the lang given, switch lang
|
// if the default lang is not like the lang given, switch lang
|
||||||
if (false === strstr(LAYOUT.DEFAULT_TEMPLATE.LANG, $cms->lang_dir) || strcasecmp(DEFAULT_LANG, $lang)) {
|
if (false === strstr(LAYOUT.DEFAULT_TEMPLATE.LANG, $cms->lang_dir) ||
|
||||||
$cms->debug('LANG', 'Orig: '.LAYOUT.DEFAULT_TEMPLATE.LANG.', New: '.$cms->lang_dir.' | Orig Lang: '.DEFAULT_LANG.', New Lang: '.$lang);
|
strcasecmp(defined('SITE_LANG') ? SITE_LANG : DEFAULT_LANG, $lang)
|
||||||
|
) {
|
||||||
|
$cms->debug('LANG', 'Orig: '.LAYOUT.DEFAULT_TEMPLATE.LANG.', New: '.$cms->lang_dir.' | Orig Lang: '.(defined('SITE_LANG') ? SITE_LANG : DEFAULT_LANG).', New Lang: '.$lang);
|
||||||
$cms->l->l10nReloadMOfile($lang, $cms->lang_dir);
|
$cms->l->l10nReloadMOfile($lang, $cms->lang_dir);
|
||||||
$smarty->l10n->l10nReloadMOfile($lang, $cms->lang_dir);
|
// if we have login class
|
||||||
|
if ($login) {
|
||||||
|
$login->l->l10nReloadMOfile($lang, $cms->lang_dir);
|
||||||
|
}
|
||||||
|
// if we have smarty template class
|
||||||
|
if ($smarty) {
|
||||||
|
$smarty->l10n->l10nReloadMOfile($lang, $cms->lang_dir);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// javascrip translate data as template for auto translate
|
||||||
|
if (!$TEMPLATE_TRANSLATE) {
|
||||||
|
$cms->debug('LANG', 'Load lang: '.$lang.', for page file jsTranslate_'.$lang.'.tpl');
|
||||||
|
$TEMPLATE_TRANSLATE = 'jsTranslate_'.$lang.'.tpl';
|
||||||
|
} else {
|
||||||
|
// we assume we have some fixed set
|
||||||
|
// we must add _<$lang>
|
||||||
|
// if .tpl, put before .tpl
|
||||||
|
// if not .tpl, add _<$lang>.tpl
|
||||||
|
if (strpos($TEMPLATE_TRANSLATE, '.tpl')) {
|
||||||
|
$TEMPLATE_TRANSLATE = str_replace('.tpl', '_'.$lang.'.tpl', $TEMPLATE_TRANSLATE);
|
||||||
|
} else {
|
||||||
|
$TEMPLATE_TRANSLATE .= '_'.$lang.'.tpl';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// if we can't find it, dump it
|
||||||
|
if (!file_exists($smarty->getTemplateDir()[0].DS.$TEMPLATE_TRANSLATE)) {
|
||||||
|
unset($TEMPLATE_TRANSLATE);
|
||||||
}
|
}
|
||||||
|
|
||||||
// $cms->debug("LANGUAGE", "L: $lang | ".$cms->lang_dir." | MO File: ".$cms->l->mofile);
|
// $cms->debug("LANGUAGE", "L: $lang | ".$cms->lang_dir." | MO File: ".$cms->l->mofile);
|
||||||
$cms->debug("LANGUAGE", "SL: ".$_SESSION['DEFAULT_CHARSET']." | ".$_SESSION['LANG']." | ".$_SESSION['DEFAULT_LANG']);
|
$cms->debug("LANGUAGE", "SL: ".$_SESSION['DEFAULT_CHARSET']." | ".$_SESSION['LANG']." | ".$_SESSION['DEFAULT_LANG']);
|
||||||
$cms->debug("TEMPLATE", "P: ".$smarty->getTemplateDir()[0]);
|
$cms->debug("TEMPLATE", "P: ".$smarty->getTemplateDir()[0]);
|
||||||
|
|
||||||
# __END__
|
// __END__
|
||||||
@@ -101,4 +101,4 @@ if (is_dir(BASE.CACHE)) {
|
|||||||
}
|
}
|
||||||
$smarty->display($MASTER_TEMPLATE_NAME, $TEMPLATE.$lang, $TEMPLATE.$lang);
|
$smarty->display($MASTER_TEMPLATE_NAME, $TEMPLATE.$lang, $TEMPLATE.$lang);
|
||||||
|
|
||||||
# __END__
|
// __END__
|
||||||
@@ -22,12 +22,12 @@ $DB_DEBUG = 1;
|
|||||||
|
|
||||||
extract($_POST, EXTR_SKIP);
|
extract($_POST, EXTR_SKIP);
|
||||||
|
|
||||||
$table_width = 750;
|
$table_width = '100%';
|
||||||
// this is for certain CMS modules that set a relative path
|
// this is for certain CMS modules that set a relative path
|
||||||
define('REL_PATH', '');
|
define('REL_PATH', '');
|
||||||
|
|
||||||
ob_start();
|
ob_start();
|
||||||
include("config.inc");
|
require 'config.php';
|
||||||
// set session name here
|
// set session name here
|
||||||
define('SET_SESSION_NAME', EDIT_SESSION_NAME);
|
define('SET_SESSION_NAME', EDIT_SESSION_NAME);
|
||||||
// overrride debug flags
|
// overrride debug flags
|
||||||
@@ -325,4 +325,4 @@ $smarty->display('edit_body.tpl');
|
|||||||
echo $login->printErrorMsg();
|
echo $login->printErrorMsg();
|
||||||
echo $form->printErrorMsg();
|
echo $form->printErrorMsg();
|
||||||
|
|
||||||
# __END__
|
// __END__
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
$edit_access = array (
|
$edit_access = array (
|
||||||
"table_array" => array (
|
"table_array" => array (
|
||||||
"edit_access_id" => array (
|
"edit_access_id" => array (
|
||||||
@@ -33,7 +34,7 @@ $edit_access = array (
|
|||||||
"value" => $GLOBALS["enabled"],
|
"value" => $GLOBALS["enabled"],
|
||||||
"output_name" => "Enabled",
|
"output_name" => "Enabled",
|
||||||
"type" => "binary",
|
"type" => "binary",
|
||||||
"int" => 1,
|
"int" => 1, // OR "bool" => 1
|
||||||
"element_list" => array (
|
"element_list" => array (
|
||||||
"1" => "Yes",
|
"1" => "Yes",
|
||||||
"0" => "No"
|
"0" => "No"
|
||||||
@@ -95,4 +96,4 @@ $edit_access = array (
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
# __END__
|
// __END__
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
$edit_groups = array (
|
$edit_groups = array (
|
||||||
"table_array" => array (
|
"table_array" => array (
|
||||||
"edit_group_id" => array (
|
"edit_group_id" => array (
|
||||||
@@ -98,4 +99,4 @@ $edit_groups = array (
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
# __END__
|
// __END__
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
$edit_languages=array (
|
$edit_languages=array (
|
||||||
"table_array" => array (
|
"table_array" => array (
|
||||||
"edit_language_id" => array (
|
"edit_language_id" => array (
|
||||||
@@ -71,4 +72,4 @@ $edit_languages=array (
|
|||||||
"table_name" => "edit_language"
|
"table_name" => "edit_language"
|
||||||
);
|
);
|
||||||
|
|
||||||
# __END__
|
// __END__
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
$edit_menu_group = array (
|
$edit_menu_group = array (
|
||||||
"table_array" => array (
|
"table_array" => array (
|
||||||
"edit_menu_group_id" => array (
|
"edit_menu_group_id" => array (
|
||||||
@@ -36,4 +37,4 @@ $edit_menu_group = array (
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
# __END__
|
// __END__
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
$edit_pages = array (
|
$edit_pages = array (
|
||||||
"table_array" => array (
|
"table_array" => array (
|
||||||
"edit_page_id" => array (
|
"edit_page_id" => array (
|
||||||
@@ -176,4 +177,4 @@ $edit_pages = array (
|
|||||||
) // element list
|
) // element list
|
||||||
);
|
);
|
||||||
|
|
||||||
# __END__
|
// __END__
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
$edit_schemes = array (
|
$edit_schemes = array (
|
||||||
"table_array" => array (
|
"table_array" => array (
|
||||||
"edit_scheme_id" => array (
|
"edit_scheme_id" => array (
|
||||||
@@ -53,4 +54,4 @@ $edit_schemes = array (
|
|||||||
)
|
)
|
||||||
); // main array
|
); // main array
|
||||||
|
|
||||||
# __END__
|
// __END__
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
$edit_users = array (
|
$edit_users = array (
|
||||||
"table_array" => array (
|
"table_array" => array (
|
||||||
"edit_user_id" => array (
|
"edit_user_id" => array (
|
||||||
@@ -257,4 +258,4 @@ $edit_users = array (
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
# __END__
|
// __END__
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
$edit_visible_group = array (
|
$edit_visible_group = array (
|
||||||
"table_array" => array (
|
"table_array" => array (
|
||||||
"edit_visible_group_id" => array (
|
"edit_visible_group_id" => array (
|
||||||
@@ -29,4 +30,4 @@ $edit_visible_group = array (
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
# __END__
|
// __END__
|
||||||
0
www/layout/admin/default/cache/index.php
vendored
Normal file
0
www/layout/admin/default/cache/index.php
vendored
Normal file
88
www/layout/admin/default/css/file-uploader/fileuploader.css
Normal file
88
www/layout/admin/default/css/file-uploader/fileuploader.css
Normal file
@@ -0,0 +1,88 @@
|
|||||||
|
.qq-uploader {
|
||||||
|
position: relative;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.qq-upload-button {
|
||||||
|
display: block; /* or inline-block */
|
||||||
|
width: 105px;
|
||||||
|
padding: 7px 0;
|
||||||
|
text-align: center;
|
||||||
|
background: #880000;
|
||||||
|
border-bottom: 1px solid #ddd;
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
.qq-upload-button-hover {
|
||||||
|
background: #cc0000;
|
||||||
|
}
|
||||||
|
.qq-upload-button-focus {
|
||||||
|
outline: 1px dotted black;
|
||||||
|
}
|
||||||
|
|
||||||
|
.qq-upload-drop-area {
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
min-height: 70px;
|
||||||
|
z-index: 2;
|
||||||
|
background: #FF9797;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
.qq-upload-drop-area span {
|
||||||
|
display: block;
|
||||||
|
position: absolute;
|
||||||
|
top: 50%;
|
||||||
|
width: 100%;
|
||||||
|
margin-top: -8px;
|
||||||
|
font-size: 16px;
|
||||||
|
}
|
||||||
|
.qq-upload-drop-area-active {
|
||||||
|
background:
|
||||||
|
#FF7171;
|
||||||
|
}
|
||||||
|
|
||||||
|
.qq-upload-list {
|
||||||
|
margin:
|
||||||
|
15px 35px;
|
||||||
|
padding: 0;
|
||||||
|
list-style: disc;
|
||||||
|
}
|
||||||
|
.qq-upload-list li {
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
line-height: 15px;
|
||||||
|
font-size: 12px;
|
||||||
|
}
|
||||||
|
.qq-upload-file, .qq-upload-spinner, .qq-upload-size, .qq-upload-cancel, .qq-upload-failed-text {
|
||||||
|
margin-right: 7px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.qq-upload-file {
|
||||||
|
}
|
||||||
|
.qq-upload-spinner {
|
||||||
|
display: inline-block;
|
||||||
|
/*background: url("loading.gif");*/
|
||||||
|
width: 15px;
|
||||||
|
height: 15px;
|
||||||
|
vertical-align: text-bottom;
|
||||||
|
/* non gif css rotate */
|
||||||
|
background: rgba(255, 255, 255, 0.6);
|
||||||
|
border: 2px solid rgba(255, 255, 255, 0.25);
|
||||||
|
border-left-color: rgba(102, 102, 102 ,1);
|
||||||
|
border-right-color: rgba(102, 102, 102 ,1);
|
||||||
|
border-radius: 50%;
|
||||||
|
animation: rotate 600ms infinite linear;
|
||||||
|
}
|
||||||
|
|
||||||
|
.qq-upload-size, .qq-upload-cancel {
|
||||||
|
font-size: 11px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.qq-upload-failed-text {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
.qq-upload-fail .qq-upload-failed-text {
|
||||||
|
display: inline;
|
||||||
|
}
|
||||||
0
www/layout/admin/default/css/index.php
Normal file
0
www/layout/admin/default/css/index.php
Normal file
0
www/layout/admin/default/images/index.php
Normal file
0
www/layout/admin/default/images/index.php
Normal file
0
www/layout/admin/default/index.php
Normal file
0
www/layout/admin/default/index.php
Normal file
@@ -17,20 +17,28 @@ if (clientPC.indexOf('opera') != -1) {
|
|||||||
var is_opera_preseven = (window.opera && !document.childNodes);
|
var is_opera_preseven = (window.opera && !document.childNodes);
|
||||||
var is_opera_seven = (window.opera && document.childNodes);
|
var is_opera_seven = (window.opera && document.childNodes);
|
||||||
}
|
}
|
||||||
|
// debug set
|
||||||
|
var FRONTEND_DEBUG = false;
|
||||||
|
var DEBUG = true;
|
||||||
|
if (!DEBUG) {
|
||||||
|
$($H(window.console)).each(function(w) {
|
||||||
|
window.console[w.key] = function() {};
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// METHOD: pop
|
||||||
|
// PARAMS: url, window name, features
|
||||||
|
// RETURN: none
|
||||||
|
// DESC : opens a popup window with winNAme and given features (string)
|
||||||
function pop(theURL, winName, features) {
|
function pop(theURL, winName, features) {
|
||||||
winName = window.open(theURL, winName, features);
|
winName = window.open(theURL, winName, features);
|
||||||
winName.focus();
|
winName.focus();
|
||||||
}
|
}
|
||||||
|
|
||||||
function emd_check_checkbox() {
|
// METHOD: expandTA
|
||||||
for (i = 0; i < document.manage_emails.length; i ++) {
|
// PARAMS: id
|
||||||
if (document.manage_emails.elements[i].checked == false && document.manage_emails.elements[i].type == 'checkbox') {
|
// RETURN: none
|
||||||
document.manage_emails.elements[i].checked = true;
|
// DESC : automatically resize a text area based on the amount of lines in it
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function expandTA(ta_id) {
|
function expandTA(ta_id) {
|
||||||
var ta;
|
var ta;
|
||||||
// if a string comes, its a get by id, else use it as an element pass on
|
// if a string comes, its a get by id, else use it as an element pass on
|
||||||
@@ -50,11 +58,13 @@ function expandTA(ta_id) {
|
|||||||
}
|
}
|
||||||
ta.rows = numNewRows + theRows.length;
|
ta.rows = numNewRows + theRows.length;
|
||||||
}
|
}
|
||||||
|
|
||||||
// METHOD: ShowHideMenu
|
// METHOD: ShowHideMenu
|
||||||
// PARAMS: status -> show or hide
|
// PARAMS: status -> show or hide
|
||||||
// id -> id to work on
|
// id -> id to work on
|
||||||
// RETURN: none
|
// RETURN: none
|
||||||
// DESC: shows or hides the menu
|
// DESC: shows or hides the menu
|
||||||
|
// this is used in some old menu templates
|
||||||
function ShowHideMenu(status, id)
|
function ShowHideMenu(status, id)
|
||||||
{
|
{
|
||||||
if (status == 'show') {
|
if (status == 'show') {
|
||||||
@@ -70,18 +80,7 @@ function ShowHideMenu(status, id)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function ShowHideDiv(id)
|
// used in old templates
|
||||||
{
|
|
||||||
element = document.getElementById(id);
|
|
||||||
if (element.className == 'visible' || !element.className) {
|
|
||||||
element.className = 'hidden';
|
|
||||||
} else {
|
|
||||||
element.className = 'visible';
|
|
||||||
}
|
|
||||||
|
|
||||||
// alert('E: ' + element.className + ' -- ' + element.style.visibility);
|
|
||||||
}
|
|
||||||
|
|
||||||
// move element action
|
// move element action
|
||||||
function mv(id, direction)
|
function mv(id, direction)
|
||||||
{
|
{
|
||||||
@@ -107,10 +106,39 @@ function le(id)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// METHOD: sh
|
||||||
|
// PARAMS: id -> element to hide
|
||||||
|
// showText -> text for the element if shown
|
||||||
|
// hideText -> text for the element if hidden
|
||||||
|
// RETURN: returns true if hidden, or false if not
|
||||||
|
// DESC : hides an element, additional writes 1 (show) or 0 (hide) into <id>Flag field
|
||||||
|
// this needs scriptacolous installed for BlindUp/BlindDown
|
||||||
|
function sh(id, showText, hideText)
|
||||||
|
{
|
||||||
|
flag = id + 'Flag';
|
||||||
|
btn = id + 'Btn';
|
||||||
|
// get status from element (hidden or visible)
|
||||||
|
divStatus = $(id).visible();
|
||||||
|
//console.log('Set flag %s for element %s', divStatus, id);
|
||||||
|
if (divStatus) {
|
||||||
|
// hide the element
|
||||||
|
Effect.BlindUp(id, {duration:0.3});
|
||||||
|
$(flag).value = 0;
|
||||||
|
$(btn).innerHTML = showText;
|
||||||
|
} else if (!divStatus) {
|
||||||
|
// show the element
|
||||||
|
Effect.BlindDown(id, {duration:0.3});
|
||||||
|
$(flag).value = 1;
|
||||||
|
$(btn).innerHTML = hideText;
|
||||||
|
}
|
||||||
|
// return current button status
|
||||||
|
return divStatus;
|
||||||
|
}
|
||||||
|
|
||||||
// METHOD: getWindowSize
|
// METHOD: getWindowSize
|
||||||
// PARAMS: none
|
// PARAMS: none
|
||||||
// RETURN: array with width/height
|
// RETURN: array with width/height
|
||||||
// DESC: wrapper to get the real window size for the current browser window
|
// DESC : wrapper to get the real window size for the current browser window
|
||||||
function getWindowSize()
|
function getWindowSize()
|
||||||
{
|
{
|
||||||
var width, height;
|
var width, height;
|
||||||
@@ -125,7 +153,7 @@ function getWindowSize()
|
|||||||
// METHOD: getScrollOffset
|
// METHOD: getScrollOffset
|
||||||
// PARAMS: none
|
// PARAMS: none
|
||||||
// RETURN: array with x/y px
|
// RETURN: array with x/y px
|
||||||
// DESC: wrapper to get the correct scroll offset
|
// DESC : wrapper to get the correct scroll offset
|
||||||
function getScrollOffset()
|
function getScrollOffset()
|
||||||
{
|
{
|
||||||
var left, top;
|
var left, top;
|
||||||
@@ -140,7 +168,7 @@ function getScrollOffset()
|
|||||||
// METHOD: setCenter
|
// METHOD: setCenter
|
||||||
// PARAMS: id to set center
|
// PARAMS: id to set center
|
||||||
// RETURN: none
|
// RETURN: none
|
||||||
// DESC: centers div to current window size middle
|
// DESC : centers div to current window size middle
|
||||||
function setCenter(id, left, top)
|
function setCenter(id, left, top)
|
||||||
{
|
{
|
||||||
// get size of id
|
// get size of id
|
||||||
@@ -166,38 +194,146 @@ function setCenter(id, left, top)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// METHOD sh
|
// METHOD: goToPos()
|
||||||
// PARAMS: id -> element to hide
|
// PARAMS: element, offset (default 0)
|
||||||
// showText -> text for the element if shown
|
// RETURN: none
|
||||||
// hideText -> text for the element if hidden
|
// DESC: goes to an element id position
|
||||||
// RETURN: returns true if hidden, or false if not
|
function goToPos(element, offset = 0)
|
||||||
// DESC: hides an element, additional writes 1 (show) or 0 (hide) into <id>Flag field
|
|
||||||
function sh(id, showText, hideText)
|
|
||||||
{
|
{
|
||||||
flag = id + 'Flag';
|
try {
|
||||||
btn = id + 'Btn';
|
if ($(element))
|
||||||
// get status from element (hidden or visible)
|
{
|
||||||
divStatus = $(id).visible();
|
// get the element pos
|
||||||
//console.log('Set flag %s for element %s', divStatus, id);
|
var pos = $(element).cumulativeOffset();
|
||||||
if (divStatus) {
|
// if not top element and no offset given, set auto offset for top element
|
||||||
// hide the element
|
// also compensate by -40 for some offset calc issue and not have it too much to the header
|
||||||
Effect.BlindUp(id, {duration:0.3});
|
if (pos.top != 0 && offset == 0) {
|
||||||
$(flag).value = 0;
|
offset = ($(GL_main_content_div).style.paddingTop.replace('px', '') * -1) - 40;
|
||||||
$(btn).innerHTML = showText;
|
}
|
||||||
} else if (!divStatus) {
|
//console.log('Scroll to: %s, Offset: %s [%s], PT: %s', element, offset, $('pbsMainContent').style.paddingTop.replace('px', ''), pos.top);
|
||||||
// show the element
|
window.scrollTo(pos.left, pos.top + offset);
|
||||||
Effect.BlindDown(id, {duration:0.3});
|
}
|
||||||
$(flag).value = 1;
|
} catch (err) {
|
||||||
$(btn).innerHTML = hideText;
|
errorCatch(err);
|
||||||
}
|
}
|
||||||
// return current button status
|
|
||||||
return divStatus;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// METHOD: __
|
||||||
|
// PARAMS: text
|
||||||
|
// RETURN: translated text (based on PHP selected language)
|
||||||
|
// DESC : uses the i18n array created in the translation template, that is filled from gettext in PHP (Smarty)
|
||||||
|
function __(string)
|
||||||
|
{
|
||||||
|
if (typeof i18n !== 'undefined' && isObject(i18n) && i18n[string]) {
|
||||||
|
return i18n[string];
|
||||||
|
} else {
|
||||||
|
return string;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// METHOD: string.format
|
||||||
|
// PARAMS: any, for string format
|
||||||
|
// RETURN: formatted string
|
||||||
|
// DESC : simple sprintf formater for replace
|
||||||
|
// "{0} is cool, {1} is not".format("Alpha", "Beta");
|
||||||
|
// First, checks if it isn't implemented yet.
|
||||||
|
if (!String.prototype.format) {
|
||||||
|
String.prototype.format = function()
|
||||||
|
{
|
||||||
|
var args = arguments;
|
||||||
|
return this.replace(/{(\d+)}/g, function(match, number)
|
||||||
|
{
|
||||||
|
return typeof args[number] != 'undefined' ?
|
||||||
|
args[number] :
|
||||||
|
match
|
||||||
|
;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
// METHOD: numberWithCommas
|
||||||
|
// PARAMS: number
|
||||||
|
// RETURN: formatted with , in thousands
|
||||||
|
// DESC : formats flat number 123456 to 123,456
|
||||||
|
const numberWithCommas = (x) => {
|
||||||
|
var parts = x.toString().split(".");
|
||||||
|
parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
||||||
|
return parts.join(".");
|
||||||
|
};
|
||||||
|
|
||||||
|
// METHOD:
|
||||||
|
// PARAMS: string
|
||||||
|
// RETURN: string with <br>
|
||||||
|
// DESC : converts line breaks to br
|
||||||
|
function convertLBtoBR(string)
|
||||||
|
{
|
||||||
|
return string.replace(/(?:\r\n|\r|\n)/g, '<br>');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!String.prototype.escapeHTML) {
|
||||||
|
String.prototype.escapeHTML = function() {
|
||||||
|
return this.replace(/[&<>"'\/]/g, function (s) {
|
||||||
|
var entityMap = {
|
||||||
|
"&": "&",
|
||||||
|
"<": "<",
|
||||||
|
">": ">",
|
||||||
|
'"': '"',
|
||||||
|
"'": ''',
|
||||||
|
"/": '/'
|
||||||
|
};
|
||||||
|
|
||||||
|
return entityMap[s];
|
||||||
|
});
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!String.prototype.unescapeHTML) {
|
||||||
|
String.prototype.unescapeHTML = function() {
|
||||||
|
return this.replace(/&[#\w]+;/g, function (s) {
|
||||||
|
var entityMap = {
|
||||||
|
"&": "&",
|
||||||
|
"<": "<",
|
||||||
|
">": ">",
|
||||||
|
'"': '"',
|
||||||
|
''': "'",
|
||||||
|
'/': "/"
|
||||||
|
};
|
||||||
|
|
||||||
|
return entityMap[s];
|
||||||
|
});
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
// METHOD: getTimestamp
|
||||||
|
// PARAMS: none
|
||||||
|
// RETURN: timestamp (in milliseconds)
|
||||||
|
// DESC : returns current timestamp (unix timestamp)
|
||||||
|
function getTimestamp()
|
||||||
|
{
|
||||||
|
let date = new Date();
|
||||||
|
return date.getTime();
|
||||||
|
}
|
||||||
|
|
||||||
|
// METHOD: isObject
|
||||||
|
// PARAMS: possible object
|
||||||
|
// RETURN: true/false if it is an object or not
|
||||||
|
function isObject(val) {
|
||||||
|
if (val === null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return ((typeof val === 'function') || (typeof val === 'object'));
|
||||||
|
}
|
||||||
|
|
||||||
|
// METHOD: exists
|
||||||
|
// PARAMS: uid
|
||||||
|
// RETURN: true/false
|
||||||
|
// DESC : checks if a DOM element actually exists
|
||||||
|
const exists = (id) => $(id) ? true : false;
|
||||||
|
|
||||||
// METHOD: formatBytes
|
// METHOD: formatBytes
|
||||||
// PARAMS: bytes in int
|
// PARAMS: bytes in int
|
||||||
// RETURN: string in GB/MB/KB
|
// RETURN: string in GB/MB/KB
|
||||||
// DESC: converts a int number into bytes with prefix in two decimals precision
|
// DESC : converts a int number into bytes with prefix in two decimals precision
|
||||||
// currently precision is fixed, if dynamic needs check for max/min precision
|
// currently precision is fixed, if dynamic needs check for max/min precision
|
||||||
function formatBytes(bytes)
|
function formatBytes(bytes)
|
||||||
{
|
{
|
||||||
@@ -210,6 +346,142 @@ function formatBytes(bytes)
|
|||||||
return parseFloat(Math.round(bytes * Math.pow(10, 2)) / Math.pow(10, 2)) + ['kB', 'MB', 'GB', 'TB', 'PB', 'EB'][i];
|
return parseFloat(Math.round(bytes * Math.pow(10, 2)) / Math.pow(10, 2)) + ['kB', 'MB', 'GB', 'TB', 'PB', 'EB'][i];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// METHOD: goToPos()
|
||||||
|
// PARAMS: element, offset (default 0)
|
||||||
|
// RETURN: none
|
||||||
|
// DESC : goes to an element id position
|
||||||
|
function goToPos(element, offset = 0)
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
if ($(element))
|
||||||
|
{
|
||||||
|
// get the element pos
|
||||||
|
var pos = $(element).cumulativeOffset();
|
||||||
|
// if not top element and no offset given, set auto offset for top element
|
||||||
|
// also compensate by -40 for some offset calc issue and not have it too much to the header
|
||||||
|
if (pos.top != 0 && offset == 0) {
|
||||||
|
offset = ($(GL_main_content_div).style.paddingTop.replace('px', '') * -1) - 40;
|
||||||
|
}
|
||||||
|
//console.log('Scroll to: %s, Offset: %s [%s], PT: %s', element, offset, $('pbsMainContent').style.paddingTop.replace('px', ''), pos.top);
|
||||||
|
window.scrollTo(pos.left, pos.top + offset);
|
||||||
|
}
|
||||||
|
} catch (err) {
|
||||||
|
errorCatch(err);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// METHOD: errorCatch
|
||||||
|
// PARAMS: err (error from try/catch
|
||||||
|
// RETURN: none
|
||||||
|
// DESC : prints out error messages based on data available from the browser
|
||||||
|
function errorCatch(err)
|
||||||
|
{
|
||||||
|
// for FF & Chrome
|
||||||
|
if (err.stack) {
|
||||||
|
// only FF
|
||||||
|
if (err.lineNumber) {
|
||||||
|
console.log('ERROR[%s:%s] %s', err.name, err.lineNumber, err.message);
|
||||||
|
} else if (err.line) {
|
||||||
|
// only Safari
|
||||||
|
console.log('ERROR[%s:%s] %s', err.name, err.line, err.message);
|
||||||
|
} else {
|
||||||
|
console.log('ERROR[%s] %s', err.name, err.message);
|
||||||
|
}
|
||||||
|
// stack trace
|
||||||
|
console.log('ERROR[stack] %s', err.stack);
|
||||||
|
} else if (err.number) {
|
||||||
|
// IE
|
||||||
|
console.log('ERROR[%s:%s] %s', err.name, err.number, err.message);
|
||||||
|
console.log('ERROR[description] %s', err.description);
|
||||||
|
} else {
|
||||||
|
// the rest
|
||||||
|
console.log('ERROR[%s] %s', err.name, err.message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// METHOD: actionIndicator
|
||||||
|
// PARAMS: none
|
||||||
|
// RETURN: none
|
||||||
|
// DESC : show or hide the "do" overlay
|
||||||
|
function actionIndicator(loc = '')
|
||||||
|
{
|
||||||
|
if ($('overlayBox').visible()) {
|
||||||
|
actionIndicatorHide(loc);
|
||||||
|
} else {
|
||||||
|
actionIndicatorShow(loc);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// METHOD: actionIndicatorShow/actionIndicatorHide
|
||||||
|
// PARAMS: loc for console log info
|
||||||
|
// RETURN: none
|
||||||
|
// DESC : explicit show/hide for action Indicator
|
||||||
|
// instead of automatically show or hide, do
|
||||||
|
// on command
|
||||||
|
function actionIndicatorShow(loc = '')
|
||||||
|
{
|
||||||
|
console.log('Indicator: SHOW [%s]', loc);
|
||||||
|
$('indicator').addClassName('progress');
|
||||||
|
setCenter('indicator', true, true);
|
||||||
|
$('indicator').show();
|
||||||
|
overlayBoxShow();
|
||||||
|
}
|
||||||
|
function actionIndicatorHide(loc = '')
|
||||||
|
{
|
||||||
|
console.log('Indicator: HIDE [%s]', loc);
|
||||||
|
$('indicator').hide();
|
||||||
|
$('indicator').removeClassName('progress');
|
||||||
|
overlayBoxHide();
|
||||||
|
}
|
||||||
|
|
||||||
|
// METHOD: overlayBoxView
|
||||||
|
// PARAMS: none
|
||||||
|
// RETURN: none
|
||||||
|
// DESC : shows or hides the overlay box
|
||||||
|
function overlayBoxShow()
|
||||||
|
{
|
||||||
|
// check if overlay box exists and if yes set the z-index to 100
|
||||||
|
if ($('overlayBox').visible()) {
|
||||||
|
$('overlayBox').style.zIndex = "100";
|
||||||
|
} else {
|
||||||
|
$('overlayBox').show();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function overlayBoxHide()
|
||||||
|
{
|
||||||
|
// if the overlay box z-index is 100, do no hide, but set to 98
|
||||||
|
if ($('overlayBox').style.zIndex == 100) {
|
||||||
|
$('overlayBox').style.zIndex = "98";
|
||||||
|
} else {
|
||||||
|
$('overlayBox').hide();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// METHOD: setOverlayBox
|
||||||
|
// PARAMS: none
|
||||||
|
// RETURN: none
|
||||||
|
// DESC : position the overlay block box and shows it
|
||||||
|
function setOverlayBox()
|
||||||
|
{
|
||||||
|
var viewport = document.viewport.getDimensions();
|
||||||
|
$('overlayBox').setStyle ({
|
||||||
|
width: '100%',
|
||||||
|
height: '100%'
|
||||||
|
});
|
||||||
|
$('overlayBox').show();
|
||||||
|
}
|
||||||
|
|
||||||
|
// METHOD: ClearCall
|
||||||
|
// PARAMS: none
|
||||||
|
// RETURN: none
|
||||||
|
// DESC : the abort call, clears the action box and hides it and the overlay box
|
||||||
|
function ClearCall()
|
||||||
|
{
|
||||||
|
$('actionBox').innerHTML = '';
|
||||||
|
$('actionBox').hide();
|
||||||
|
$('overlayBox').hide();
|
||||||
|
}
|
||||||
|
|
||||||
// *** DOM MANAGEMENT FUNCTIONS
|
// *** DOM MANAGEMENT FUNCTIONS
|
||||||
// METHOD: cel [create element]
|
// METHOD: cel [create element]
|
||||||
// PARAMS: tag: must set tag (div, span, etc)
|
// PARAMS: tag: must set tag (div, span, etc)
|
||||||
@@ -220,7 +492,7 @@ function formatBytes(bytes)
|
|||||||
// RETURN: object
|
// RETURN: object
|
||||||
// DESC : creates object for DOM element creation flow
|
// DESC : creates object for DOM element creation flow
|
||||||
const cel = (tag, id = '', content = '', css = [], options = {}) =>
|
const cel = (tag, id = '', content = '', css = [], options = {}) =>
|
||||||
element = {
|
_element = {
|
||||||
tag: tag,
|
tag: tag,
|
||||||
id: id,
|
id: id,
|
||||||
name: options.name, // override name if set [name gets ignored in tree build anyway]
|
name: options.name, // override name if set [name gets ignored in tree build anyway]
|
||||||
@@ -241,7 +513,7 @@ function ael(base, attach, id = '')
|
|||||||
if (id) {
|
if (id) {
|
||||||
// base id match already
|
// base id match already
|
||||||
if (base.id == id) {
|
if (base.id == id) {
|
||||||
base.sub.push(attach);
|
base.sub.push(Object.assign({}, attach));
|
||||||
} else {
|
} else {
|
||||||
// sub check
|
// sub check
|
||||||
if (base.sub.length > 0) {
|
if (base.sub.length > 0) {
|
||||||
@@ -252,12 +524,26 @@ function ael(base, attach, id = '')
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
base.sub.push(attach);
|
base.sub.push(Object.assign({}, attach));
|
||||||
}
|
}
|
||||||
return base;
|
return base;
|
||||||
}
|
}
|
||||||
|
|
||||||
// METHOD: rel [rese element]
|
// METHOD: aelx [attach n elements]
|
||||||
|
// PARAMS: base: object to where we attach the elements
|
||||||
|
// attach 1..n: attach directly to the base element those attachments
|
||||||
|
// RETURN: "none", technically there is no return needed
|
||||||
|
// DESC : directly attach n elements to one master base element
|
||||||
|
// this type does not support attach with optional id
|
||||||
|
function aelx(base, ...attach)
|
||||||
|
{
|
||||||
|
attach.each(function(t) {
|
||||||
|
base.sub.push(Object.assign({}, t));
|
||||||
|
});
|
||||||
|
return base;
|
||||||
|
}
|
||||||
|
|
||||||
|
// METHOD: rel [reset element]
|
||||||
// PARAMS: cel created element
|
// PARAMS: cel created element
|
||||||
// RETURN: "none", is self change, but returns base.sub
|
// RETURN: "none", is self change, but returns base.sub
|
||||||
// DESC : resets the sub elements of the base element given
|
// DESC : resets the sub elements of the base element given
|
||||||
@@ -267,26 +553,37 @@ const rel = (base) => base.sub = [];
|
|||||||
// PARAMS: element, style sheet to remove
|
// PARAMS: element, style sheet to remove
|
||||||
// RETURN: "none", in place because of reference
|
// RETURN: "none", in place because of reference
|
||||||
// DESC : searches and removes style from css array
|
// DESC : searches and removes style from css array
|
||||||
function rcssel(element, css)
|
function rcssel(_element, css)
|
||||||
{
|
{
|
||||||
let css_index = element.css.indexOf(css);
|
let css_index = _element.css.indexOf(css);
|
||||||
if (css_index > -1) {
|
if (css_index > -1) {
|
||||||
element.css.splice(css_index, 1);
|
_element.css.splice(css_index, 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// METHOD acssel [add css element]
|
// METHOD: acssel [add css element]
|
||||||
// PARAMS: element, style sheet to add
|
// PARAMS: element, style sheet to add
|
||||||
// RETURN: "none", in place add because of reference
|
// RETURN: "none", in place add because of reference
|
||||||
// DESC : adds a new style sheet to the element given
|
// DESC : adds a new style sheet to the element given
|
||||||
function acssel(element, css)
|
function acssel(_element, css)
|
||||||
{
|
{
|
||||||
let css_index = element.css.indexOf(css);
|
let css_index = _element.css.indexOf(css);
|
||||||
if (css_index > -1) {
|
if (css_index == -1) {
|
||||||
element.css.push(css);
|
_element.css.push(css);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// METHOD: scssel
|
||||||
|
// PARAMS: element, style to remove, style to add
|
||||||
|
// RETURN: "none", in place add because of reference
|
||||||
|
// DESC : removes one css and adds another
|
||||||
|
// is a wrapper around rcssel/acssel
|
||||||
|
function scssel(_element, rcss, acss)
|
||||||
|
{
|
||||||
|
rcssel(_element, rcss);
|
||||||
|
acssel(_element, acss);
|
||||||
|
}
|
||||||
|
|
||||||
// METHOD: phfo [produce html from object]
|
// METHOD: phfo [produce html from object]
|
||||||
// PARAMS: object tree with dom element declarations
|
// PARAMS: object tree with dom element declarations
|
||||||
// RETURN: HTML string that can be used as innerHTML
|
// RETURN: HTML string that can be used as innerHTML
|
||||||
@@ -331,9 +628,12 @@ function phfo(tree)
|
|||||||
// push finished line
|
// push finished line
|
||||||
content.push(line);
|
content.push(line);
|
||||||
// dive into sub tree to attach sub nodes
|
// dive into sub tree to attach sub nodes
|
||||||
// NOTES: we cannot have content (text) AND sub nodes at the same level
|
// NOTES: we can have content (text) AND sub nodes at the same level
|
||||||
// NODE takes preference over content
|
// CONTENT (TEXT) takes preference over SUB NODE in order
|
||||||
if (tree.sub.length > 0) {
|
if (tree.sub.length > 0) {
|
||||||
|
if (tree.content) {
|
||||||
|
content.push(tree.content);
|
||||||
|
}
|
||||||
tree.sub.each(function(t) {
|
tree.sub.each(function(t) {
|
||||||
content.push(phfo(t));
|
content.push(phfo(t));
|
||||||
});
|
});
|
||||||
@@ -347,39 +647,53 @@ function phfo(tree)
|
|||||||
// combine to string
|
// combine to string
|
||||||
return content.join('');
|
return content.join('');
|
||||||
}
|
}
|
||||||
|
// *** DOM MANAGEMENT FUNCTIONS
|
||||||
|
|
||||||
// BLOCK: html wrappers for quickly creating html data blocks
|
// BLOCK: html wrappers for quickly creating html data blocks
|
||||||
// METHOD: html_options
|
// METHOD: html_options
|
||||||
// PARAMS: name/id, array for the options, selected item uid
|
// PARAMS: name/id, array for the options, selected item uid
|
||||||
// options_only: if this is true, it will not print the select part
|
// options_only [def false] if this is true, it will not print the select part
|
||||||
// return_string, return as string and not as element
|
// return_string [def false]: return as string and not as element
|
||||||
|
// sort [def '']: if empty as is, else allowed 'keys', 'values' all others are ignored
|
||||||
// RETURN: html with build options block
|
// RETURN: html with build options block
|
||||||
// DESC : creates an select/options drop down block.
|
// DESC : creates an select/options drop down block.
|
||||||
// the array needs to be key -> value format. key is for the option id and value is for the data output
|
// the array needs to be key -> value format. key is for the option id and value is for the data output
|
||||||
function html_options(name, data, selected = '', options_only = false, return_string = false)
|
function html_options(name, data, selected = '', options_only = false, return_string = false, sort = '')
|
||||||
{
|
{
|
||||||
let content = [];
|
let content = [];
|
||||||
let element_select;
|
let element_select;
|
||||||
let element_option;
|
let element_option;
|
||||||
|
let data_list = []; // for sorted output
|
||||||
// set outside select, gets stripped on return if options only is true
|
// set outside select, gets stripped on return if options only is true
|
||||||
element_select = cel('select', name);
|
element_select = cel('select', name);
|
||||||
// console.log('Call for %s, options: %s', name, options_only);
|
// console.log('Call for %s, options: %s', name, options_only);
|
||||||
$H(data).each(function(t) {
|
if (sort == 'keys') {
|
||||||
console.log('options: key: %s, value: %s', t.key, t.value);
|
data_list = Object.keys(data).sort();
|
||||||
|
} else if (sort == 'values') {
|
||||||
|
data_list = Object.keys(data).sort((a, b) => ('' + data[a]).localeCompare(data[b]));
|
||||||
|
} else {
|
||||||
|
data_list = Object.keys(data);
|
||||||
|
}
|
||||||
|
// console.log('ORDER: %s', data_list);
|
||||||
|
// use the previously sorted list
|
||||||
|
// for (const [key, value] of Object.entries(data)) {
|
||||||
|
for (const key of data_list) {
|
||||||
|
let value = data[key];
|
||||||
|
console.log('create [%s] options: key: %s, value: %s', name, key, value);
|
||||||
// basic options init
|
// basic options init
|
||||||
let options = {
|
let options = {
|
||||||
'label': t.value,
|
'label': value,
|
||||||
'value': t.key
|
'value': key
|
||||||
};
|
};
|
||||||
// add selected if matching
|
// add selected if matching
|
||||||
if (selected == t.key) {
|
if (selected == key) {
|
||||||
options.selected = '';
|
options.selected = '';
|
||||||
}
|
}
|
||||||
// create the element option
|
// create the element option
|
||||||
element_option = cel('option', '', t.value, '', options);
|
element_option = cel('option', '', value, '', options);
|
||||||
// attach it to the select element
|
// attach it to the select element
|
||||||
ael(element_select, element_option);
|
ael(element_select, element_option);
|
||||||
});
|
}
|
||||||
// if with select part, convert to text
|
// if with select part, convert to text
|
||||||
if (!options_only) {
|
if (!options_only) {
|
||||||
if (return_string) {
|
if (return_string) {
|
||||||
@@ -391,7 +705,7 @@ function html_options(name, data, selected = '', options_only = false, return_st
|
|||||||
} else {
|
} else {
|
||||||
// strip select part
|
// strip select part
|
||||||
if (return_string) {
|
if (return_string) {
|
||||||
element.sub.each(function(t) {
|
element_select.sub.each(function(t) {
|
||||||
content.push(phfo(t));
|
content.push(phfo(t));
|
||||||
});
|
});
|
||||||
return content.join('');
|
return content.join('');
|
||||||
@@ -401,4 +715,71 @@ function html_options(name, data, selected = '', options_only = false, return_st
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// METHOD: html_options_refill
|
||||||
|
// PARAMS: name/id, array of options, sort = ''
|
||||||
|
// sort [def '']: if empty as is, else allowed 'keys', 'values' all others are ignored
|
||||||
|
// RETURN: none
|
||||||
|
// DESC : refills a select box with options and keeps the selected
|
||||||
|
function html_options_refill(name, data, sort = '')
|
||||||
|
{
|
||||||
|
let element_option;
|
||||||
|
let option_selected;
|
||||||
|
let data_list = []; // for sorted output
|
||||||
|
// skip if not exists
|
||||||
|
if ($(name)) {
|
||||||
|
// console.log('Call for %s, options: %s', name, options_only);
|
||||||
|
if (sort == 'keys') {
|
||||||
|
data_list = Object.keys(data).sort();
|
||||||
|
} else if (sort == 'values') {
|
||||||
|
data_list = Object.keys(data).sort((a, b) => ('' + data[a]).localeCompare(data[b]));
|
||||||
|
} else {
|
||||||
|
data_list = Object.keys(data);
|
||||||
|
}
|
||||||
|
// first read in existing ones from the options and get the selected one
|
||||||
|
[].forEach.call(document.querySelectorAll('#' + name + ' :checked'), function(elm) {
|
||||||
|
option_selected = elm.value;
|
||||||
|
});
|
||||||
|
$(name).innerHTML = '';
|
||||||
|
for (const key of data_list) {
|
||||||
|
let value = data[key];
|
||||||
|
// console.log('add [%s] options: key: %s, value: %s', name, key, value);
|
||||||
|
element_option = document.createElement('option');
|
||||||
|
element_option.label = value;
|
||||||
|
element_option.value = key;
|
||||||
|
element_option.innerHTML = value;
|
||||||
|
$(name).appendChild(element_option);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// METHOD: initDatepickr
|
||||||
|
// PARAMS: initial date ID (#)
|
||||||
|
// RETURN: true on ok, false on failure
|
||||||
|
// DESC : inits date pickr which translations for dates (week/month)
|
||||||
|
function initDatepickr(init_date)
|
||||||
|
{
|
||||||
|
if ($(init_date)) {
|
||||||
|
datepickr('#' + init_date); // we need to add this so we have it initialized before we can actually change the definitions
|
||||||
|
// dates in japanese
|
||||||
|
datepickr.prototype.l10n.months.shorthand = [__('Jan'), __('Feb'), __('Mar'), __('Apr'), __('May'), __('Jun'), __('Jul'), __('Aug'), __('Sep'), __('Oct'), __('Nov'), __('Dec')];
|
||||||
|
datepickr.prototype.l10n.months.longhand = [__('January'), __('February'), __('March'), __('April'), __('May'), __('June'), __('July'), __('August'), __('September'), __('October'), __('November'), __('December')];
|
||||||
|
datepickr.prototype.l10n.weekdays.shorthand = [__('Mon'), __('Tue'), __('Wed'), __('Thu'), __('Fri'), __('Sat'), __('Sun')];
|
||||||
|
datepickr.prototype.l10n.weekdays.longhand = [__('Monday'), __('Tuesday'), __('Wednesday'), __('Thursday'), __('Friday'), __('Saturday'), __('Sunday')];
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// *** MASTER logout call
|
||||||
|
// METHOD: loginLogout
|
||||||
|
// PARAMS: none
|
||||||
|
// RETURN: none
|
||||||
|
// DESC : submits basic data for form logout
|
||||||
|
function loginLogout()
|
||||||
|
{
|
||||||
|
$('login_logout').value = 'Logout';
|
||||||
|
$(form_name).submit();
|
||||||
|
}
|
||||||
|
|
||||||
/* END */
|
/* END */
|
||||||
|
|||||||
1313
www/layout/admin/default/javascript/file-uploader/fileuploader.js
Normal file
1313
www/layout/admin/default/javascript/file-uploader/fileuploader.js
Normal file
File diff suppressed because it is too large
Load Diff
0
www/layout/admin/default/javascript/index.php
Normal file
0
www/layout/admin/default/javascript/index.php
Normal file
@@ -1,4 +1,4 @@
|
|||||||
/* Prototype JavaScript framework, version 1.7.2
|
/* Prototype JavaScript framework, version 1.7.3
|
||||||
* (c) 2005-2010 Sam Stephenson
|
* (c) 2005-2010 Sam Stephenson
|
||||||
*
|
*
|
||||||
* Prototype is freely distributable under the terms of an MIT-style license.
|
* Prototype is freely distributable under the terms of an MIT-style license.
|
||||||
@@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
var Prototype = {
|
var Prototype = {
|
||||||
|
|
||||||
Version: '1.7.2',
|
Version: '1.7.3',
|
||||||
|
|
||||||
Browser: (function(){
|
Browser: (function(){
|
||||||
var ua = navigator.userAgent;
|
var ua = navigator.userAgent;
|
||||||
@@ -621,7 +621,7 @@ Object.extend(String.prototype, (function() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function stripTags() {
|
function stripTags() {
|
||||||
return this.replace(/<\w+(\s+("[^"]*"|'[^']*'|[^>])+)?>|<\/\w+>/gi, '');
|
return this.replace(/<\w+(\s+("[^"]*"|'[^']*'|[^>])+)?(\/)?>|<\/\w+>/gi, '');
|
||||||
}
|
}
|
||||||
|
|
||||||
function stripScripts() {
|
function stripScripts() {
|
||||||
@@ -734,7 +734,7 @@ Object.extend(String.prototype, (function() {
|
|||||||
|
|
||||||
function evalJSON(sanitize) {
|
function evalJSON(sanitize) {
|
||||||
var json = this.unfilterJSON(),
|
var json = this.unfilterJSON(),
|
||||||
cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;
|
cx = /[\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff\u0000]/g;
|
||||||
if (cx.test(json)) {
|
if (cx.test(json)) {
|
||||||
json = json.replace(cx, function (a) {
|
json = json.replace(cx, function (a) {
|
||||||
return '\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4);
|
return '\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4);
|
||||||
@@ -1332,10 +1332,9 @@ Array.from = $A;
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (arrayProto.some) {
|
if (arrayProto.some) {
|
||||||
var some = wrapNative(Array.prototype.some);
|
some = wrapNative(Array.prototype.some);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function every(iterator) {
|
function every(iterator) {
|
||||||
if (this == null) throw new TypeError();
|
if (this == null) throw new TypeError();
|
||||||
iterator = iterator || Prototype.K;
|
iterator = iterator || Prototype.K;
|
||||||
@@ -1352,22 +1351,16 @@ Array.from = $A;
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (arrayProto.every) {
|
if (arrayProto.every) {
|
||||||
var every = wrapNative(Array.prototype.every);
|
every = wrapNative(Array.prototype.every);
|
||||||
}
|
}
|
||||||
|
|
||||||
var _reduce = arrayProto.reduce;
|
|
||||||
function inject(memo, iterator) {
|
|
||||||
iterator = iterator || Prototype.K;
|
|
||||||
var context = arguments[2];
|
|
||||||
return _reduce.call(this, iterator.bind(context), memo);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!arrayProto.reduce) {
|
|
||||||
var inject = Enumerable.inject;
|
|
||||||
}
|
|
||||||
|
|
||||||
Object.extend(arrayProto, Enumerable);
|
Object.extend(arrayProto, Enumerable);
|
||||||
|
|
||||||
|
if (arrayProto.entries === Enumerable.entries) {
|
||||||
|
delete arrayProto.entries;
|
||||||
|
}
|
||||||
|
|
||||||
if (!arrayProto._reverse)
|
if (!arrayProto._reverse)
|
||||||
arrayProto._reverse = arrayProto.reverse;
|
arrayProto._reverse = arrayProto.reverse;
|
||||||
|
|
||||||
@@ -1383,7 +1376,6 @@ Array.from = $A;
|
|||||||
any: some,
|
any: some,
|
||||||
every: every,
|
every: every,
|
||||||
all: every,
|
all: every,
|
||||||
inject: inject,
|
|
||||||
|
|
||||||
clear: clear,
|
clear: clear,
|
||||||
first: first,
|
first: first,
|
||||||
@@ -2146,12 +2138,12 @@ Ajax.PeriodicalUpdater = Class.create(Ajax.Base, {
|
|||||||
|
|
||||||
|
|
||||||
function visible(element) {
|
function visible(element) {
|
||||||
return $(element).style.display !== 'none';
|
return $(element).getStyle('display') !== 'none';
|
||||||
}
|
}
|
||||||
|
|
||||||
function toggle(element, bool) {
|
function toggle(element, bool) {
|
||||||
element = $(element);
|
element = $(element);
|
||||||
if (Object.isUndefined(bool))
|
if (typeof bool !== 'boolean')
|
||||||
bool = !Element.visible(element);
|
bool = !Element.visible(element);
|
||||||
Element[bool ? 'show' : 'hide'](element);
|
Element[bool ? 'show' : 'hide'](element);
|
||||||
|
|
||||||
@@ -2683,6 +2675,7 @@ Ajax.PeriodicalUpdater = Class.create(Ajax.Base, {
|
|||||||
|
|
||||||
function descendantOf_DOM(element, ancestor) {
|
function descendantOf_DOM(element, ancestor) {
|
||||||
element = $(element), ancestor = $(ancestor);
|
element = $(element), ancestor = $(ancestor);
|
||||||
|
if (!element || !ancestor) return false;
|
||||||
while (element = element.parentNode)
|
while (element = element.parentNode)
|
||||||
if (element === ancestor) return true;
|
if (element === ancestor) return true;
|
||||||
return false;
|
return false;
|
||||||
@@ -2690,12 +2683,14 @@ Ajax.PeriodicalUpdater = Class.create(Ajax.Base, {
|
|||||||
|
|
||||||
function descendantOf_contains(element, ancestor) {
|
function descendantOf_contains(element, ancestor) {
|
||||||
element = $(element), ancestor = $(ancestor);
|
element = $(element), ancestor = $(ancestor);
|
||||||
|
if (!element || !ancestor) return false;
|
||||||
if (!ancestor.contains) return descendantOf_DOM(element, ancestor);
|
if (!ancestor.contains) return descendantOf_DOM(element, ancestor);
|
||||||
return ancestor.contains(element) && ancestor !== element;
|
return ancestor.contains(element) && ancestor !== element;
|
||||||
}
|
}
|
||||||
|
|
||||||
function descendantOf_compareDocumentPosition(element, ancestor) {
|
function descendantOf_compareDocumentPosition(element, ancestor) {
|
||||||
element = $(element), ancestor = $(ancestor);
|
element = $(element), ancestor = $(ancestor);
|
||||||
|
if (!element || !ancestor) return false;
|
||||||
return (element.compareDocumentPosition(ancestor) & 8) === 8;
|
return (element.compareDocumentPosition(ancestor) & 8) === 8;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2800,8 +2795,10 @@ Ajax.PeriodicalUpdater = Class.create(Ajax.Base, {
|
|||||||
for (var attr in attributes) {
|
for (var attr in attributes) {
|
||||||
name = table.names[attr] || attr;
|
name = table.names[attr] || attr;
|
||||||
value = attributes[attr];
|
value = attributes[attr];
|
||||||
if (table.values[attr])
|
if (table.values[attr]) {
|
||||||
name = table.values[attr](element, value) || name;
|
value = table.values[attr](element, value);
|
||||||
|
if (Object.isUndefined(value)) continue;
|
||||||
|
}
|
||||||
if (value === false || value === null)
|
if (value === false || value === null)
|
||||||
element.removeAttribute(name);
|
element.removeAttribute(name);
|
||||||
else if (value === true)
|
else if (value === true)
|
||||||
@@ -2979,7 +2976,9 @@ Ajax.PeriodicalUpdater = Class.create(Ajax.Base, {
|
|||||||
|
|
||||||
values: {
|
values: {
|
||||||
checked: function(element, value) {
|
checked: function(element, value) {
|
||||||
element.checked = !!value;
|
value = !!value;
|
||||||
|
element.checked = value;
|
||||||
|
return value ? 'checked' : null;
|
||||||
},
|
},
|
||||||
|
|
||||||
style: function(element, value) {
|
style: function(element, value) {
|
||||||
@@ -3124,8 +3123,11 @@ Ajax.PeriodicalUpdater = Class.create(Ajax.Base, {
|
|||||||
value = element.currentStyle[style];
|
value = element.currentStyle[style];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (style === 'opacity' && !STANDARD_CSS_OPACITY_SUPPORTED)
|
if (style === 'opacity') {
|
||||||
return getOpacity_IE(element);
|
if (!STANDARD_CSS_OPACITY_SUPPORTED)
|
||||||
|
return getOpacity_IE(element);
|
||||||
|
else return value ? parseFloat(value) : 1.0;
|
||||||
|
}
|
||||||
|
|
||||||
if (value === 'auto') {
|
if (value === 'auto') {
|
||||||
if ((style === 'width' || style === 'height') && Element.visible(element))
|
if ((style === 'width' || style === 'height') && Element.visible(element))
|
||||||
@@ -3177,7 +3179,7 @@ Ajax.PeriodicalUpdater = Class.create(Ajax.Base, {
|
|||||||
if (value < 0.00001) value = 0;
|
if (value < 0.00001) value = 0;
|
||||||
|
|
||||||
style.filter = stripAlphaFromFilter_IE(filter) +
|
style.filter = stripAlphaFromFilter_IE(filter) +
|
||||||
'alpha(opacity=' + (value * 100) + ')';
|
' alpha(opacity=' + (value * 100) + ')';
|
||||||
|
|
||||||
return element;
|
return element;
|
||||||
}
|
}
|
||||||
@@ -3193,7 +3195,7 @@ Ajax.PeriodicalUpdater = Class.create(Ajax.Base, {
|
|||||||
|
|
||||||
var filter = Element.getStyle(element, 'filter');
|
var filter = Element.getStyle(element, 'filter');
|
||||||
if (filter.length === 0) return 1.0;
|
if (filter.length === 0) return 1.0;
|
||||||
var match = (filter || '').match(/alpha\(opacity=(.*)\)/);
|
var match = (filter || '').match(/alpha\(opacity=(.*)\)/i);
|
||||||
if (match && match[1]) return parseFloat(match[1]) / 100;
|
if (match && match[1]) return parseFloat(match[1]) / 100;
|
||||||
return 1.0;
|
return 1.0;
|
||||||
}
|
}
|
||||||
@@ -3519,7 +3521,7 @@ Ajax.PeriodicalUpdater = Class.create(Ajax.Base, {
|
|||||||
return boxWidth - bl - br - pl - pr;
|
return boxWidth - bl - br - pl - pr;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ('currentStyle' in document.documentElement) {
|
if (!Object.isUndefined(document.documentElement.currentStyle) && !Prototype.Browser.Opera) {
|
||||||
getRawStyle = getRawStyle_IE;
|
getRawStyle = getRawStyle_IE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -4047,15 +4049,19 @@ Ajax.PeriodicalUpdater = Class.create(Ajax.Base, {
|
|||||||
function getOffsetParent(element) {
|
function getOffsetParent(element) {
|
||||||
element = $(element);
|
element = $(element);
|
||||||
|
|
||||||
|
function selfOrBody(element) {
|
||||||
|
return isHtml(element) ? $(document.body) : $(element);
|
||||||
|
}
|
||||||
|
|
||||||
if (isDocument(element) || isDetached(element) || isBody(element) || isHtml(element))
|
if (isDocument(element) || isDetached(element) || isBody(element) || isHtml(element))
|
||||||
return $(document.body);
|
return $(document.body);
|
||||||
|
|
||||||
var isInline = (Element.getStyle(element, 'display') === 'inline');
|
var isInline = (Element.getStyle(element, 'display') === 'inline');
|
||||||
if (!isInline && element.offsetParent) return $(element.offsetParent);
|
if (!isInline && element.offsetParent) return selfOrBody(element.offsetParent);
|
||||||
|
|
||||||
while ((element = element.parentNode) && element !== document.body) {
|
while ((element = element.parentNode) && element !== document.body) {
|
||||||
if (Element.getStyle(element, 'position') !== 'static') {
|
if (Element.getStyle(element, 'position') !== 'static') {
|
||||||
return isHtml(element) ? $(document.body) : $(element);
|
return selfOrBody(element);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -4093,8 +4099,8 @@ Ajax.PeriodicalUpdater = Class.create(Ajax.Base, {
|
|||||||
}
|
}
|
||||||
} while (element);
|
} while (element);
|
||||||
|
|
||||||
valueL -= layout.get('margin-top');
|
valueL -= layout.get('margin-left');
|
||||||
valueT -= layout.get('margin-left');
|
valueT -= layout.get('margin-top');
|
||||||
|
|
||||||
return new Element.Offset(valueL, valueT);
|
return new Element.Offset(valueL, valueT);
|
||||||
}
|
}
|
||||||
@@ -4265,6 +4271,8 @@ Ajax.PeriodicalUpdater = Class.create(Ajax.Base, {
|
|||||||
offsetLeft: 0
|
offsetLeft: 0
|
||||||
}, options || {});
|
}, options || {});
|
||||||
|
|
||||||
|
var docEl = document.documentElement;
|
||||||
|
|
||||||
source = $(source);
|
source = $(source);
|
||||||
element = $(element);
|
element = $(element);
|
||||||
var p, delta, layout, styles = {};
|
var p, delta, layout, styles = {};
|
||||||
@@ -4278,19 +4286,41 @@ Ajax.PeriodicalUpdater = Class.create(Ajax.Base, {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function pageScrollXY() {
|
||||||
|
var x = 0, y = 0;
|
||||||
|
if (Object.isNumber(window.pageXOffset)) {
|
||||||
|
x = window.pageXOffset;
|
||||||
|
y = window.pageYOffset;
|
||||||
|
} else if (document.body && (document.body.scrollLeft || document.body.scrollTop)) {
|
||||||
|
x = document.body.scrollLeft;
|
||||||
|
y = document.body.scrollTop;
|
||||||
|
} else if (docEl && (docEl.scrollLeft || docEl.scrollTop)) {
|
||||||
|
x = docEl.scrollLeft;
|
||||||
|
y = docEl.scrollTop;
|
||||||
|
}
|
||||||
|
return { x: x, y: y };
|
||||||
|
}
|
||||||
|
|
||||||
|
var pageXY = pageScrollXY();
|
||||||
|
|
||||||
|
|
||||||
if (options.setWidth || options.setHeight) {
|
if (options.setWidth || options.setHeight) {
|
||||||
layout = Element.getLayout(source);
|
layout = Element.getLayout(source);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (options.setLeft)
|
if (options.setLeft)
|
||||||
styles.left = (p[0] - delta[0] + options.offsetLeft) + 'px';
|
styles.left = (p[0] + pageXY.x - delta[0] + options.offsetLeft) + 'px';
|
||||||
if (options.setTop)
|
if (options.setTop)
|
||||||
styles.top = (p[1] - delta[1] + options.offsetTop) + 'px';
|
styles.top = (p[1] + pageXY.y - delta[1] + options.offsetTop) + 'px';
|
||||||
|
|
||||||
if (options.setWidth)
|
var currentLayout = element.getLayout();
|
||||||
styles.width = layout.get('border-box-width') + 'px';
|
|
||||||
if (options.setHeight)
|
if (options.setWidth) {
|
||||||
styles.height = layout.get('border-box-height') + 'px';
|
styles.width = layout.get('width') + 'px';
|
||||||
|
}
|
||||||
|
if (options.setHeight) {
|
||||||
|
styles.height = layout.get('height') + 'px';
|
||||||
|
}
|
||||||
|
|
||||||
return Element.setStyle(element, styles);
|
return Element.setStyle(element, styles);
|
||||||
}
|
}
|
||||||
@@ -4488,15 +4518,29 @@ Prototype.Selector = (function() {
|
|||||||
};
|
};
|
||||||
})();
|
})();
|
||||||
Prototype._original_property = window.Sizzle;
|
Prototype._original_property = window.Sizzle;
|
||||||
|
|
||||||
|
;(function () {
|
||||||
|
function fakeDefine(fn) {
|
||||||
|
Prototype._actual_sizzle = fn();
|
||||||
|
}
|
||||||
|
fakeDefine.amd = true;
|
||||||
|
|
||||||
|
if (typeof define !== 'undefined' && define.amd) {
|
||||||
|
Prototype._original_define = define;
|
||||||
|
Prototype._actual_sizzle = null;
|
||||||
|
window.define = fakeDefine;
|
||||||
|
}
|
||||||
|
})();
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* Sizzle CSS Selector Engine v@VERSION
|
* Sizzle CSS Selector Engine v1.10.18
|
||||||
* http://sizzlejs.com/
|
* http://sizzlejs.com/
|
||||||
*
|
*
|
||||||
* Copyright 2013 jQuery Foundation, Inc. and other contributors
|
* Copyright 2013 jQuery Foundation, Inc. and other contributors
|
||||||
* Released under the MIT license
|
* Released under the MIT license
|
||||||
* http://jquery.org/license
|
* http://jquery.org/license
|
||||||
*
|
*
|
||||||
* Date: @DATE
|
* Date: 2014-02-05
|
||||||
*/
|
*/
|
||||||
(function( window ) {
|
(function( window ) {
|
||||||
|
|
||||||
@@ -6229,6 +6273,22 @@ if ( typeof define === "function" && define.amd ) {
|
|||||||
|
|
||||||
})( window );
|
})( window );
|
||||||
|
|
||||||
|
;(function() {
|
||||||
|
if (typeof Sizzle !== 'undefined') {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (typeof define !== 'undefined' && define.amd) {
|
||||||
|
window.Sizzle = Prototype._actual_sizzle;
|
||||||
|
window.define = Prototype._original_define;
|
||||||
|
delete Prototype._actual_sizzle;
|
||||||
|
delete Prototype._original_define;
|
||||||
|
} else if (typeof module !== 'undefined' && module.exports) {
|
||||||
|
window.Sizzle = module.exports;
|
||||||
|
module.exports = {};
|
||||||
|
}
|
||||||
|
})();
|
||||||
|
|
||||||
;(function(engine) {
|
;(function(engine) {
|
||||||
var extendElements = Prototype.Selector.extendElements;
|
var extendElements = Prototype.Selector.extendElements;
|
||||||
|
|
||||||
@@ -6870,7 +6930,7 @@ Form.EventObserver = Class.create(Abstract.EventObserver, {
|
|||||||
|
|
||||||
Event._isCustomEvent = isCustomEvent;
|
Event._isCustomEvent = isCustomEvent;
|
||||||
|
|
||||||
function getRegistryForElement(element, uid) {
|
function getOrCreateRegistryFor(element, uid) {
|
||||||
var CACHE = GLOBAL.Event.cache;
|
var CACHE = GLOBAL.Event.cache;
|
||||||
if (Object.isUndefined(uid))
|
if (Object.isUndefined(uid))
|
||||||
uid = getUniqueElementID(element);
|
uid = getUniqueElementID(element);
|
||||||
@@ -6886,7 +6946,7 @@ Form.EventObserver = Class.create(Abstract.EventObserver, {
|
|||||||
|
|
||||||
|
|
||||||
function register(element, eventName, handler) {
|
function register(element, eventName, handler) {
|
||||||
var registry = getRegistryForElement(element);
|
var registry = getOrCreateRegistryFor(element);
|
||||||
if (!registry[eventName]) registry[eventName] = [];
|
if (!registry[eventName]) registry[eventName] = [];
|
||||||
var entries = registry[eventName];
|
var entries = registry[eventName];
|
||||||
|
|
||||||
@@ -6906,9 +6966,8 @@ Form.EventObserver = Class.create(Abstract.EventObserver, {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function unregister(element, eventName, handler) {
|
function unregister(element, eventName, handler) {
|
||||||
var registry = getRegistryForElement(element);
|
var registry = getOrCreateRegistryFor(element);
|
||||||
var entries = registry[eventName];
|
var entries = registry[eventName] || [];
|
||||||
if (!entries) return;
|
|
||||||
|
|
||||||
var i = entries.length, entry;
|
var i = entries.length, entry;
|
||||||
while (i--) {
|
while (i--) {
|
||||||
@@ -6918,10 +6977,16 @@ Form.EventObserver = Class.create(Abstract.EventObserver, {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!entry) return;
|
if (entry) {
|
||||||
|
var index = entries.indexOf(entry);
|
||||||
|
entries.splice(index, 1);
|
||||||
|
}
|
||||||
|
|
||||||
var index = entries.indexOf(entry);
|
if (entries.length === 0) {
|
||||||
entries.splice(index, 1);
|
delete registry[eventName];
|
||||||
|
if (Object.keys(registry).length === 1 && ('element' in registry))
|
||||||
|
destroyRegistryForElement(element);
|
||||||
|
}
|
||||||
|
|
||||||
return entry;
|
return entry;
|
||||||
}
|
}
|
||||||
@@ -7020,14 +7085,24 @@ Form.EventObserver = Class.create(Abstract.EventObserver, {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function stopObservingEventName(element, eventName) {
|
function stopObservingEventName(element, eventName) {
|
||||||
var registry = getRegistryForElement(element);
|
var registry = getOrCreateRegistryFor(element);
|
||||||
var entries = registry[eventName];
|
var entries = registry[eventName];
|
||||||
if (!entries) return;
|
if (entries) {
|
||||||
delete registry[eventName];
|
delete registry[eventName];
|
||||||
|
}
|
||||||
|
|
||||||
|
entries = entries || [];
|
||||||
|
|
||||||
var i = entries.length;
|
var i = entries.length;
|
||||||
while (i--)
|
while (i--)
|
||||||
removeEvent(element, eventName, entries[i].responder);
|
removeEvent(element, eventName, entries[i].responder);
|
||||||
|
|
||||||
|
for (var name in registry) {
|
||||||
|
if (name === 'element') continue;
|
||||||
|
return; // There is another registered event
|
||||||
|
}
|
||||||
|
|
||||||
|
destroyRegistryForElement(element);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -7194,7 +7269,8 @@ Form.EventObserver = Class.create(Abstract.EventObserver, {
|
|||||||
|
|
||||||
function createResponderForCustomEvent(uid, eventName, handler) {
|
function createResponderForCustomEvent(uid, eventName, handler) {
|
||||||
return function(event) {
|
return function(event) {
|
||||||
var element = Event.cache[uid].element;
|
var cache = Event.cache[uid];
|
||||||
|
var element = cache && cache.element;
|
||||||
|
|
||||||
if (Object.isUndefined(event.eventName))
|
if (Object.isUndefined(event.eventName))
|
||||||
return false;
|
return false;
|
||||||
@@ -7283,7 +7359,9 @@ Hash.toQueryString = Object.toQueryString;
|
|||||||
|
|
||||||
var Toggle = { display: Element.toggle };
|
var Toggle = { display: Element.toggle };
|
||||||
|
|
||||||
Element.Methods.childOf = Element.Methods.descendantOf;
|
Element.addMethods({
|
||||||
|
childOf: Element.Methods.descendantOf
|
||||||
|
});
|
||||||
|
|
||||||
var Insertion = {
|
var Insertion = {
|
||||||
Before: function(element, content) {
|
Before: function(element, content) {
|
||||||
@@ -1 +1 @@
|
|||||||
prototype-1.7.2.0.js
|
prototype-1.7.3.0.js
|
||||||
@@ -79,7 +79,7 @@
|
|||||||
<!-- TOP MENU END //-->
|
<!-- TOP MENU END //-->
|
||||||
<tr>
|
<tr>
|
||||||
<td width="{$table_width}" class="edit_bgcolor">
|
<td width="{$table_width}" class="edit_bgcolor">
|
||||||
<form method="post" name="edit_form">
|
<form method="post" name="edit_form" style="margin-block-end: 0em;">
|
||||||
<table width="100%" border="0" cellpadding="2" cellspacing="1">
|
<table width="100%" border="0" cellpadding="2" cellspacing="1">
|
||||||
<!-- LOAD START //-->
|
<!-- LOAD START //-->
|
||||||
{include file="edit_load.tpl"}
|
{include file="edit_load.tpl"}
|
||||||
|
|||||||
5
www/layout/admin/default/templates/smarty_test.tpl
Normal file → Executable file
5
www/layout/admin/default/templates/smarty_test.tpl
Normal file → Executable file
@@ -1,3 +1,8 @@
|
|||||||
<div>
|
<div>
|
||||||
{$SMARTY_TEST}
|
{$SMARTY_TEST}
|
||||||
</div>
|
</div>
|
||||||
|
<div>
|
||||||
|
<select id="drop_down_test" name="drop_down_test">
|
||||||
|
{html_options options=$drop_down_test selected=$drop_down_test_selected}
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
|||||||
0
www/layout/admin/index.php
Normal file
0
www/layout/admin/index.php
Normal file
0
www/layout/frontend/default/cache/index.php
vendored
Normal file
0
www/layout/frontend/default/cache/index.php
vendored
Normal file
0
www/layout/frontend/default/css/index.php
Normal file
0
www/layout/frontend/default/css/index.php
Normal file
0
www/layout/frontend/default/images/index.php
Normal file
0
www/layout/frontend/default/images/index.php
Normal file
0
www/layout/frontend/default/index.php
Normal file
0
www/layout/frontend/default/index.php
Normal file
0
www/layout/frontend/default/javascript/index.php
Normal file
0
www/layout/frontend/default/javascript/index.php
Normal file
0
www/layout/frontend/index.php
Normal file
0
www/layout/frontend/index.php
Normal file
@@ -72,6 +72,11 @@ class Login extends \CoreLibs\DB\IO
|
|||||||
private $password_change_ok = false; // password change was successful
|
private $password_change_ok = false; // password change was successful
|
||||||
private $password_forgot = false; // can we reset password and mail to user with new password set screen
|
private $password_forgot = false; // can we reset password and mail to user with new password set screen
|
||||||
private $password_forgot_ok = false; // password forgot mail send ok
|
private $password_forgot_ok = false; // password forgot mail send ok
|
||||||
|
private $change_password;
|
||||||
|
private $pw_username;
|
||||||
|
private $pw_old_password;
|
||||||
|
private $pw_new_password;
|
||||||
|
private $pw_new_password_confirm;
|
||||||
private $pw_change_deny_users = array (); // array of users for which the password change is forbidden
|
private $pw_change_deny_users = array (); // array of users for which the password change is forbidden
|
||||||
|
|
||||||
// if we have password change we need to define some rules
|
// if we have password change we need to define some rules
|
||||||
@@ -179,12 +184,12 @@ class Login extends \CoreLibs\DB\IO
|
|||||||
$_POST['pw_new_password_confirm'] = '';
|
$_POST['pw_new_password_confirm'] = '';
|
||||||
}
|
}
|
||||||
// pass on vars to Object vars
|
// pass on vars to Object vars
|
||||||
$this->login = $_POST["login_login"];
|
$this->login = $_POST['login_login'];
|
||||||
$this->username = $_POST["login_username"];
|
$this->username = $_POST['login_username'];
|
||||||
$this->password = $_POST["login_password"];
|
$this->password = $_POST['login_password'];
|
||||||
$this->logout = $_POST["login_logout"];
|
$this->logout = $_POST['login_logout'];
|
||||||
// password change vars
|
// password change vars
|
||||||
$this->change_password = $_POST["change_password"];
|
$this->change_password = $_POST['change_password'];
|
||||||
$this->pw_username = $_POST['pw_username'];
|
$this->pw_username = $_POST['pw_username'];
|
||||||
$this->pw_old_password = $_POST['pw_old_password'];
|
$this->pw_old_password = $_POST['pw_old_password'];
|
||||||
$this->pw_new_password = $_POST['pw_new_password'];
|
$this->pw_new_password = $_POST['pw_new_password'];
|
||||||
@@ -845,63 +850,77 @@ class Login extends \CoreLibs\DB\IO
|
|||||||
private function loginPrintLogin()
|
private function loginPrintLogin()
|
||||||
{
|
{
|
||||||
if (!$this->permission_okay) {
|
if (!$this->permission_okay) {
|
||||||
// set the templates now
|
// get global AJAX page trigger
|
||||||
$this->loginSetTemplates();
|
// if true, return error ajax
|
||||||
// if there is a global logout target ...
|
global $AJAX_PAGE;
|
||||||
if (file_exists($this->logout_target) && $this->logout_target) {
|
if ($AJAX_PAGE === true) {
|
||||||
$LOGOUT_TARGET = $this->logout_target;
|
$data = array (
|
||||||
|
'status' => 'error',
|
||||||
|
'error_code' => $this->loging_error,
|
||||||
|
'msg' => array (
|
||||||
|
'level' => 'error',
|
||||||
|
'str' => $this->l->__('Login necessary')
|
||||||
|
)
|
||||||
|
);
|
||||||
|
$html_string = json_encode($data);
|
||||||
} else {
|
} else {
|
||||||
$LOGOUT_TARGET = "";
|
// set the templates now
|
||||||
}
|
$this->loginSetTemplates();
|
||||||
|
// if there is a global logout target ...
|
||||||
$html_string = $this->login_template['template'];
|
if (file_exists($this->logout_target) && $this->logout_target) {
|
||||||
|
$LOGOUT_TARGET = $this->logout_target;
|
||||||
// if password change is okay
|
} else {
|
||||||
if ($this->password_change) {
|
$LOGOUT_TARGET = "";
|
||||||
$html_string_password_change = $this->login_template['password_change'];
|
|
||||||
|
|
||||||
// pre change the data in the PASSWORD_CHANGE_DIV first
|
|
||||||
foreach ($this->login_template['strings'] as $string => $data) {
|
|
||||||
if ($data) {
|
|
||||||
$html_string_password_change = str_replace('{'.$string.'}', $data, $html_string_password_change);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$html_string = $this->login_template['template'];
|
||||||
|
|
||||||
|
// if password change is okay
|
||||||
|
if ($this->password_change) {
|
||||||
|
$html_string_password_change = $this->login_template['password_change'];
|
||||||
|
|
||||||
|
// pre change the data in the PASSWORD_CHANGE_DIV first
|
||||||
|
foreach ($this->login_template['strings'] as $string => $data) {
|
||||||
|
if ($data) {
|
||||||
|
$html_string_password_change = str_replace('{'.$string.'}', $data, $html_string_password_change);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// print error messagae
|
||||||
|
if ($this->login_error) {
|
||||||
|
$html_string_password_change = str_replace('{ERROR_MSG}', $this->login_error_msg[$this->login_error].'<br>', $html_string_password_change);
|
||||||
|
} else {
|
||||||
|
$html_string_password_change = str_replace('{ERROR_MSG}', '<br>', $html_string_password_change);
|
||||||
|
}
|
||||||
|
// if pw change action, show the float again
|
||||||
|
if ($this->change_password && !$this->password_change_ok) {
|
||||||
|
$html_string_password_change = str_replace('{PASSWORD_CHANGE_SHOW}', '<script language="JavaScript">ShowHideDiv(\'pw_change_div\');</script>', $html_string_password_change);
|
||||||
|
} else {
|
||||||
|
$html_string_password_change = str_replace('{PASSWORD_CHANGE_SHOW}', '', $html_string_password_change);
|
||||||
|
}
|
||||||
|
$this->login_template['strings']['PASSWORD_CHANGE_DIV'] = $html_string_password_change;
|
||||||
|
}
|
||||||
|
|
||||||
|
// put in the logout redirect string
|
||||||
|
if ($this->logout && $LOGOUT_TARGET) {
|
||||||
|
$html_string = str_replace('{LOGOUT_TARGET}', '<meta http-equiv="refresh" content="0; URL='.$LOGOUT_TARGET.'">', $html_string);
|
||||||
|
} else {
|
||||||
|
$html_string = str_replace('{LOGOUT_TARGET}', '', $html_string);
|
||||||
|
}
|
||||||
|
|
||||||
// print error messagae
|
// print error messagae
|
||||||
if ($this->login_error) {
|
if ($this->login_error) {
|
||||||
$html_string_password_change = str_replace('{ERROR_MSG}', $this->login_error_msg[$this->login_error].'<br>', $html_string_password_change);
|
$html_string = str_replace('{ERROR_MSG}', $this->login_error_msg[$this->login_error].'<br>', $html_string);
|
||||||
|
} elseif ($this->password_change_ok && $this->password_change) {
|
||||||
|
$html_string = str_replace('{ERROR_MSG}', $this->login_error_msg[300].'<br>', $html_string);
|
||||||
} else {
|
} else {
|
||||||
$html_string_password_change = str_replace('{ERROR_MSG}', '<br>', $html_string_password_change);
|
$html_string = str_replace('{ERROR_MSG}', '<br>', $html_string);
|
||||||
}
|
}
|
||||||
// if pw change action, show the float again
|
|
||||||
if ($this->change_password && !$this->password_change_ok) {
|
// create the replace array context
|
||||||
$html_string_password_change = str_replace('{PASSWORD_CHANGE_SHOW}', '<script language="JavaScript">ShowHideDiv(\'pw_change_div\');</script>', $html_string_password_change);
|
foreach ($this->login_template['strings'] as $string => $data) {
|
||||||
} else {
|
$html_string = str_replace('{'.$string.'}', $data, $html_string);
|
||||||
$html_string_password_change = str_replace('{PASSWORD_CHANGE_SHOW}', '', $html_string_password_change);
|
|
||||||
}
|
}
|
||||||
$this->login_template['strings']['PASSWORD_CHANGE_DIV'] = $html_string_password_change;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// put in the logout redirect string
|
|
||||||
if ($this->logout && $LOGOUT_TARGET) {
|
|
||||||
$html_string = str_replace('{LOGOUT_TARGET}', '<meta http-equiv="refresh" content="0; URL='.$LOGOUT_TARGET.'">', $html_string);
|
|
||||||
} else {
|
|
||||||
$html_string = str_replace('{LOGOUT_TARGET}', '', $html_string);
|
|
||||||
}
|
|
||||||
|
|
||||||
// print error messagae
|
|
||||||
if ($this->login_error) {
|
|
||||||
$html_string = str_replace('{ERROR_MSG}', $this->login_error_msg[$this->login_error].'<br>', $html_string);
|
|
||||||
} elseif ($this->password_change_ok && $this->password_change) {
|
|
||||||
$html_string = str_replace('{ERROR_MSG}', $this->login_error_msg[300].'<br>', $html_string);
|
|
||||||
} else {
|
|
||||||
$html_string = str_replace('{ERROR_MSG}', '<br>', $html_string);
|
|
||||||
}
|
|
||||||
|
|
||||||
// create the replace array context
|
|
||||||
foreach ($this->login_template['strings'] as $string => $data) {
|
|
||||||
$html_string = str_replace('{'.$string.'}', $data, $html_string);
|
|
||||||
}
|
|
||||||
|
|
||||||
// return the created HTML here
|
// return the created HTML here
|
||||||
return $html_string;
|
return $html_string;
|
||||||
} // if permission is 0 then print out login
|
} // if permission is 0 then print out login
|
||||||
@@ -1173,4 +1192,4 @@ EOM;
|
|||||||
}
|
}
|
||||||
} // close class
|
} // close class
|
||||||
|
|
||||||
# __END__
|
// __END__
|
||||||
|
|||||||
@@ -359,4 +359,4 @@ class Backend extends \CoreLibs\DB\IO
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# __END__
|
// __END__
|
||||||
|
|||||||
@@ -202,7 +202,14 @@ class Basic
|
|||||||
$this->page_name = $this->getPageName();
|
$this->page_name = $this->getPageName();
|
||||||
$this->host_name = $this->getHostName();
|
$this->host_name = $this->getHostName();
|
||||||
// init the log file id
|
// init the log file id
|
||||||
$this->log_file_id = defined('LOG_FILE_ID') ? LOG_FILE_ID : '';
|
// * GLOBALS
|
||||||
|
// * CONSTANT
|
||||||
|
// can be overridden with basicSetLogFileId
|
||||||
|
if (isset($GLOBALS['LOG_FILE_ID'])) {
|
||||||
|
$this->basicSetLogId($GLOBALS['LOG_FILE_ID']);
|
||||||
|
} elseif (defined('LOG_FILE_ID')) {
|
||||||
|
$this->basicSetLogId(LOG_FILE_ID);
|
||||||
|
}
|
||||||
|
|
||||||
// set the paths matching to the valid file types
|
// set the paths matching to the valid file types
|
||||||
$this->data_path = array (
|
$this->data_path = array (
|
||||||
@@ -300,8 +307,8 @@ class Basic
|
|||||||
'.*@bandai\.jp$' => 'keitai_willcom_bandai', # willcom paipo! (kids)
|
'.*@bandai\.jp$' => 'keitai_willcom_bandai', # willcom paipo! (kids)
|
||||||
'.*@pipopa\.ne\.jp$' => 'keitai_willcom_pipopa', # willcom paipo! (kids)
|
'.*@pipopa\.ne\.jp$' => 'keitai_willcom_pipopa', # willcom paipo! (kids)
|
||||||
'.*@([a-z0-9]{2,4}\.)?pdx\.ne\.jp$' => 'keitai_willcom_pdx', # actually only di,dj,dk,wm -> all others are "wrong", but none also allowed?
|
'.*@([a-z0-9]{2,4}\.)?pdx\.ne\.jp$' => 'keitai_willcom_pdx', # actually only di,dj,dk,wm -> all others are "wrong", but none also allowed?
|
||||||
'.*@ymobile([1]{1})?\.ne\.jp$' => 'keitai_willcom_ymobile', # ymobile, ymobile1 techincally not willcom, but I group them there
|
'.*@ymobile([1]{1})?\.ne\.jp$' => 'keitai_willcom_ymobile', # ymobile, ymobile1 techincally not willcom, but I group them there (softbank sub)
|
||||||
'.*@y-mobile\.ne\.jp$' => 'keitai_willcom_ymobile', # y-mobile techincally not willcom, but I group them there
|
'.*@y-mobile\.ne\.jp$' => 'keitai_willcom_ymobile', # y-mobile techincally not willcom, but I group them there (softbank sub)
|
||||||
'.*@emnet\.ne\.jp$' => 'keitai_willcom_emnet', # e-mobile, group will willcom
|
'.*@emnet\.ne\.jp$' => 'keitai_willcom_emnet', # e-mobile, group will willcom
|
||||||
'.*@emobile\.ne\.jp$' => 'keitai_willcom_emnet', # e-mobile, group will willcom
|
'.*@emobile\.ne\.jp$' => 'keitai_willcom_emnet', # e-mobile, group will willcom
|
||||||
'.*@emobile-s\.ne\.jp$' => 'keitai_willcom_emnet' # e-mobile, group will willcom
|
'.*@emobile-s\.ne\.jp$' => 'keitai_willcom_emnet' # e-mobile, group will willcom
|
||||||
@@ -388,6 +395,22 @@ class Basic
|
|||||||
// GENERAL METHODS
|
// GENERAL METHODS
|
||||||
// *************************************************************
|
// *************************************************************
|
||||||
|
|
||||||
|
// METHOD: basicSetLogId
|
||||||
|
// PARAMS: string
|
||||||
|
// RETURN: current set string
|
||||||
|
// DESC : sets the log file prefix id
|
||||||
|
// must be alphanumeric only (\w)
|
||||||
|
public function basicSetLogId($string)
|
||||||
|
{
|
||||||
|
if (!isset($log_file_id)) {
|
||||||
|
$log_file_id = '';
|
||||||
|
}
|
||||||
|
if (isset($string) && preg_match("/^\w+$/", $string)) {
|
||||||
|
$this->log_file_id = $string;
|
||||||
|
}
|
||||||
|
return $log_file_id;
|
||||||
|
}
|
||||||
|
|
||||||
// METHOD: db_io_info
|
// METHOD: db_io_info
|
||||||
// PARAMS: show, default 1, if set to 0 won't write to error_msg var
|
// PARAMS: show, default 1, if set to 0 won't write to error_msg var
|
||||||
// RETURN: string with info
|
// RETURN: string with info
|
||||||
@@ -396,6 +419,7 @@ class Basic
|
|||||||
{
|
{
|
||||||
unset($string);
|
unset($string);
|
||||||
list($major, $minor, $patchlvl) = explode(".", $this->class_info[$class_name]["class_version"]);
|
list($major, $minor, $patchlvl) = explode(".", $this->class_info[$class_name]["class_version"]);
|
||||||
|
$string = '';
|
||||||
$string .= "<b>-Class-info-[".$class_name."]-></b> Class Name: <b>".$this->class_info[$class_name]["class_name"]."</b><br>";
|
$string .= "<b>-Class-info-[".$class_name."]-></b> Class Name: <b>".$this->class_info[$class_name]["class_name"]."</b><br>";
|
||||||
$string .= "<b>-Class-info-[".$class_name."]-></b> Class Author: <b>".$this->class_info[$class_name]["class_author"]."</b><br>";
|
$string .= "<b>-Class-info-[".$class_name."]-></b> Class Author: <b>".$this->class_info[$class_name]["class_author"]."</b><br>";
|
||||||
$string .= "<b>-Class-info-[".$class_name."]-></b> Class Version: <b>".$this->class_info[$class_name]["class_version"]."</b><br>";
|
$string .= "<b>-Class-info-[".$class_name."]-></b> Class Version: <b>".$this->class_info[$class_name]["class_version"]."</b><br>";
|
||||||
@@ -461,7 +485,8 @@ class Basic
|
|||||||
if ($set_microtime == -1) {
|
if ($set_microtime == -1) {
|
||||||
$string .= substr($microtime, 1);
|
$string .= substr($microtime, 1);
|
||||||
} elseif ($set_microtime >= 1) {
|
} elseif ($set_microtime >= 1) {
|
||||||
$string .= substr(round($microtime, $set_microtime), 1);
|
// in round case we run this through number format to always get the same amount of digits
|
||||||
|
$string .= substr(number_format(round($microtime, $set_microtime), $set_microtime), 1);
|
||||||
}
|
}
|
||||||
return $string;
|
return $string;
|
||||||
}
|
}
|
||||||
@@ -1133,7 +1158,7 @@ class Basic
|
|||||||
// does NOT preserve keys
|
// does NOT preserve keys
|
||||||
public static function flattenArray(array $array)
|
public static function flattenArray(array $array)
|
||||||
{
|
{
|
||||||
$return = array();
|
$return = array ();
|
||||||
array_walk_recursive(
|
array_walk_recursive(
|
||||||
$array,
|
$array,
|
||||||
function ($a) use (&$return) {
|
function ($a) use (&$return) {
|
||||||
@@ -1143,6 +1168,22 @@ class Basic
|
|||||||
return $return;
|
return $return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// METHOD: flattenArrayKey
|
||||||
|
// PARAMS: the array to flatten
|
||||||
|
// RETURN: flattened array with array keys as values in order of tree
|
||||||
|
// DESC : note: the second parameter $return is automatically set
|
||||||
|
// will loop through an array recursivly and write the array keys back
|
||||||
|
public static function flattenArrayKey(array $array, array $return = array ())
|
||||||
|
{
|
||||||
|
foreach ($array as $key => $sub) {
|
||||||
|
$return[] = $key;
|
||||||
|
if (count($sub) > 0) {
|
||||||
|
$return = Basic::flattenArrayKey($sub, $return);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $return;
|
||||||
|
}
|
||||||
|
|
||||||
// METHOD: __mbMimeEncode
|
// METHOD: __mbMimeEncode
|
||||||
// WAS : _mb_mime_encode
|
// WAS : _mb_mime_encode
|
||||||
// PARAMS: string to encode, encoding to encode in
|
// PARAMS: string to encode, encoding to encode in
|
||||||
@@ -1156,6 +1197,7 @@ class Basic
|
|||||||
$pos = 0;
|
$pos = 0;
|
||||||
$split = 36; // after 36 single bytes characters, if then comes MB, it is broken
|
$split = 36; // after 36 single bytes characters, if then comes MB, it is broken
|
||||||
// has to 2 x 36 < 74 so the mb_encode_mimeheader 74 hardcoded split does not get triggered
|
// has to 2 x 36 < 74 so the mb_encode_mimeheader 74 hardcoded split does not get triggered
|
||||||
|
$_string = '';
|
||||||
while ($pos < mb_strlen($string, $encoding)) {
|
while ($pos < mb_strlen($string, $encoding)) {
|
||||||
$output = mb_strimwidth($string, $pos, $split, "", $encoding);
|
$output = mb_strimwidth($string, $pos, $split, "", $encoding);
|
||||||
$pos += mb_strlen($output, $encoding);
|
$pos += mb_strlen($output, $encoding);
|
||||||
@@ -1199,7 +1241,7 @@ class Basic
|
|||||||
// DESC : calculates the bytes based on a string with nnG, nnM, etc
|
// DESC : calculates the bytes based on a string with nnG, nnM, etc
|
||||||
public static function stringByteFormat($number)
|
public static function stringByteFormat($number)
|
||||||
{
|
{
|
||||||
$number = trim($number);
|
$number = (int)trim($number);
|
||||||
$last = strtolower($number[strlen($number) - 1]);
|
$last = strtolower($number[strlen($number) - 1]);
|
||||||
switch ($last) {
|
switch ($last) {
|
||||||
case 't':
|
case 't':
|
||||||
@@ -1388,7 +1430,7 @@ class Basic
|
|||||||
public static function compareDateTime($start_datetime, $end_datetime)
|
public static function compareDateTime($start_datetime, $end_datetime)
|
||||||
{
|
{
|
||||||
// pre check for empty or wrong
|
// pre check for empty or wrong
|
||||||
if ($start_date == '--' || $end_date == '--' || !$start_date || !$end_date) {
|
if ($start_datetime == '--' || $end_datetime == '--' || !$start_datetime || !$end_datetime) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
$start_timestamp = strtotime($start_datetime);
|
$start_timestamp = strtotime($start_datetime);
|
||||||
@@ -1746,6 +1788,7 @@ class Basic
|
|||||||
}
|
}
|
||||||
// max should be 63 for this case
|
// max should be 63 for this case
|
||||||
$max_rand = count($chars) - 1;
|
$max_rand = count($chars) - 1;
|
||||||
|
$salt_string = '';
|
||||||
// create the salt part
|
// create the salt part
|
||||||
for ($i = 1; $i <= $nSize; $i ++) {
|
for ($i = 1; $i <= $nSize; $i ++) {
|
||||||
$salt_string .= $chars[mt_rand(0, $max_rand)];
|
$salt_string .= $chars[mt_rand(0, $max_rand)];
|
||||||
@@ -2220,7 +2263,52 @@ class Basic
|
|||||||
// DESC : full wrapper for html entities
|
// DESC : full wrapper for html entities
|
||||||
public function htmlent($string)
|
public function htmlent($string)
|
||||||
{
|
{
|
||||||
return htmlentities($string, ENT_COMPAT|ENT_HTML401, 'UTF-8', false);
|
if (is_string($string)) {
|
||||||
|
return htmlentities($string, ENT_COMPAT|ENT_HTML401, 'UTF-8', false);
|
||||||
|
} else {
|
||||||
|
return $string;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// METHOD: removeLB
|
||||||
|
// PARAMS: string, optional replace character
|
||||||
|
// RETURN: string with line breaks removed
|
||||||
|
// DESC : strips out all line breaks or replaced with given string
|
||||||
|
public function removeLB($string, $replace = ' ')
|
||||||
|
{
|
||||||
|
return str_replace(array("\r", "\n"), $replace, $string);
|
||||||
|
}
|
||||||
|
|
||||||
|
// METHOD: fceil
|
||||||
|
// PARAMS: number, round decimals (default 10)
|
||||||
|
// RETURN: correct ceil number
|
||||||
|
// DESC : some float numbers will be rounded up even if they have no decimal entries
|
||||||
|
public function fceil($number, $precision = 10)
|
||||||
|
{
|
||||||
|
return ceil(round($number, $precision));
|
||||||
|
}
|
||||||
|
|
||||||
|
// METHOD floorp
|
||||||
|
// PARAMS: number, round to
|
||||||
|
// RETURN: floor number but with tround to
|
||||||
|
// DESC : eg 48767 with -2 -> 48700
|
||||||
|
public function floorp($number, $precision = -2)
|
||||||
|
{
|
||||||
|
$mult = pow(10, $precision); // Can be cached in lookup table
|
||||||
|
return floor($number * $mult) / $mult;
|
||||||
|
}
|
||||||
|
|
||||||
|
// METHOD: initNumeric
|
||||||
|
// PARAMS: any value
|
||||||
|
// RETURN: if not numeric, sets to 0, else returns value already set
|
||||||
|
// DESC : inits input to 0, if value is not numeric
|
||||||
|
public function initNumeric($number)
|
||||||
|
{
|
||||||
|
if (!is_numeric($number)) {
|
||||||
|
return 0;
|
||||||
|
} else {
|
||||||
|
return $number;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// METHOD: setFormToken
|
// METHOD: setFormToken
|
||||||
@@ -2405,4 +2493,4 @@ class Basic
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# __END__
|
// __END__
|
||||||
|
|||||||
@@ -133,6 +133,7 @@ class ArrayIO extends \CoreLibs\DB\IO
|
|||||||
public function dbDumpArray($write = 0)
|
public function dbDumpArray($write = 0)
|
||||||
{
|
{
|
||||||
reset($this->table_array);
|
reset($this->table_array);
|
||||||
|
$string = '';
|
||||||
foreach ($this->table_array as $column => $data_array) {
|
foreach ($this->table_array as $column => $data_array) {
|
||||||
$string .= "<b>".$column."</b> -> ".$data_array["value"]."<br>";
|
$string .= "<b>".$column."</b> -> ".$data_array["value"]."<br>";
|
||||||
}
|
}
|
||||||
@@ -200,20 +201,21 @@ class ArrayIO extends \CoreLibs\DB\IO
|
|||||||
$q .= $this->pk_name." = ".$this->table_array[$this->pk_name]["value"]." ";
|
$q .= $this->pk_name." = ".$this->table_array[$this->pk_name]["value"]." ";
|
||||||
// delete files and build FK query
|
// delete files and build FK query
|
||||||
reset($this->table_array);
|
reset($this->table_array);
|
||||||
|
$q_where = '';
|
||||||
foreach ($this->table_array as $column => $data_array) {
|
foreach ($this->table_array as $column => $data_array) {
|
||||||
// suchen nach bildern und lschen ...
|
// suchen nach bildern und lschen ...
|
||||||
if ($this->table_array[$column]["file"] && file_exists($this->table_array[$column]["url"].$this->table_array[$column]["value"])) {
|
if ($this->table_array[$column]["file"] && file_exists($this->table_array[$column]["url"].$this->table_array[$column]["value"])) {
|
||||||
if (file_exists($this->table_array[$column]["path"].$this->table_array[$column]["value"])) {
|
if (file_exists($this->table_array[$column]["path"].$this->table_array[$column]["value"])) {
|
||||||
unlink($this->table_array[$column]["path"].$this->table_array[$column]["value"]);
|
unlink($this->table_array[$column]["path"].$this->table_array[$column]["value"]);
|
||||||
}
|
}
|
||||||
$dateiname = str_replace("_tn", "", $this->table_array[$column]["value"]);
|
$file_name = str_replace("_tn", "", $this->table_array[$column]["value"]);
|
||||||
if (file_exists($this->table_array[$column]["path"].$dateiname)) {
|
if (file_exists($this->table_array[$column]["path"].$file_name)) {
|
||||||
unlink($this->table_array[$column]["path"].$dateiname);
|
unlink($this->table_array[$column]["path"].$file_name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// if we have a foreign key
|
||||||
if ($this->table_array[$column]["fk"]) {
|
if ($this->table_array[$column]["fk"]) {
|
||||||
// zusammenstellen der FKs
|
// create FK constraint checks
|
||||||
if ($q_where) {
|
if ($q_where) {
|
||||||
$q_where .= " AND ";
|
$q_where .= " AND ";
|
||||||
}
|
}
|
||||||
@@ -251,6 +253,8 @@ class ArrayIO extends \CoreLibs\DB\IO
|
|||||||
return $this->table_array;
|
return $this->table_array;
|
||||||
}
|
}
|
||||||
reset($this->table_array);
|
reset($this->table_array);
|
||||||
|
$q_select = '';
|
||||||
|
$q_where = '';
|
||||||
// create select part & addition FK part
|
// create select part & addition FK part
|
||||||
foreach ($this->table_array as $column => $data_array) {
|
foreach ($this->table_array as $column => $data_array) {
|
||||||
if ($q_select) {
|
if ($q_select) {
|
||||||
@@ -326,6 +330,9 @@ class ArrayIO extends \CoreLibs\DB\IO
|
|||||||
}
|
}
|
||||||
|
|
||||||
reset($this->table_array);
|
reset($this->table_array);
|
||||||
|
$q_data = '';
|
||||||
|
$q_vars = '';
|
||||||
|
$q_where = '';
|
||||||
foreach ($this->table_array as $column => $data_array) {
|
foreach ($this->table_array as $column => $data_array) {
|
||||||
/********************************* START FILE *************************************/
|
/********************************* START FILE *************************************/
|
||||||
// file upload
|
// file upload
|
||||||
@@ -338,9 +345,9 @@ class ArrayIO extends \CoreLibs\DB\IO
|
|||||||
if (file_exists($this->table_array[$column]["path"].$this->table_array[$column]["value"])) {
|
if (file_exists($this->table_array[$column]["path"].$this->table_array[$column]["value"])) {
|
||||||
unlink($this->table_array[$column]["path"].$this->table_array[$column]["value"]);
|
unlink($this->table_array[$column]["path"].$this->table_array[$column]["value"]);
|
||||||
}
|
}
|
||||||
$dateiname = str_replace("_tn", "", $this->table_array[$column]["value"]);
|
$file_name = str_replace("_tn", "", $this->table_array[$column]["value"]);
|
||||||
if (file_exists($this->table_array[$column]["path"].$dateiname)) {
|
if (file_exists($this->table_array[$column]["path"].$file_name)) {
|
||||||
unlink($this->table_array[$column]["path"].$dateiname);
|
unlink($this->table_array[$column]["path"].$file_name);
|
||||||
}
|
}
|
||||||
$this->table_array[$column]["value"] = "";
|
$this->table_array[$column]["value"] = "";
|
||||||
} else {
|
} else {
|
||||||
@@ -355,20 +362,19 @@ class ArrayIO extends \CoreLibs\DB\IO
|
|||||||
$ext = end($filename_parts);
|
$ext = end($filename_parts);
|
||||||
array_splice($filename_parts, -1, 1);
|
array_splice($filename_parts, -1, 1);
|
||||||
$name = str_replace(" ", "_", implode(".", $filename_parts));
|
$name = str_replace(" ", "_", implode(".", $filename_parts));
|
||||||
//echo "PK: $pk_ids_file<br>";
|
$file_name = $name.".".$ext;
|
||||||
$dateiname = $name.$pk_ids_file.".".$ext;
|
//echo "Dn: $file_name";
|
||||||
//echo "Dn: $dateiname";
|
copy($this->table_array[$column]["tmp"], $this->table_array[$column]["path"].$file_name);
|
||||||
copy($this->table_array[$column]["tmp"], $this->table_array[$column]["path"].$dateiname);
|
|
||||||
// automatisch thumbnail generieren, geht nur mit convert (ImageMagic!!!), aber nur bei bild ..
|
// automatisch thumbnail generieren, geht nur mit convert (ImageMagic!!!), aber nur bei bild ..
|
||||||
if (strtolower($ext) == "jpeg" || strtolower($ext) == "jpg" || strtolower($ext) == "gif" || strtolower($ext) == "png") {
|
if (strtolower($ext) == "jpeg" || strtolower($ext) == "jpg" || strtolower($ext) == "gif" || strtolower($ext) == "png") {
|
||||||
$dateiname_tn = $name.$pk_ids_file."_tn.".$ext;
|
$file_name_tn = $name."_tn.".$ext;
|
||||||
$eingang = $this->table_array[$column]["path"].$dateiname;
|
$eingang = $this->table_array[$column]["path"].$file_name;
|
||||||
$ausgang = $this->table_array[$column]["path"].$dateiname_tn;
|
$ausgang = $this->table_array[$column]["path"].$file_name_tn;
|
||||||
$com = "convert -geometry 115 $eingang $ausgang";
|
$com = "convert -geometry 115 $eingang $ausgang";
|
||||||
exec($com);
|
exec($com);
|
||||||
$this->table_array[$column]["value"] = $dateiname_tn;
|
$this->table_array[$column]["value"] = $file_name_tn;
|
||||||
} else {
|
} else {
|
||||||
$this->table_array[$column]["value"] = $dateiname;
|
$this->table_array[$column]["value"] = $file_name;
|
||||||
}
|
}
|
||||||
} elseif (file_exists($this->table_array[$column]["path"].$this->table_array[$column]["value"])) {
|
} elseif (file_exists($this->table_array[$column]["path"].$this->table_array[$column]["value"])) {
|
||||||
// mach gar nix, wenn bild schon da ???
|
// mach gar nix, wenn bild schon da ???
|
||||||
@@ -409,6 +415,9 @@ class ArrayIO extends \CoreLibs\DB\IO
|
|||||||
$_value = $this->table_array[$column]["value"];
|
$_value = $this->table_array[$column]["value"];
|
||||||
}
|
}
|
||||||
$q_data .= $_value;
|
$q_data .= $_value;
|
||||||
|
} elseif ($this->table_array[$column]['bool']) {
|
||||||
|
// boolean storeage (reverse check on ifset)
|
||||||
|
$q_data .= "'".$this->dbBoolean($this->table_array[$column]["value"], true)."'";
|
||||||
} elseif ($this->table_array[$column]["interval"]) {
|
} elseif ($this->table_array[$column]["interval"]) {
|
||||||
// for interval we check if no value, then we set null
|
// for interval we check if no value, then we set null
|
||||||
if (!$this->table_array[$column]["value"]) {
|
if (!$this->table_array[$column]["value"]) {
|
||||||
@@ -543,4 +552,4 @@ class ArrayIO extends \CoreLibs\DB\IO
|
|||||||
}
|
}
|
||||||
} // end of class
|
} // end of class
|
||||||
|
|
||||||
# __END__
|
// __END__
|
||||||
|
|||||||
@@ -124,7 +124,7 @@
|
|||||||
* - closes db connection and writes error_msg to global error_msg
|
* - closes db connection and writes error_msg to global error_msg
|
||||||
* db_cursor_pos($query)
|
* db_cursor_pos($query)
|
||||||
* - returns the current position the db_return
|
* - returns the current position the db_return
|
||||||
* $array_of_hashes db_show_table_meta_Data($table_name)
|
* $array_of_hashes db_show_table_meta_data($table_name)
|
||||||
* - returns an hashed array of table column data
|
* - returns an hashed array of table column data
|
||||||
* function db_prepare($stm_name, $query)
|
* function db_prepare($stm_name, $query)
|
||||||
* - prepares a query with the given stm name, returns false on error
|
* - prepares a query with the given stm name, returns false on error
|
||||||
@@ -317,11 +317,11 @@ class IO extends \CoreLibs\Basic
|
|||||||
$this->db_user = $db_config['db_user'] ?? '';
|
$this->db_user = $db_config['db_user'] ?? '';
|
||||||
$this->db_pwd = $db_config['db_pass'] ?? '';
|
$this->db_pwd = $db_config['db_pass'] ?? '';
|
||||||
$this->db_host = $db_config['db_host'] ?? '';
|
$this->db_host = $db_config['db_host'] ?? '';
|
||||||
$this->db_port = array_key_exists('db_port', $db_config) ? $db_config['db_port'] : '5432';
|
$this->db_port = !empty($db_config['db_port']) ? $db_config['db_port'] : '5432';
|
||||||
$this->db_schema = array_key_exists('db_schema', $db_config) ? $db_config['db_schema'] : ''; // do not set to 'public' if not set, because the default is already public
|
$this->db_schema = !empty($db_config['db_schema']) ? $db_config['db_schema'] : ''; // do not set to 'public' if not set, because the default is already public
|
||||||
$this->db_encoding = array_key_exists('db_encoding', $db_config) ? $db_config['db_encoding'] : '';
|
$this->db_encoding = !empty($db_config['db_encoding']) ? $db_config['db_encoding'] : '';
|
||||||
$this->db_type = $db_config['db_type'] ?? '';
|
$this->db_type = $db_config['db_type'] ?? '';
|
||||||
$this->db_ssl = array_key_exists('db_ssl', $db_config) ? $db_config['db_ssl'] : 'allow';
|
$this->db_ssl = !empty($db_config['db_ssl']) ? $db_config['db_ssl'] : 'allow';
|
||||||
|
|
||||||
// set the target encoding to the DEFAULT_ENCODING if it is one of them: EUC, Shift_JIS, UTF-8
|
// set the target encoding to the DEFAULT_ENCODING if it is one of them: EUC, Shift_JIS, UTF-8
|
||||||
// @ the moment set only from outside
|
// @ the moment set only from outside
|
||||||
@@ -461,15 +461,15 @@ class IO extends \CoreLibs\Basic
|
|||||||
// WAS : _check_query_for_select
|
// WAS : _check_query_for_select
|
||||||
// PARAMS: query
|
// PARAMS: query
|
||||||
// RETURN: true if matching, false if not
|
// RETURN: true if matching, false if not
|
||||||
// DESC : checks if query is a SELECT or SHOW, if not error, 0 return
|
// DESC : checks if query is a SELECT, SHOW or WITH, if not error, 0 return
|
||||||
// NOTE : Query needs to start with SELECT or SHOW. if starts with "with" it is ignored
|
// NOTE : Query needs to start with SELECT, SHOW or WITH. if starts with "with" it is ignored
|
||||||
private function __checkQueryForSelect($query)
|
private function __checkQueryForSelect($query)
|
||||||
{
|
{
|
||||||
// perhaps allow spaces before select ?!?
|
// perhaps allow spaces before select ?!?
|
||||||
if (!preg_match("/^(select|show|with) /i", $query)) {
|
if (preg_match("/^(select|show|with) /i", $query)) {
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
return true;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// METHOD: __checkQueryForInsert
|
// METHOD: __checkQueryForInsert
|
||||||
@@ -481,16 +481,26 @@ class IO extends \CoreLibs\Basic
|
|||||||
// NOTE : Queries need to start with INSERT, UPDATE, DELETE. Anything else is ignored
|
// NOTE : Queries need to start with INSERT, UPDATE, DELETE. Anything else is ignored
|
||||||
private function __checkQueryForInsert($query, $pure = false)
|
private function __checkQueryForInsert($query, $pure = false)
|
||||||
{
|
{
|
||||||
if (!preg_match("/^insert /i", $query) && !preg_match("/^update /i", $query) && !preg_match("/^delete /i", $query)) {
|
if ($pure && preg_match("/^insert /i", $query)) {
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if (!$pure) {
|
|
||||||
return true;
|
return true;
|
||||||
} elseif (preg_match("/^insert /i", $query)) {
|
|
||||||
return true;
|
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
if (!$pure && preg_match("/^(insert|update|delete) /i", $query)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// METHOD: __checkQueryForUpdate
|
||||||
|
// PARAMS: query
|
||||||
|
// RETURN: true if UPDATE, else false
|
||||||
|
// DESC : returns true if the query starts with UPDATE
|
||||||
|
// NOTE : query NEEDS to start with UPDATE
|
||||||
|
private function __checkQueryForUpdate($query)
|
||||||
|
{
|
||||||
|
if (preg_match("/^update /i", $query)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// METHOD: __printArray
|
// METHOD: __printArray
|
||||||
@@ -501,6 +511,7 @@ class IO extends \CoreLibs\Basic
|
|||||||
// NOTE : used in db_dump_data only
|
// NOTE : used in db_dump_data only
|
||||||
private function __printArray($array)
|
private function __printArray($array)
|
||||||
{
|
{
|
||||||
|
$string = '';
|
||||||
foreach ($array as $key => $value) {
|
foreach ($array as $key => $value) {
|
||||||
$string .= $this->nbsp.'<b>'.$key.'</b> => ';
|
$string .= $this->nbsp.'<b>'.$key.'</b> => ';
|
||||||
if (is_array($value)) {
|
if (is_array($value)) {
|
||||||
@@ -683,15 +694,22 @@ class IO extends \CoreLibs\Basic
|
|||||||
$this->query = preg_replace("/(;\s*)$/", '', $this->query);
|
$this->query = preg_replace("/(;\s*)$/", '', $this->query);
|
||||||
$this->query .= " RETURNING ".$this->pk_name;
|
$this->query .= " RETURNING ".$this->pk_name;
|
||||||
$this->returning_id = true;
|
$this->returning_id = true;
|
||||||
} elseif (preg_match("/ returning (.*)/i", $this->query, $matches) && $this->pk_name && $this->pk_name != 'NULL') {
|
} elseif (preg_match("/ returning (.*)/i", $this->query, $matches)) {
|
||||||
// add the primary key if it is not in the returning set
|
if ($this->pk_name && $this->pk_name != 'NULL') {
|
||||||
if (!preg_match("/$this->pk_name/", $matches[1])) {
|
// add the primary key if it is not in the returning set
|
||||||
$this->query .= " , ".$this->pk_name;
|
if (!preg_match("/$this->pk_name/", $matches[1])) {
|
||||||
|
$this->query .= " , ".$this->pk_name;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
$this->returning_id = true;
|
$this->returning_id = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// if we have an UPDATE and RETURNING, flag for true, but do not add anything
|
||||||
|
if ($this->__checkQueryForUpdate($this->query) && preg_match("/ returning (.*)/i", $this->query, $matches)) {
|
||||||
|
$this->returning_id = true;
|
||||||
|
}
|
||||||
|
// $this->debug('DB IO', 'Q: '.$this->query.', RETURN: '.$this->returning_id);
|
||||||
// for DEBUG, only on first time ;)
|
// for DEBUG, only on first time ;)
|
||||||
if ($this->db_debug) {
|
if ($this->db_debug) {
|
||||||
$this->__dbDebug('db', $this->query, '__dbPrepareExec', 'Q');
|
$this->__dbDebug('db', $this->query, '__dbPrepareExec', 'Q');
|
||||||
@@ -752,7 +770,9 @@ class IO extends \CoreLibs\Basic
|
|||||||
// if not select do here
|
// if not select do here
|
||||||
// count affected rows
|
// count affected rows
|
||||||
$this->num_rows = $this->db_functions->__dbAffectedRows($this->cursor);
|
$this->num_rows = $this->db_functions->__dbAffectedRows($this->cursor);
|
||||||
if ($this->__checkQueryForInsert($this->query, true) && $this->pk_name != 'NULL') {
|
if (($this->__checkQueryForInsert($this->query, true) && $this->pk_name != 'NULL') ||
|
||||||
|
($this->__checkQueryForUpdate($this->query) && $this->returning_id)
|
||||||
|
) {
|
||||||
// set insert_id
|
// set insert_id
|
||||||
// if we do not have a returning, we try to get it via the primary key and another select
|
// if we do not have a returning, we try to get it via the primary key and another select
|
||||||
if (!$this->returning_id) {
|
if (!$this->returning_id) {
|
||||||
@@ -770,14 +790,16 @@ class IO extends \CoreLibs\Basic
|
|||||||
// if we have only one, revert from array to single
|
// if we have only one, revert from array to single
|
||||||
if (count($this->insert_id) == 1) {
|
if (count($this->insert_id) == 1) {
|
||||||
// echo "* SINGLE DATA CONVERT: ".count($this->insert_id[0])." => ".array_key_exists($this->pk_name, $this->insert_id[0])."<br>";
|
// echo "* SINGLE DATA CONVERT: ".count($this->insert_id[0])." => ".array_key_exists($this->pk_name, $this->insert_id[0])."<br>";
|
||||||
// echo "* PK DIRECT: ".$this->insert_id[0][$this->pk_name]."<Br>";
|
// echo "* PK DIRECT: ".(isset($this->insert_id[0][$this->pk_name]) ? $this->insert_id[0][$this->pk_name] : '[NO PK NAME SET]' )."<Br>";
|
||||||
// if this has only the pk_name, then only return this, else array of all data (but without the position)
|
// if this has only the pk_name, then only return this, else array of all data (but without the position)
|
||||||
// example if insert_id[0]['foo'] && insert_id[0]['bar'] it will become insert_id['foo'] & insert_id['bar']
|
// example if insert_id[0]['foo'] && insert_id[0]['bar'] it will become insert_id['foo'] & insert_id['bar']
|
||||||
// if only ['foo_id'] and it is the PK then the PK is directly written to the insert_id
|
// if only ['foo_id'] and it is the PK then the PK is directly written to the insert_id
|
||||||
if (count($this->insert_id[0]) > 1 || !array_key_exists($this->pk_name, $this->insert_id[0])) {
|
if (count($this->insert_id[0]) > 1 || !array_key_exists($this->pk_name, $this->insert_id[0])) {
|
||||||
$this->insert_id_ext = $this->insert_id[0];
|
$this->insert_id_ext = $this->insert_id[0];
|
||||||
$this->insert_id = $this->insert_id[0][$this->pk_name];
|
if (isset($this->insert_id[0][$this->pk_name])) {
|
||||||
} elseif ($this->insert_id[0][$this->pk_name]) {
|
$this->insert_id = $this->insert_id[0][$this->pk_name];
|
||||||
|
}
|
||||||
|
} elseif (isset($this->insert_id[0][$this->pk_name])) {
|
||||||
$this->insert_id = $this->insert_id[0][$this->pk_name];
|
$this->insert_id = $this->insert_id[0][$this->pk_name];
|
||||||
}
|
}
|
||||||
} elseif (count($this->insert_id) == 0) {
|
} elseif (count($this->insert_id) == 0) {
|
||||||
@@ -917,7 +939,7 @@ class IO extends \CoreLibs\Basic
|
|||||||
// DESC : returns the current set client encoding from the connected DB
|
// DESC : returns the current set client encoding from the connected DB
|
||||||
public function dbGetEncoding()
|
public function dbGetEncoding()
|
||||||
{
|
{
|
||||||
return $this->db_return_row('SHOW client_encoding')['client_encoding'];
|
return $this->dbReturnRow('SHOW client_encoding')['client_encoding'];
|
||||||
}
|
}
|
||||||
|
|
||||||
// METHOD: dbInfo
|
// METHOD: dbInfo
|
||||||
@@ -956,6 +978,7 @@ class IO extends \CoreLibs\Basic
|
|||||||
} else {
|
} else {
|
||||||
$array = $this->cursor_ext;
|
$array = $this->cursor_ext;
|
||||||
}
|
}
|
||||||
|
$string = '';
|
||||||
if (is_array($array)) {
|
if (is_array($array)) {
|
||||||
$this->nbps = '';
|
$this->nbps = '';
|
||||||
$string .= $this->__printArray($array);
|
$string .= $this->__printArray($array);
|
||||||
@@ -1795,6 +1818,7 @@ class IO extends \CoreLibs\Basic
|
|||||||
// DESC : this is only needed for Postgresql. Converts postgresql arrays to PHP
|
// DESC : this is only needed for Postgresql. Converts postgresql arrays to PHP
|
||||||
public function dbArrayParse($text)
|
public function dbArrayParse($text)
|
||||||
{
|
{
|
||||||
|
$output = array ();
|
||||||
return $this->db_functions->__dbArrayParse($text, $output);
|
return $this->db_functions->__dbArrayParse($text, $output);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2096,3 +2120,5 @@ class IO extends \CoreLibs\Basic
|
|||||||
return $this->dbSqlEscape($value, $kbn);
|
return $this->dbSqlEscape($value, $kbn);
|
||||||
}
|
}
|
||||||
} // end if db class
|
} // end if db class
|
||||||
|
|
||||||
|
// __END__
|
||||||
|
|||||||
@@ -148,7 +148,7 @@ class PgSQL
|
|||||||
{
|
{
|
||||||
$result = pg_execute($this->dbh, $name, $data);
|
$result = pg_execute($this->dbh, $name, $data);
|
||||||
if (!$result) {
|
if (!$result) {
|
||||||
$this->last_error_query = $query;
|
$this->last_error_query = $name;
|
||||||
}
|
}
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
@@ -350,7 +350,8 @@ class PgSQL
|
|||||||
// DESC : wrapper for pg_emta_data
|
// DESC : wrapper for pg_emta_data
|
||||||
public function __dbMetaData($table)
|
public function __dbMetaData($table)
|
||||||
{
|
{
|
||||||
return pg_meta_data($this->dbh, $table);
|
// needs to prefixed with @ or it throws a warning on not existing table
|
||||||
|
return @pg_meta_data($this->dbh, $table);
|
||||||
}
|
}
|
||||||
|
|
||||||
// METHOD: __dbEscapeString
|
// METHOD: __dbEscapeString
|
||||||
@@ -427,4 +428,4 @@ class PgSQL
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# __END__
|
// __END__
|
||||||
|
|||||||
@@ -45,4 +45,4 @@ class CachedFileReader extends CoreLibs\Language\Core\StringReader
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# __END__
|
// __END__
|
||||||
|
|||||||
@@ -88,4 +88,4 @@ class FileReader
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# __END__
|
// __END__
|
||||||
|
|||||||
@@ -146,8 +146,8 @@ class GetTextReader
|
|||||||
private function load_tables()
|
private function load_tables()
|
||||||
{
|
{
|
||||||
if (is_array($this->cache_translations) &&
|
if (is_array($this->cache_translations) &&
|
||||||
is_array($this->table_originals) &&
|
is_array($this->table_originals) &&
|
||||||
is_array($this->table_translations)) {
|
is_array($this->table_translations)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -457,4 +457,4 @@ class GetTextReader
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# __END__
|
// __END__
|
||||||
|
|||||||
@@ -51,4 +51,4 @@ class StreamReader
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# __END__
|
// __END__
|
||||||
|
|||||||
@@ -64,4 +64,4 @@ class StringReader
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# __END__
|
// __END__
|
||||||
|
|||||||
@@ -57,7 +57,6 @@ class L10n extends \CoreLibs\Basic
|
|||||||
} else {
|
} else {
|
||||||
$this->input = false;
|
$this->input = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->l10n = new GetTextReader($this->input);
|
$this->l10n = new GetTextReader($this->input);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -114,3 +113,5 @@ class L10n extends \CoreLibs\Basic
|
|||||||
return $this->mofile;
|
return $this->mofile;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// __END__
|
||||||
|
|||||||
@@ -256,7 +256,12 @@ class Generate extends \CoreLibs\DB\Extended\ArrayIO
|
|||||||
// load config array
|
// load config array
|
||||||
// get table array definitions for current page name
|
// get table array definitions for current page name
|
||||||
// WARNING: auto spl load does not work with this as it is an array and not a function/object
|
// WARNING: auto spl load does not work with this as it is an array and not a function/object
|
||||||
include(TABLE_ARRAYS."array_".$this->my_page_name.".inc");
|
// check if this is the old path or the new path
|
||||||
|
if (is_dir(TABLE_ARRAYS)) {
|
||||||
|
include(TABLE_ARRAYS."array_".$this->my_page_name.".inc");
|
||||||
|
} else {
|
||||||
|
include(BASE.INCLUDES.TABLE_ARRAYS.'array_'.$this->my_page_name.'.inc');
|
||||||
|
}
|
||||||
$config_array = ${$this->my_page_name};
|
$config_array = ${$this->my_page_name};
|
||||||
|
|
||||||
// start the array_io class which will start db_io ...
|
// start the array_io class which will start db_io ...
|
||||||
@@ -318,7 +323,7 @@ class Generate extends \CoreLibs\DB\Extended\ArrayIO
|
|||||||
$this->table_array = array ();
|
$this->table_array = array ();
|
||||||
}
|
}
|
||||||
reset($this->table_array);
|
reset($this->table_array);
|
||||||
$string .= "<b>TABLE ARRAY DUMP:</b> ".$this->table_name."<br>";
|
$string = "<b>TABLE ARRAY DUMP:</b> ".$this->table_name."<br>";
|
||||||
foreach ($this->table_array as $key => $value) {
|
foreach ($this->table_array as $key => $value) {
|
||||||
$string .= "<b>$key</b>: ".$value["value"]."<br>";
|
$string .= "<b>$key</b>: ".$value["value"]."<br>";
|
||||||
}
|
}
|
||||||
@@ -552,7 +557,7 @@ class Generate extends \CoreLibs\DB\Extended\ArrayIO
|
|||||||
if ($res[$this->int_pk_name] == $this->table_array[$this->int_pk_name]["value"]) {
|
if ($res[$this->int_pk_name] == $this->table_array[$this->int_pk_name]["value"]) {
|
||||||
$pk_selected = $res[$this->int_pk_name];
|
$pk_selected = $res[$this->int_pk_name];
|
||||||
}
|
}
|
||||||
unset($t_string);
|
$t_string = '';
|
||||||
for ($i = 0, $i_max = count($this->field_array); $i < $i_max; $i ++) {
|
for ($i = 0, $i_max = count($this->field_array); $i < $i_max; $i ++) {
|
||||||
if ($t_string) {
|
if ($t_string) {
|
||||||
$t_string .= ", ";
|
$t_string .= ", ";
|
||||||
@@ -874,8 +879,8 @@ class Generate extends \CoreLibs\DB\Extended\ArrayIO
|
|||||||
break;
|
break;
|
||||||
case "alphanumericspace":
|
case "alphanumericspace":
|
||||||
// $this->debug('edit', 'IN Alphanumericspace');
|
// $this->debug('edit', 'IN Alphanumericspace');
|
||||||
if (!preg_match("/^[0-9A-Za-z\ ]+$/", $this->table_array[$key]["value"])) {
|
if (!preg_match("/^[0-9A-Za-z_\-\ ]+$/", $this->table_array[$key]["value"])) {
|
||||||
$this->msg .= sprintf($this->l->__("Please enter a valid alphanumeric (Numbers and Letters, spaces allowed) value for the <b>%s</b> Field!<br>"), $this->table_array[$key]["output_name"]);
|
$this->msg .= sprintf($this->l->__("Please enter a valid alphanumeric (Numbers and Letters, -, _ and spaces allowed) value for the <b>%s</b> Field!<br>"), $this->table_array[$key]["output_name"]);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case "alphanumeric":
|
case "alphanumeric":
|
||||||
@@ -1008,7 +1013,7 @@ class Generate extends \CoreLibs\DB\Extended\ArrayIO
|
|||||||
}
|
}
|
||||||
// do optional error checks like for normal fields
|
// do optional error checks like for normal fields
|
||||||
// currently active: unique/alphanumeric
|
// currently active: unique/alphanumeric
|
||||||
if ($data_rray['error_check']) {
|
if ($data_array['error_check']) {
|
||||||
foreach (explode('|', $value["error_check"]) as $error_check) {
|
foreach (explode('|', $value["error_check"]) as $error_check) {
|
||||||
switch ($error_check) {
|
switch ($error_check) {
|
||||||
// check unique, check if field in table is not yet exist
|
// check unique, check if field in table is not yet exist
|
||||||
@@ -1309,6 +1314,9 @@ class Generate extends \CoreLibs\DB\Extended\ArrayIO
|
|||||||
// go through all submitted data
|
// go through all submitted data
|
||||||
// for ($i = 0; $i < count($_POST[$el_name]); $i ++)
|
// for ($i = 0; $i < count($_POST[$el_name]); $i ++)
|
||||||
for ($i = 0; $i < $max; $i ++) {
|
for ($i = 0; $i < $max; $i ++) {
|
||||||
|
$q_data[$i] = '';
|
||||||
|
$q_names[$i] = '';
|
||||||
|
$q_values[$i] = '';
|
||||||
// if we have enable name & delete set, then only insert/update those which are flagged as active
|
// if we have enable name & delete set, then only insert/update those which are flagged as active
|
||||||
// check if mandatory field is set, if not set "do not write flag"
|
// check if mandatory field is set, if not set "do not write flag"
|
||||||
if ($data_array["mandatory"] && !$_POST[$prfx.$el_name][$i]) {
|
if ($data_array["mandatory"] && !$_POST[$prfx.$el_name][$i]) {
|
||||||
@@ -1713,4 +1721,4 @@ class Generate extends \CoreLibs\DB\Extended\ArrayIO
|
|||||||
}
|
}
|
||||||
} // end of class
|
} // end of class
|
||||||
|
|
||||||
# __END__
|
// __END__
|
||||||
|
|||||||
@@ -527,7 +527,7 @@ class ProgressBar
|
|||||||
case 'percent':
|
case 'percent':
|
||||||
// only one inner percent
|
// only one inner percent
|
||||||
// print "STYLE[$name]: ".$style_lbl."<br>";
|
// print "STYLE[$name]: ".$style_lbl."<br>";
|
||||||
if (!$html_percent) {
|
if (!isset($html_percent)) {
|
||||||
$html_percent = '<div id="plbl'.$name.$this->code.'" style="'.$style_lbl.'width:'.$data['width'].'px;line-height:1;text-shadow: 0 0 .2em white, 0 0 .5em white;">'.$this->__calculatePercent($this->step).'%</div>'."\n";
|
$html_percent = '<div id="plbl'.$name.$this->code.'" style="'.$style_lbl.'width:'.$data['width'].'px;line-height:1;text-shadow: 0 0 .2em white, 0 0 .5em white;">'.$this->__calculatePercent($this->step).'%</div>'."\n";
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -669,4 +669,4 @@ class ProgressBar
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# __END__
|
// __END__
|
||||||
|
|||||||
@@ -29,4 +29,4 @@ class SmartyExtend extends SmartyBC
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# __END__
|
// __END__
|
||||||
|
|||||||
@@ -28,4 +28,4 @@ class qqUploadedFileForm
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# __END__
|
// __END__
|
||||||
|
|||||||
@@ -43,4 +43,4 @@ class qqUploadedFileXhr
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# __END__
|
// __END__
|
||||||
|
|||||||
@@ -101,12 +101,12 @@ class qqFileUploader
|
|||||||
$this->uploadFileExt = $ext;
|
$this->uploadFileExt = $ext;
|
||||||
|
|
||||||
if ($this->file->save($uploadDirectory . $filename . '.' . $ext)) {
|
if ($this->file->save($uploadDirectory . $filename . '.' . $ext)) {
|
||||||
return array('success'=>true);
|
return array('success' => true);
|
||||||
} else {
|
} else {
|
||||||
return array('error'=> 'Could not save uploaded file.' .
|
return array('error' => 'Could not save uploaded file.' .
|
||||||
'The upload was cancelled, or server error encountered');
|
'The upload was cancelled, or server error encountered');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# __END__
|
// __END__
|
||||||
|
|||||||
@@ -108,3 +108,5 @@ function MyErrorHandler($type, $message, $file, $line, $context)
|
|||||||
|
|
||||||
// init the error handler
|
// init the error handler
|
||||||
set_error_handler("MyErrorHandler");
|
set_error_handler("MyErrorHandler");
|
||||||
|
|
||||||
|
// __END__
|
||||||
|
|||||||
@@ -54,4 +54,4 @@ if (class_exists('Autoload', false) === false) {
|
|||||||
spl_autoload_register('Autoloader\Autoload::load', true, true);
|
spl_autoload_register('Autoloader\Autoload::load', true, true);
|
||||||
} // end check for already defined
|
} // end check for already defined
|
||||||
|
|
||||||
# __END__
|
// __END__
|
||||||
|
|||||||
1
www/log/.gitignore
vendored
1
www/log/.gitignore
vendored
@@ -1,2 +1,3 @@
|
|||||||
*log
|
*log
|
||||||
|
*LOG
|
||||||
!.gitignore
|
!.gitignore
|
||||||
|
|||||||
2
www/media/uploads/.gitignore
vendored
Normal file
2
www/media/uploads/.gitignore
vendored
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
*
|
||||||
|
!.gitignore
|
||||||
Reference in New Issue
Block a user