├── files └── .gitignore ├── config ├── .gitignore └── example.config.php ├── resources └── .gitignore ├── modules ├── Autoloader │ ├── .gitignore │ ├── commit.sha │ ├── README.md │ └── Autoloader.php ├── Former │ ├── tpl │ │ ├── error.html │ │ ├── hiddenfield.html │ │ ├── dropdownoption.html │ │ ├── checkoption.html │ │ ├── radiooption.html │ │ ├── form.html │ │ ├── check.html │ │ ├── radio.html │ │ ├── submit.html │ │ ├── textarea.html │ │ ├── textbox.html │ │ ├── file.html │ │ ├── image.html │ │ ├── passwordbox.html │ │ ├── dropdown.html │ │ ├── datepicker.html │ │ └── tinyeditor.html │ ├── commit.sha │ ├── plugins │ │ ├── datepicker │ │ │ ├── README.md │ │ │ └── datepicker.css │ │ └── tinymce │ │ │ ├── themes │ │ │ ├── simple │ │ │ │ ├── img │ │ │ │ │ └── icons.gif │ │ │ │ ├── skins │ │ │ │ │ ├── o2k7 │ │ │ │ │ │ ├── img │ │ │ │ │ │ │ └── button_bg.png │ │ │ │ │ │ ├── content.css │ │ │ │ │ │ └── ui.css │ │ │ │ │ └── default │ │ │ │ │ │ ├── content.css │ │ │ │ │ │ └── ui.css │ │ │ │ ├── langs │ │ │ │ │ └── en.js │ │ │ │ └── editor_template.js │ │ │ └── advanced │ │ │ │ ├── img │ │ │ │ ├── flash.gif │ │ │ │ ├── icons.gif │ │ │ │ ├── iframe.gif │ │ │ │ ├── trans.gif │ │ │ │ ├── video.gif │ │ │ │ ├── pagebreak.gif │ │ │ │ ├── quicktime.gif │ │ │ │ ├── realmedia.gif │ │ │ │ ├── shockwave.gif │ │ │ │ ├── colorpicker.jpg │ │ │ │ └── windowsmedia.gif │ │ │ │ ├── skins │ │ │ │ ├── default │ │ │ │ │ ├── img │ │ │ │ │ │ ├── items.gif │ │ │ │ │ │ ├── tabs.gif │ │ │ │ │ │ ├── buttons.png │ │ │ │ │ │ ├── menu_arrow.gif │ │ │ │ │ │ ├── menu_check.gif │ │ │ │ │ │ └── progress.gif │ │ │ │ │ ├── content.css │ │ │ │ │ └── dialog.css │ │ │ │ ├── o2k7 │ │ │ │ │ ├── img │ │ │ │ │ │ ├── button_bg.png │ │ │ │ │ │ ├── button_bg_black.png │ │ │ │ │ │ └── button_bg_silver.png │ │ │ │ │ ├── ui_silver.css │ │ │ │ │ ├── ui_black.css │ │ │ │ │ ├── content.css │ │ │ │ │ └── dialog.css │ │ │ │ └── highcontrast │ │ │ │ │ ├── content.css │ │ │ │ │ └── dialog.css │ │ │ │ ├── anchor.htm │ │ │ │ ├── source_editor.htm │ │ │ │ ├── js │ │ │ │ ├── anchor.js │ │ │ │ ├── source_editor.js │ │ │ │ ├── about.js │ │ │ │ ├── link.js │ │ │ │ └── image.js │ │ │ │ ├── shortcuts.htm │ │ │ │ ├── langs │ │ │ │ ├── en_dlg.js │ │ │ │ └── en.js │ │ │ │ ├── charmap.htm │ │ │ │ ├── link.htm │ │ │ │ ├── about.htm │ │ │ │ ├── color_picker.htm │ │ │ │ └── image.htm │ │ │ ├── utils │ │ │ ├── editable_selects.js │ │ │ ├── mctabs.js │ │ │ ├── form_utils.js │ │ │ └── validate.js │ │ │ ├── tiny_mce_popup.js │ │ │ └── langs │ │ │ └── en.js │ └── css │ │ └── styles.css ├── View │ ├── commit.sha │ ├── README.md │ └── index.php ├── FlightNet │ ├── commit.sha │ ├── Router.php │ ├── Request.php │ └── Response.php ├── Router │ ├── commit.sha │ ├── htaccess │ │ └── .htaccess │ ├── README.md │ └── index.php ├── DBAdapters │ ├── commit.sha │ └── README.md ├── ErrorHandler │ ├── commit.sha │ ├── README.md │ └── index.php └── SessionManager │ ├── commit.sha │ ├── README.md │ └── index.php ├── tpl ├── resource │ ├── list-item-column.html │ ├── list-link.html │ ├── list-pagination.html │ ├── success.html │ ├── child-resource.html │ ├── list-link-with-image.html │ ├── list-item-row-headers.html │ ├── list-item-row.html │ ├── add.html │ ├── edit.html │ └── index.html ├── error.html ├── home │ ├── index.html │ └── resources-link.html ├── nav.html └── layout.html ├── assets └── css │ ├── bootstrap │ └── bootstrap │ │ └── img │ │ ├── glyphicons-halflings.png │ │ └── glyphicons-halflings-white.png │ └── styles.css ├── controllers ├── Logout.php ├── Controller.php ├── helpers │ ├── actions │ │ ├── ActionDelete.php │ │ ├── ActionAdd.php │ │ ├── ActionEdit.php │ │ ├── ActionPosition.php │ │ └── ActionList.php │ ├── Resources.php │ └── SImpleImage.php ├── Main.php ├── Resource.php └── RequireLogin.php ├── .htaccess ├── composer.json ├── install.json ├── index.php └── README.md /files/.gitignore: -------------------------------------------------------------------------------- 1 | [^.]* -------------------------------------------------------------------------------- /config/.gitignore: -------------------------------------------------------------------------------- 1 | config.php -------------------------------------------------------------------------------- /resources/.gitignore: -------------------------------------------------------------------------------- 1 | [^.]* -------------------------------------------------------------------------------- /modules/Autoloader/.gitignore: -------------------------------------------------------------------------------- 1 | loader.cache.php -------------------------------------------------------------------------------- /tpl/resource/list-item-column.html: -------------------------------------------------------------------------------- 1 | {value} -------------------------------------------------------------------------------- /modules/Former/tpl/error.html: -------------------------------------------------------------------------------- 1 |
{message}
-------------------------------------------------------------------------------- /modules/View/commit.sha: -------------------------------------------------------------------------------- 1 | 74eb7d51eed1f10bc5cd60966470c8a8e31a2fea -------------------------------------------------------------------------------- /tpl/error.html: -------------------------------------------------------------------------------- 1 |
{message}
-------------------------------------------------------------------------------- /modules/FlightNet/commit.sha: -------------------------------------------------------------------------------- 1 | 65807a1f29540c3bbbd9a6f9ef9d5ace7462b277 -------------------------------------------------------------------------------- /modules/Former/commit.sha: -------------------------------------------------------------------------------- 1 | 74eb7d51eed1f10bc5cd60966470c8a8e31a2fea -------------------------------------------------------------------------------- /modules/Router/commit.sha: -------------------------------------------------------------------------------- 1 | 74eb7d51eed1f10bc5cd60966470c8a8e31a2fea -------------------------------------------------------------------------------- /modules/Autoloader/commit.sha: -------------------------------------------------------------------------------- 1 | 74eb7d51eed1f10bc5cd60966470c8a8e31a2fea -------------------------------------------------------------------------------- /modules/DBAdapters/commit.sha: -------------------------------------------------------------------------------- 1 | 74eb7d51eed1f10bc5cd60966470c8a8e31a2fea -------------------------------------------------------------------------------- /modules/ErrorHandler/commit.sha: -------------------------------------------------------------------------------- 1 | 74eb7d51eed1f10bc5cd60966470c8a8e31a2fea -------------------------------------------------------------------------------- /modules/SessionManager/commit.sha: -------------------------------------------------------------------------------- 1 | 74eb7d51eed1f10bc5cd60966470c8a8e31a2fea -------------------------------------------------------------------------------- /tpl/resource/list-link.html: -------------------------------------------------------------------------------- 1 | {label} -------------------------------------------------------------------------------- /tpl/resource/list-pagination.html: -------------------------------------------------------------------------------- 1 |
  • {label}
  • -------------------------------------------------------------------------------- /tpl/resource/success.html: -------------------------------------------------------------------------------- 1 |
    2 | {message} 3 |
    -------------------------------------------------------------------------------- /modules/Former/tpl/hiddenfield.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /modules/Former/plugins/datepicker/README.md: -------------------------------------------------------------------------------- 1 | [DatePicker](http://code.google.com/p/datepickr/) -------------------------------------------------------------------------------- /modules/Former/tpl/dropdownoption.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tpl/home/index.html: -------------------------------------------------------------------------------- 1 | 4 | -------------------------------------------------------------------------------- /tpl/resource/child-resource.html: -------------------------------------------------------------------------------- 1 |
  • {title}
  • -------------------------------------------------------------------------------- /tpl/resource/list-link-with-image.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tpl/home/resources-link.html: -------------------------------------------------------------------------------- 1 |
  • 2 | {label} 3 |
  • -------------------------------------------------------------------------------- /modules/Former/tpl/checkoption.html: -------------------------------------------------------------------------------- 1 | {label}
    -------------------------------------------------------------------------------- /modules/ErrorHandler/README.md: -------------------------------------------------------------------------------- 1 | # Error handler 2 | Styling the PHP errors. 3 | 4 | ## Usage 5 | Simply, include index.php in your project. -------------------------------------------------------------------------------- /tpl/resource/list-item-row-headers.html: -------------------------------------------------------------------------------- 1 | 2 | {columns} 3 | 4 |   5 | 6 | -------------------------------------------------------------------------------- /modules/Former/tpl/radiooption.html: -------------------------------------------------------------------------------- 1 | {label}
    -------------------------------------------------------------------------------- /assets/css/bootstrap/bootstrap/img/glyphicons-halflings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/krasimir/admin-ui/master/assets/css/bootstrap/bootstrap/img/glyphicons-halflings.png -------------------------------------------------------------------------------- /modules/Former/plugins/tinymce/themes/simple/img/icons.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/krasimir/admin-ui/master/modules/Former/plugins/tinymce/themes/simple/img/icons.gif -------------------------------------------------------------------------------- /modules/Former/plugins/tinymce/themes/advanced/img/flash.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/krasimir/admin-ui/master/modules/Former/plugins/tinymce/themes/advanced/img/flash.gif -------------------------------------------------------------------------------- /modules/Former/plugins/tinymce/themes/advanced/img/icons.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/krasimir/admin-ui/master/modules/Former/plugins/tinymce/themes/advanced/img/icons.gif -------------------------------------------------------------------------------- /modules/Former/plugins/tinymce/themes/advanced/img/iframe.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/krasimir/admin-ui/master/modules/Former/plugins/tinymce/themes/advanced/img/iframe.gif -------------------------------------------------------------------------------- /modules/Former/plugins/tinymce/themes/advanced/img/trans.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/krasimir/admin-ui/master/modules/Former/plugins/tinymce/themes/advanced/img/trans.gif -------------------------------------------------------------------------------- /modules/Former/plugins/tinymce/themes/advanced/img/video.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/krasimir/admin-ui/master/modules/Former/plugins/tinymce/themes/advanced/img/video.gif -------------------------------------------------------------------------------- /modules/Former/plugins/tinymce/themes/advanced/img/pagebreak.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/krasimir/admin-ui/master/modules/Former/plugins/tinymce/themes/advanced/img/pagebreak.gif -------------------------------------------------------------------------------- /modules/Former/plugins/tinymce/themes/advanced/img/quicktime.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/krasimir/admin-ui/master/modules/Former/plugins/tinymce/themes/advanced/img/quicktime.gif -------------------------------------------------------------------------------- /modules/Former/plugins/tinymce/themes/advanced/img/realmedia.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/krasimir/admin-ui/master/modules/Former/plugins/tinymce/themes/advanced/img/realmedia.gif -------------------------------------------------------------------------------- /modules/Former/plugins/tinymce/themes/advanced/img/shockwave.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/krasimir/admin-ui/master/modules/Former/plugins/tinymce/themes/advanced/img/shockwave.gif -------------------------------------------------------------------------------- /assets/css/bootstrap/bootstrap/img/glyphicons-halflings-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/krasimir/admin-ui/master/assets/css/bootstrap/bootstrap/img/glyphicons-halflings-white.png -------------------------------------------------------------------------------- /modules/Former/plugins/tinymce/themes/advanced/img/colorpicker.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/krasimir/admin-ui/master/modules/Former/plugins/tinymce/themes/advanced/img/colorpicker.jpg -------------------------------------------------------------------------------- /modules/Former/plugins/tinymce/themes/advanced/img/windowsmedia.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/krasimir/admin-ui/master/modules/Former/plugins/tinymce/themes/advanced/img/windowsmedia.gif -------------------------------------------------------------------------------- /modules/Former/tpl/form.html: -------------------------------------------------------------------------------- 1 |
    2 | 3 | {elements} 4 |
    -------------------------------------------------------------------------------- /modules/Former/plugins/tinymce/themes/advanced/skins/default/img/items.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/krasimir/admin-ui/master/modules/Former/plugins/tinymce/themes/advanced/skins/default/img/items.gif -------------------------------------------------------------------------------- /modules/Former/plugins/tinymce/themes/advanced/skins/default/img/tabs.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/krasimir/admin-ui/master/modules/Former/plugins/tinymce/themes/advanced/skins/default/img/tabs.gif -------------------------------------------------------------------------------- /modules/Former/plugins/tinymce/themes/simple/skins/o2k7/img/button_bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/krasimir/admin-ui/master/modules/Former/plugins/tinymce/themes/simple/skins/o2k7/img/button_bg.png -------------------------------------------------------------------------------- /modules/Former/plugins/tinymce/themes/advanced/skins/default/img/buttons.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/krasimir/admin-ui/master/modules/Former/plugins/tinymce/themes/advanced/skins/default/img/buttons.png -------------------------------------------------------------------------------- /modules/Former/plugins/tinymce/themes/advanced/skins/o2k7/img/button_bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/krasimir/admin-ui/master/modules/Former/plugins/tinymce/themes/advanced/skins/o2k7/img/button_bg.png -------------------------------------------------------------------------------- /modules/Former/plugins/tinymce/themes/advanced/skins/default/img/menu_arrow.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/krasimir/admin-ui/master/modules/Former/plugins/tinymce/themes/advanced/skins/default/img/menu_arrow.gif -------------------------------------------------------------------------------- /modules/Former/plugins/tinymce/themes/advanced/skins/default/img/menu_check.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/krasimir/admin-ui/master/modules/Former/plugins/tinymce/themes/advanced/skins/default/img/menu_check.gif -------------------------------------------------------------------------------- /modules/Former/plugins/tinymce/themes/advanced/skins/default/img/progress.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/krasimir/admin-ui/master/modules/Former/plugins/tinymce/themes/advanced/skins/default/img/progress.gif -------------------------------------------------------------------------------- /tpl/nav.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /modules/Former/plugins/tinymce/themes/advanced/skins/o2k7/img/button_bg_black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/krasimir/admin-ui/master/modules/Former/plugins/tinymce/themes/advanced/skins/o2k7/img/button_bg_black.png -------------------------------------------------------------------------------- /modules/Former/plugins/tinymce/themes/advanced/skins/o2k7/img/button_bg_silver.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/krasimir/admin-ui/master/modules/Former/plugins/tinymce/themes/advanced/skins/o2k7/img/button_bg_silver.png -------------------------------------------------------------------------------- /modules/Former/tpl/check.html: -------------------------------------------------------------------------------- 1 |
    2 | {error} 3 | 4 |
    5 | {options} 6 |
    7 |
    8 |
    -------------------------------------------------------------------------------- /modules/Former/tpl/radio.html: -------------------------------------------------------------------------------- 1 |
    2 | {error} 3 | 4 |
    5 | {options} 6 |
    7 |
    8 |
    -------------------------------------------------------------------------------- /controllers/Logout.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /modules/Former/tpl/submit.html: -------------------------------------------------------------------------------- 1 |
    2 | 3 |
    4 | 5 |
    6 |
    7 |
    -------------------------------------------------------------------------------- /modules/Former/tpl/textarea.html: -------------------------------------------------------------------------------- 1 |
    2 | {error} 3 | 4 |
    5 | 6 |
    7 |
    8 |
    -------------------------------------------------------------------------------- /.htaccess: -------------------------------------------------------------------------------- 1 | RewriteEngine On 2 | 3 | #RewriteBase / 4 | 5 | RewriteCond %{REQUEST_FILENAME} !-f 6 | RewriteCond %{REQUEST_URI} !(.*)/$ 7 | RewriteRule ^(.*)$ $1/ [QSA,L] 8 | 9 | RewriteCond %{REQUEST_FILENAME} !-f 10 | RewriteRule ^(.*)$ index.php?slug=$1 [QSA,L] -------------------------------------------------------------------------------- /modules/Former/tpl/textbox.html: -------------------------------------------------------------------------------- 1 |
    2 | {error} 3 | 4 |
    5 | 6 |
    7 |
    8 |
    -------------------------------------------------------------------------------- /modules/Former/tpl/file.html: -------------------------------------------------------------------------------- 1 |
    2 | {error} 3 | 4 |
    5 |
    6 | {value} 7 |
    8 |
    9 |
    -------------------------------------------------------------------------------- /modules/Former/tpl/image.html: -------------------------------------------------------------------------------- 1 |
    2 | {error} 3 | 4 |
    5 |
    6 | {value} 7 |
    8 |
    9 |
    -------------------------------------------------------------------------------- /modules/Former/tpl/passwordbox.html: -------------------------------------------------------------------------------- 1 |
    2 | {error} 3 | 4 |
    5 | 6 |
    7 |
    8 |
    -------------------------------------------------------------------------------- /modules/Router/htaccess/.htaccess: -------------------------------------------------------------------------------- 1 | RewriteEngine On 2 | 3 | #RewriteBase / 4 | 5 | RewriteCond %{REQUEST_FILENAME} !-f 6 | RewriteCond %{REQUEST_URI} !(.*)/$ 7 | RewriteRule ^(.*)$ $1/ [QSA,L] 8 | 9 | RewriteCond %{REQUEST_FILENAME} !-f 10 | RewriteRule ^(.*)$ index.php?slug=$1 [QSA,L] -------------------------------------------------------------------------------- /modules/Former/tpl/dropdown.html: -------------------------------------------------------------------------------- 1 |
    2 | {error} 3 | 4 |
    5 | 8 |
    9 |
    10 |
    -------------------------------------------------------------------------------- /controllers/Controller.php: -------------------------------------------------------------------------------- 1 | response = new Response(); 11 | $this->mysql = $mysql; 12 | } 13 | } 14 | 15 | ?> -------------------------------------------------------------------------------- /modules/Former/plugins/tinymce/themes/simple/langs/en.js: -------------------------------------------------------------------------------- 1 | tinyMCE.addI18n('en.simple',{"cleanup_desc":"Cleanup Messy Code","redo_desc":"Redo (Ctrl+Y)","undo_desc":"Undo (Ctrl+Z)","numlist_desc":"Insert/Remove Numbered List","bullist_desc":"Insert/Remove Bulleted List","striketrough_desc":"Strikethrough","underline_desc":"Underline (Ctrl+U)","italic_desc":"Italic (Ctrl+I)","bold_desc":"Bold (Ctrl+B)"}); -------------------------------------------------------------------------------- /modules/Former/tpl/datepicker.html: -------------------------------------------------------------------------------- 1 |
    2 | {error} 3 | 4 |
    5 | 6 |
    7 |
    8 |
    9 | -------------------------------------------------------------------------------- /tpl/resource/list-item-row.html: -------------------------------------------------------------------------------- 1 | 2 | {columns} 3 | 4 | 5 | 6 | | 7 | delete 8 | 9 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "krasimir/admin-ui", 3 | "type": "library", 4 | "description": "PHP based micro administration", 5 | "keywords": ["simple CMS", "micro administration"], 6 | "homepage": "https://github.com/krasimir/admin-ui", 7 | "license": "MIT", 8 | "authors": [ 9 | { 10 | "name": "Krasimir Tsonev", 11 | "email": "info@krasimirtsonev.com", 12 | "homepage": "http://krasimirtsonev.com/" 13 | } 14 | ], 15 | "require": { 16 | "php": ">=5" 17 | } 18 | } -------------------------------------------------------------------------------- /modules/Former/plugins/tinymce/themes/simple/skins/o2k7/content.css: -------------------------------------------------------------------------------- 1 | body, td, pre {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;} 2 | 3 | body {background: #FFF;} 4 | .mceVisualAid {border: 1px dashed #BBB;} 5 | 6 | /* IE */ 7 | 8 | * html body { 9 | scrollbar-3dlight-color: #F0F0EE; 10 | scrollbar-arrow-color: #676662; 11 | scrollbar-base-color: #F0F0EE; 12 | scrollbar-darkshadow-color: #DDDDDD; 13 | scrollbar-face-color: #E0E0DD; 14 | scrollbar-highlight-color: #F0F0EE; 15 | scrollbar-shadow-color: #F0F0EE; 16 | scrollbar-track-color: #F5F5F5; 17 | } 18 | -------------------------------------------------------------------------------- /modules/View/README.md: -------------------------------------------------------------------------------- 1 | # Super simple template engine 2 | 3 | - - - 4 | 5 | ## Initialization 6 | 7 | View::$root = [path to your templates]; 8 | 9 | ## Usage 10 | 11 | $htmlContent = view([path to template], [associative array with variables]); 12 | 13 | ## Example 14 | 15 | $htmlContent = view("/tpl/home.html", array( 16 | "titleOfThePage" => "Fabrico test", 17 | "title" => "Fabrico", 18 | "content" => "It works!" 19 | )); 20 | 21 | ## If you want to pass variables to every of the views: 22 | 23 | View::$forEachView = array( 24 | "globalVar" => "global variable" 25 | ); -------------------------------------------------------------------------------- /modules/Former/plugins/tinymce/themes/simple/skins/default/content.css: -------------------------------------------------------------------------------- 1 | body, td, pre { 2 | font-family: Verdana, Arial, Helvetica, sans-serif; 3 | font-size: 10px; 4 | } 5 | 6 | body { 7 | background-color: #FFFFFF; 8 | } 9 | 10 | .mceVisualAid { 11 | border: 1px dashed #BBBBBB; 12 | } 13 | 14 | /* MSIE specific */ 15 | 16 | * html body { 17 | scrollbar-3dlight-color: #F0F0EE; 18 | scrollbar-arrow-color: #676662; 19 | scrollbar-base-color: #F0F0EE; 20 | scrollbar-darkshadow-color: #DDDDDD; 21 | scrollbar-face-color: #E0E0DD; 22 | scrollbar-highlight-color: #F0F0EE; 23 | scrollbar-shadow-color: #F0F0EE; 24 | scrollbar-track-color: #F5F5F5; 25 | } 26 | -------------------------------------------------------------------------------- /tpl/resource/add.html: -------------------------------------------------------------------------------- 1 |
    2 |
    3 | 9 |
    10 |
    11 | 14 |
    15 |
    16 |
    17 | 18 |
    19 |
    20 | {form} 21 |
    22 |
    -------------------------------------------------------------------------------- /controllers/helpers/actions/ActionDelete.php: -------------------------------------------------------------------------------- 1 | id = $id; 8 | $this->defineContext(); 9 | $this->defineForm(); 10 | $this->run(); 11 | } 12 | public function run() { 13 | $record = $this->mysql->{$this->resource->name}->where("id=".$this->id)->get(); 14 | $record = $record[0]; 15 | $this->mysql->{$this->resource->name}->trash($record); 16 | header("Location: ".ADMINUI_URL."resources/".$this->resource->name); 17 | die(); 18 | } 19 | 20 | } 21 | 22 | ?> -------------------------------------------------------------------------------- /modules/Former/css/styles.css: -------------------------------------------------------------------------------- 1 | .former-element { 2 | margin: 0 0 15px 0; 3 | } 4 | .former-element .clear { 5 | clear: both; 6 | } 7 | .former-element label { 8 | float: left; 9 | width: 50%; 10 | } 11 | .former-element input, 12 | .former-element textarea { 13 | width: 100%; 14 | } 15 | .form-element-controls { 16 | width: 50%; 17 | float: right; 18 | } 19 | .former-element .submit { 20 | width: 100px; 21 | } 22 | .former-element .error { 23 | padding: 10px; 24 | border-radius: 5px; 25 | background: #FFA3A3; 26 | margin: 0 0 10px 0; 27 | } 28 | .former-element .boxes { 29 | display: block; 30 | float: right; 31 | } 32 | .former-element .radio { 33 | width: auto; 34 | } 35 | .former-element .check { 36 | width: auto; 37 | } -------------------------------------------------------------------------------- /tpl/resource/edit.html: -------------------------------------------------------------------------------- 1 |
    2 |
    3 | 9 |
    10 |
    11 | 15 |
    16 |
    17 |
    18 | 19 |
    20 |
    21 | {form} 22 |
    23 |
    -------------------------------------------------------------------------------- /modules/SessionManager/README.md: -------------------------------------------------------------------------------- 1 | # Session Manager 2 | Managing sessions in PHP. 3 | 4 | ## Store session 5 | 6 | SessionManager::write([string/name], [value]); 7 | 8 | ## Read session 9 | The method returns false if the session is missing or expired. 10 | 11 | SessionManager::read([string/name]); 12 | 13 | ## Set the expire time 14 | 15 | SessionManager::setTTL(60 * 60); // 1 hour 16 | 17 | ## Get the expire time 18 | 19 | SessionManager::getTTL(); 20 | 21 | ## Remove all the stored session variables 22 | 23 | SessionManager::destroy(); 24 | 25 | ## Remove specific session variable 26 | 27 | SessionManager::clear([string/name]); 28 | 29 | ## Find out how much time is left before the exprire 30 | 31 | SessionManager::timeLeftBeforeExpire(); 32 | 33 | * Don't forget to add *session_start();* in your application. -------------------------------------------------------------------------------- /config/example.config.php: -------------------------------------------------------------------------------- 1 | "admin", "password" => "admin") 14 | ); 15 | 16 | global $IMAGE_SIZES; 17 | $IMAGE_SIZES = array( 18 | (object) array("prefix" => "small_", "height" => 100), 19 | (object) array("prefix" => "small2_", "width" => 100), 20 | (object) array("prefix" => "exact_", "width" => 100, "height" => 100), 21 | (object) array("prefix" => "scale_", "scale" => 30) 22 | ); 23 | 24 | 25 | ?> 26 | -------------------------------------------------------------------------------- /modules/Former/tpl/tinyeditor.html: -------------------------------------------------------------------------------- 1 |
    2 | {error} 3 | 4 |
    5 | 6 |
    7 |
    8 |
    9 | -------------------------------------------------------------------------------- /tpl/resource/index.html: -------------------------------------------------------------------------------- 1 |
    2 |
    3 | 9 |
    10 |
    11 | 15 |
    16 |
    17 | 18 | 19 | {records} 20 |
    21 |
    22 | -------------------------------------------------------------------------------- /modules/Former/plugins/tinymce/themes/advanced/skins/o2k7/ui_silver.css: -------------------------------------------------------------------------------- 1 | /* Silver */ 2 | .o2k7SkinSilver .mceToolbar .mceToolbarStart span, .o2k7SkinSilver .mceButton, .o2k7SkinSilver .mceSplitButton, .o2k7SkinSilver .mceSeparator, .o2k7SkinSilver .mceSplitButton a.mceOpen, .o2k7SkinSilver .mceListBox a.mceOpen {background-image:url(img/button_bg_silver.png)} 3 | .o2k7SkinSilver td.mceToolbar, .o2k7SkinSilver td.mceStatusbar, .o2k7SkinSilver .mceMenuItemTitle a {background:#eee} 4 | .o2k7SkinSilver .mceListBox .mceText {background:#FFF} 5 | .o2k7SkinSilver .mceExternalToolbar, .o2k7SkinSilver .mceListBox .mceText, .o2k7SkinSilver div.mceMenu, .o2k7SkinSilver table.mceLayout, .o2k7SkinSilver .mceMenuItemTitle a, .o2k7SkinSilver table.mceLayout tr.mceFirst td, .o2k7SkinSilver table.mceLayout, .o2k7SkinSilver .mceMenuItemTitle a, .o2k7SkinSilver table.mceLayout tr.mceLast td, .o2k7SkinSilver .mceIframeContainer {border-color: #bbb} 6 | -------------------------------------------------------------------------------- /install.json: -------------------------------------------------------------------------------- 1 | [ 2 | { "path": "http://twitter.github.com/bootstrap/assets/bootstrap.zip", "name": "bootstrap", "installIn": "assets/css" }, 3 | { "path": "http://code.jquery.com/jquery-1.8.2.min.js", "name": "jQuery", "installIn": "assets/js" }, 4 | { "path": "http://underscorejs.org/underscore-min.js", "name": "underscore", "installIn": "assets/js" }, 5 | { 6 | "owner": "krasimir", 7 | "repository": "fabrico", 8 | "branch": "master", 9 | "modules": [ 10 | { "path": "lib/Autoloader" }, 11 | { "path": "lib/ErrorHandler" }, 12 | { "path": "lib/View" }, 13 | { "path": "lib/Router" }, 14 | { "path": "lib/DBAdapters" }, 15 | { "path": "lib/SessionManager" }, 16 | { "path": "lib/Former" } 17 | ] 18 | }, 19 | { 20 | "owner": "mikecao", 21 | "repository": "flight", 22 | "branch": "master", 23 | "modules": [ 24 | { "path": "flight/net", "name": "FlightNet" } 25 | ] 26 | } 27 | ] -------------------------------------------------------------------------------- /controllers/Main.php: -------------------------------------------------------------------------------- 1 | response->write(view("layout.html", array( 7 | "pageTitle" => "Administration", 8 | "content" => view("home/index.html", array( 9 | "resources" => $this->getResourcesMarkup() 10 | )), 11 | "nav" => view("nav.html") 12 | )))->send(); 13 | } 14 | private function getResourcesMarkup() { 15 | $resources = Resources::get(); 16 | $markup = ''; 17 | foreach($resources as $r) { 18 | if(!isset($r->content->parent)) { 19 | $markup .= view("home/resources-link.html", array( 20 | "link" => ADMINUI_URL."resources/".$r->content->name, 21 | "label" => $r->content->title 22 | )); 23 | } 24 | } 25 | return $markup; 26 | } 27 | } 28 | 29 | ?> -------------------------------------------------------------------------------- /assets/css/styles.css: -------------------------------------------------------------------------------- 1 | label { 2 | cursor: default; 3 | } 4 | .clear { 5 | clear: both; 6 | } 7 | .header { 8 | padding: 20px 0 0 0; 9 | } 10 | .header .nav-holder { 11 | padding: 20px 0 0 0; 12 | } 13 | .list tr td img { 14 | max-width: 50px; 15 | max-height: 30px; 16 | } 17 | .list tr .options { 18 | width: 150px; 19 | } 20 | .list tr .options hr { 21 | margin: 5px 0 5px 0; 22 | } 23 | .list tr .options .delete { 24 | color: #B0B0B0; 25 | } 26 | .list-headers { 27 | font-weight: bold; 28 | text-transform: uppercase; 29 | } 30 | 31 | /************************************************* Former customizations */ 32 | .former-element { 33 | border-bottom: dotted 1px #CECECE; 34 | padding: 10px 0 10px 0; 35 | } 36 | .former-element label { 37 | display: block; 38 | width: 180px; 39 | float: left; 40 | } 41 | .former-element .form-element-controls { 42 | display: block; 43 | width: 300px; 44 | float: left; 45 | } 46 | .former-element .error { 47 | padding: 5px 5px 5px 180px; 48 | border-radius: 4px; 49 | background: #FFBABA; 50 | margin: 10px 0 10px 0; 51 | } 52 | .former-element textarea { 53 | height: 300px; 54 | } -------------------------------------------------------------------------------- /modules/Former/plugins/tinymce/themes/advanced/skins/highcontrast/content.css: -------------------------------------------------------------------------------- 1 | body, td, pre { margin:8px;} 2 | body.mceForceColors {background:#FFF; color:#000;} 3 | h1 {font-size: 2em} 4 | h2 {font-size: 1.5em} 5 | h3 {font-size: 1.17em} 6 | h4 {font-size: 1em} 7 | h5 {font-size: .83em} 8 | h6 {font-size: .75em} 9 | .mceItemTable, .mceItemTable td, .mceItemTable th, .mceItemTable caption, .mceItemVisualAid {border: 1px dashed #BBB;} 10 | a.mceItemAnchor {display:inline-block; width:11px !important; height:11px !important; background:url(../default/img/items.gif) no-repeat 0 0;} 11 | span.mceItemNbsp {background: #DDD} 12 | td.mceSelected, th.mceSelected {background-color:#3399ff !important} 13 | img {border:0;} 14 | table, img, hr, .mceItemAnchor {cursor:default} 15 | table td, table th {cursor:text} 16 | ins {border-bottom:1px solid green; text-decoration: none; color:green} 17 | del {color:red; text-decoration:line-through} 18 | cite {border-bottom:1px dashed blue} 19 | acronym {border-bottom:1px dotted #CCC; cursor:help} 20 | abbr {border-bottom:1px dashed #CCC; cursor:help} 21 | 22 | img:-moz-broken {-moz-force-broken-image-icon:1; width:24px; height:24px} 23 | font[face=mceinline] {font-family:inherit !important} 24 | *[contentEditable]:focus {outline:0} 25 | -------------------------------------------------------------------------------- /modules/Former/plugins/tinymce/themes/advanced/anchor.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | {#advanced_dlg.anchor_title} 5 | 6 | 7 | 8 | 9 |
    10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 |
    {#advanced_dlg.anchor_title}
    19 | 20 |
    21 | 22 | 23 |
    24 |
    25 | 26 | 27 | -------------------------------------------------------------------------------- /modules/Former/plugins/tinymce/themes/advanced/source_editor.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | {#advanced_dlg.code_title} 4 | 5 | 6 | 7 | 8 |
    9 |
    10 | 11 |
    12 | 13 |
    14 | 15 |
    16 | 17 | 18 | 19 |
    20 | 21 | 22 |
    23 |
    24 | 25 | 26 | -------------------------------------------------------------------------------- /controllers/helpers/actions/ActionAdd.php: -------------------------------------------------------------------------------- 1 | defineContext(); 8 | $this->defineForm(); 9 | $this->run(); 10 | } 11 | public function run($default = null) { 12 | $this->form->update(array_merge($_POST, $_FILES), $default); 13 | if($this->form->submitted && $this->form->success) { 14 | // Form is submitted 15 | $data = $this->handleFileUploads($this->form->data); 16 | $data = $this->formatData($data); 17 | $this->mysql->{$this->resource->name}->save($data); 18 | header("Location: ".ADMINUI_URL."resources/".$this->resource->name); 19 | die(); 20 | } else { 21 | $this->response->write(view("layout.html", array( 22 | "pageTitle" => $this->resource->title, 23 | "content" => view("resource/add.html", array( 24 | "title" => $this->resource->title, 25 | "name" => $this->resource->name, 26 | "form" => $this->form->markup, 27 | "childs" => $this->getChildResourcesMarkup() 28 | )), 29 | "nav" => view("nav.html") 30 | )))->send(); 31 | } 32 | } 33 | 34 | } 35 | 36 | ?> -------------------------------------------------------------------------------- /index.php: -------------------------------------------------------------------------------- 1 | loadModule( 10 | "ErrorHandler", 11 | "View", 12 | "Router", 13 | "DBAdapters/MySQL", 14 | "SessionManager", 15 | "Former" 16 | ); 17 | $F->loadResource( 18 | "config/config.php", 19 | "controllers/*", 20 | "modules/FlightNet/Response.php" 21 | ); 22 | 23 | // configuration of the template engine and Former 24 | View::$root = dirname(__FILE__)."/tpl/"; 25 | View::$forEachView = array( 26 | "siteURL" => ADMINUI_URL 27 | ); 28 | 29 | // database 30 | $mysql = new MySQLAdapter((object) array( 31 | "host" => HOST, 32 | "user" => USER, 33 | "pass" => PASS, 34 | "dbname" => DBNAME 35 | )); 36 | 37 | // routing 38 | $router = new Router(); 39 | $router 40 | ->register("/logout", "Logout") 41 | ->register("/resources/@name/up/@id", array("RequireLogin", "Resource")) 42 | ->register("/resources/@name/down/@id", array("RequireLogin", "Resource")) 43 | ->register("/resources/@name/delete/@id", array("RequireLogin", "Resource")) 44 | ->register("/resources/@name/edit/@id", array("RequireLogin", "Resource")) 45 | ->register("/resources/@name/add", array("RequireLogin", "Resource")) 46 | ->register("/resources/@name", array("RequireLogin", "Resource")) 47 | ->register("", array("RequireLogin", "Main")) 48 | ->run(); 49 | 50 | ?> -------------------------------------------------------------------------------- /modules/Router/README.md: -------------------------------------------------------------------------------- 1 | # Router 2 | 3 | - - - 4 | 5 | ## Setup and initialization 6 | Copy /htaccess/.htaccess file in your root directory and simply create an instance of Router class. 7 | 8 | $router = new Router(); 9 | 10 | ## Routing 11 | 12 | // register($pattern, $controller, $method = "ALL") 13 | // $method could be any valid request method or 'ALL' 14 | $router->register("/users", "ControllerUsers", "GET")->run(); 15 | 16 | ## Routing with parameter 17 | 18 | $router->register("/users/@id", "ControllerUsers")->run(); 19 | 20 | ## Adding more then one controller for a route (middleware architecture) 21 | 22 | $router->register("/users/@id", array("CheckSession", "ControllerUsers"))->run(); 23 | 24 | ## Example 25 | Request: 26 | 27 | http://fabrico.dev/examples/simpleapp/users/20 28 | 29 | Route: 30 | 31 | $router->register("/users/@id", "ControllerUsers")->run(); 32 | 33 | Controller: 34 | 35 | class ControllerUsers { 36 | public function __construct($params) { 37 | $id = isset($params["id"]) ? $params["id"] : null; 38 | $rule = $params["ROUTER_RULE_MATCH"]; 39 | ... 40 | } 41 | } 42 | 43 | *$params* contains 44 | 45 | - GET parameters 46 | - POST parameters 47 | - variables passed via the url 48 | - *ROUTER_RULE_MATCH* value, which represents the current matched rule 49 | 50 | ## Chaining 51 | 52 | $router 53 | ->register("/users/@id", "ControllerUsers") 54 | ->register("/users", "ControllerUsers") 55 | ->register("", "ControllerHome") 56 | ->run(); -------------------------------------------------------------------------------- /controllers/Resource.php: -------------------------------------------------------------------------------- 1 | matchedRouterRule = $params["ROUTER_RULE_MATCH"]; 14 | $this->resource = Resources::getByName(isset($params["name"]) ? $params["name"] : false)->content; 15 | 16 | switch($this->matchedRouterRule->pattern) { 17 | case "/resources/@name": 18 | new ActionList($this->resource); 19 | break; 20 | case "/resources/@name/add": 21 | new ActionAdd($this->resource); 22 | break; 23 | case "/resources/@name/edit/@id": 24 | new ActionEdit($this->resource, isset($params["id"]) ? $params["id"] : false); 25 | break; 26 | case "/resources/@name/delete/@id": 27 | new ActionDelete($this->resource, isset($params["id"]) ? $params["id"] : false); 28 | break; 29 | case "/resources/@name/up/@id": 30 | new ActionPosition($this->resource, isset($params["id"]) ? $params["id"] : false, "up"); 31 | break; 32 | case "/resources/@name/down/@id": 33 | new ActionPosition($this->resource, isset($params["id"]) ? $params["id"] : false, "down"); 34 | break; 35 | } 36 | 37 | } 38 | } 39 | 40 | ?> -------------------------------------------------------------------------------- /modules/Former/plugins/tinymce/themes/advanced/skins/o2k7/ui_black.css: -------------------------------------------------------------------------------- 1 | /* Black */ 2 | .o2k7SkinBlack .mceToolbar .mceToolbarStart span, .o2k7SkinBlack .mceToolbar .mceToolbarEnd span, .o2k7SkinBlack .mceButton, .o2k7SkinBlack .mceSplitButton, .o2k7SkinBlack .mceSeparator, .o2k7SkinBlack .mceSplitButton a.mceOpen, .o2k7SkinBlack .mceListBox a.mceOpen {background-image:url(img/button_bg_black.png)} 3 | .o2k7SkinBlack td.mceToolbar, .o2k7SkinBlack td.mceStatusbar, .o2k7SkinBlack .mceMenuItemTitle a, .o2k7SkinBlack .mceMenuItemTitle span.mceText, .o2k7SkinBlack .mceStatusbar div, .o2k7SkinBlack .mceStatusbar span, .o2k7SkinBlack .mceStatusbar a {background:#535353; color:#FFF} 4 | .o2k7SkinBlack table.mceListBoxEnabled .mceText, o2k7SkinBlack .mceListBox .mceText {background:#FFF; border:1px solid #CBCFD4; border-bottom-color:#989FA9; border-right:0} 5 | .o2k7SkinBlack table.mceListBoxEnabled:hover .mceText, .o2k7SkinBlack .mceListBoxHover .mceText, .o2k7SkinBlack .mceListBoxSelected .mceText {background:#FFF; border:1px solid #FFBD69; border-right:0} 6 | .o2k7SkinBlack .mceExternalToolbar, .o2k7SkinBlack .mceListBox .mceText, .o2k7SkinBlack div.mceMenu, .o2k7SkinBlack table.mceLayout, .o2k7SkinBlack .mceMenuItemTitle a, .o2k7SkinBlack table.mceLayout tr.mceFirst td, .o2k7SkinBlack table.mceLayout, .o2k7SkinBlack .mceMenuItemTitle a, .o2k7SkinBlack table.mceLayout tr.mceLast td, .o2k7SkinBlack .mceIframeContainer {border-color: #535353;} 7 | .o2k7SkinBlack table.mceSplitButtonEnabled:hover a.mceAction, .o2k7SkinBlack .mceSplitButtonHover a.mceAction, .o2k7SkinBlack .mceSplitButtonSelected {background-image:url(img/button_bg_black.png)} 8 | .o2k7SkinBlack .mceMenu .mceMenuItemEnabled a:hover, .o2k7SkinBlack .mceMenu .mceMenuItemActive {background-color:#FFE7A1} -------------------------------------------------------------------------------- /controllers/RequireLogin.php: -------------------------------------------------------------------------------- 1 | addTextBox(array( 5 | "name" => "username", 6 | "label" => "Username:", 7 | "validation" => Former::validation()->NotEmpty() 8 | )) 9 | ->addPasswordBox(array( 10 | "name" => "password", 11 | "label" => "Password:", 12 | "validation" => Former::validation()->NotEmpty() 13 | )); 14 | 15 | class RequireLogin extends Controller { 16 | 17 | public function __construct($params) { 18 | parent::__construct(); 19 | if(SessionManager::read("admin-ui-user") === false) { 20 | global $USERS; 21 | $form = Former::get("login-form"); 22 | $form->update($_POST); 23 | $errorMessage = ""; 24 | if($form->data->username && $form->data->password) { 25 | foreach ($USERS as $user) { 26 | if($user->username === $form->data->password && $user->password === $form->data->username) { 27 | SessionManager::write("admin-ui-user", $user->username); 28 | return true; 29 | } 30 | } 31 | $errorMessage = view("error.html", array( 32 | "message" => "Wrong credentials" 33 | )); 34 | } 35 | $this->response->write(view("layout.html", array( 36 | "pageTitle" => "Please login first.", 37 | "content" => $errorMessage.$form->markup, 38 | "nav" => "" 39 | )))->send(); 40 | } 41 | } 42 | 43 | } 44 | 45 | ?> -------------------------------------------------------------------------------- /modules/Former/plugins/tinymce/themes/advanced/js/anchor.js: -------------------------------------------------------------------------------- 1 | tinyMCEPopup.requireLangPack(); 2 | 3 | var AnchorDialog = { 4 | init : function(ed) { 5 | var action, elm, f = document.forms[0]; 6 | 7 | this.editor = ed; 8 | elm = ed.dom.getParent(ed.selection.getNode(), 'A'); 9 | v = ed.dom.getAttrib(elm, 'name') || ed.dom.getAttrib(elm, 'id'); 10 | 11 | if (v) { 12 | this.action = 'update'; 13 | f.anchorName.value = v; 14 | } 15 | 16 | f.insert.value = ed.getLang(elm ? 'update' : 'insert'); 17 | }, 18 | 19 | update : function() { 20 | var ed = this.editor, elm, name = document.forms[0].anchorName.value, attribName; 21 | 22 | if (!name || !/^[a-z][a-z0-9\-\_:\.]*$/i.test(name)) { 23 | tinyMCEPopup.alert('advanced_dlg.anchor_invalid'); 24 | return; 25 | } 26 | 27 | tinyMCEPopup.restoreSelection(); 28 | 29 | if (this.action != 'update') 30 | ed.selection.collapse(1); 31 | 32 | var aRule = ed.schema.getElementRule('a'); 33 | if (!aRule || aRule.attributes.name) { 34 | attribName = 'name'; 35 | } else { 36 | attribName = 'id'; 37 | } 38 | 39 | elm = ed.dom.getParent(ed.selection.getNode(), 'A'); 40 | if (elm) { 41 | elm.setAttribute(attribName, name); 42 | elm[attribName] = name; 43 | ed.undoManager.add(); 44 | } else { 45 | // create with zero-sized nbsp so that in Webkit where anchor is on last line by itself caret cannot be placed after it 46 | var attrs = {'class' : 'mceItemAnchor'}; 47 | attrs[attribName] = name; 48 | ed.execCommand('mceInsertContent', 0, ed.dom.createHTML('a', attrs, '\uFEFF')); 49 | ed.nodeChanged(); 50 | } 51 | 52 | tinyMCEPopup.close(); 53 | } 54 | }; 55 | 56 | tinyMCEPopup.onInit.add(AnchorDialog.init, AnchorDialog); 57 | -------------------------------------------------------------------------------- /tpl/layout.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | Micro Administration 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 |
    26 |
    27 |
    28 |

    {pageTitle}

    29 |
    30 | 33 |
    34 |
    35 |
    36 | {content} 37 |
    38 |
    39 | 40 | -------------------------------------------------------------------------------- /modules/Former/plugins/tinymce/themes/advanced/shortcuts.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | {#advanced_dlg.accessibility_help} 5 | 6 | 7 | 8 | 9 |

    {#advanced_dlg.accessibility_usage_title}

    10 |

    Toolbars

    11 |

    Press ALT-F10 to move focus to the toolbars. Navigate through the buttons using the arrow keys. 12 | Press enter to activate a button and return focus to the editor. 13 | Press escape to return focus to the editor without performing any actions.

    14 | 15 |

    Status Bar

    16 |

    To access the editor status bar, press ALT-F11. Use the left and right arrow keys to navigate between elements in the path. 17 | Press enter or space to select an element. Press escape to return focus to the editor without changing the selection.

    18 | 19 |

    Context Menu

    20 |

    Press shift-F10 to activate the context menu. Use the up and down arrow keys to move between menu items. To open sub-menus press the right arrow key. 21 | To close submenus press the left arrow key. Press escape to close the context menu.

    22 | 23 |

    Keyboard Shortcuts

    24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 |
    KeystrokeFunction
    Control-BBold
    Control-IItalic
    Control-ZUndo
    Control-YRedo
    46 | 47 | 48 | -------------------------------------------------------------------------------- /modules/Former/plugins/tinymce/themes/advanced/langs/en_dlg.js: -------------------------------------------------------------------------------- 1 | tinyMCE.addI18n('en.advanced_dlg', {"link_list":"Link List","link_is_external":"The URL you entered seems to be an external link. Do you want to add the required http:// prefix?","link_is_email":"The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?","link_titlefield":"Title","link_target_blank":"Open Link in a New Window","link_target_same":"Open Link in the Same Window","link_target":"Target","link_url":"Link URL","link_title":"Insert/Edit Link","image_align_right":"Right","image_align_left":"Left","image_align_textbottom":"Text Bottom","image_align_texttop":"Text Top","image_align_bottom":"Bottom","image_align_middle":"Middle","image_align_top":"Top","image_align_baseline":"Baseline","image_align":"Alignment","image_hspace":"Horizontal Space","image_vspace":"Vertical Space","image_dimensions":"Dimensions","image_alt":"Image Description","image_list":"Image List","image_border":"Border","image_src":"Image URL","image_title":"Insert/Edit Image","charmap_title":"Select Special Character", "charmap_usage":"Use left and right arrows to navigate.","colorpicker_name":"Name:","colorpicker_color":"Color:","colorpicker_named_title":"Named Colors","colorpicker_named_tab":"Named","colorpicker_palette_title":"Palette Colors","colorpicker_palette_tab":"Palette","colorpicker_picker_title":"Color Picker","colorpicker_picker_tab":"Picker","colorpicker_title":"Select a Color","code_wordwrap":"Word Wrap","code_title":"HTML Source Editor","anchor_name":"Anchor Name","anchor_title":"Insert/Edit Anchor","about_loaded":"Loaded Plugins","about_version":"Version","about_author":"Author","about_plugin":"Plugin","about_plugins":"Plugins","about_license":"License","about_help":"Help","about_general":"About","about_title":"About TinyMCE","anchor_invalid":"Please specify a valid anchor name.","accessibility_help":"Accessibility Help","accessibility_usage_title":"General Usage","invalid_color_value":"Invalid color value","":""}); 2 | -------------------------------------------------------------------------------- /modules/Former/plugins/tinymce/themes/advanced/js/source_editor.js: -------------------------------------------------------------------------------- 1 | tinyMCEPopup.requireLangPack(); 2 | tinyMCEPopup.onInit.add(onLoadInit); 3 | 4 | function saveContent() { 5 | tinyMCEPopup.editor.setContent(document.getElementById('htmlSource').value, {source_view : true}); 6 | tinyMCEPopup.close(); 7 | } 8 | 9 | function onLoadInit() { 10 | tinyMCEPopup.resizeToInnerSize(); 11 | 12 | // Remove Gecko spellchecking 13 | if (tinymce.isGecko) 14 | document.body.spellcheck = tinyMCEPopup.editor.getParam("gecko_spellcheck"); 15 | 16 | document.getElementById('htmlSource').value = tinyMCEPopup.editor.getContent({source_view : true}); 17 | 18 | if (tinyMCEPopup.editor.getParam("theme_advanced_source_editor_wrap", true)) { 19 | turnWrapOn(); 20 | document.getElementById('wraped').checked = true; 21 | } 22 | 23 | resizeInputs(); 24 | } 25 | 26 | function setWrap(val) { 27 | var v, n, s = document.getElementById('htmlSource'); 28 | 29 | s.wrap = val; 30 | 31 | if (!tinymce.isIE) { 32 | v = s.value; 33 | n = s.cloneNode(false); 34 | n.setAttribute("wrap", val); 35 | s.parentNode.replaceChild(n, s); 36 | n.value = v; 37 | } 38 | } 39 | 40 | function setWhiteSpaceCss(value) { 41 | var el = document.getElementById('htmlSource'); 42 | tinymce.DOM.setStyle(el, 'white-space', value); 43 | } 44 | 45 | function turnWrapOff() { 46 | if (tinymce.isWebKit) { 47 | setWhiteSpaceCss('pre'); 48 | } else { 49 | setWrap('off'); 50 | } 51 | } 52 | 53 | function turnWrapOn() { 54 | if (tinymce.isWebKit) { 55 | setWhiteSpaceCss('pre-wrap'); 56 | } else { 57 | setWrap('soft'); 58 | } 59 | } 60 | 61 | function toggleWordWrap(elm) { 62 | if (elm.checked) { 63 | turnWrapOn(); 64 | } else { 65 | turnWrapOff(); 66 | } 67 | } 68 | 69 | function resizeInputs() { 70 | var vp = tinyMCEPopup.dom.getViewPort(window), el; 71 | 72 | el = document.getElementById('htmlSource'); 73 | 74 | if (el) { 75 | el.style.width = (vp.w - 20) + 'px'; 76 | el.style.height = (vp.h - 65) + 'px'; 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /controllers/helpers/actions/ActionEdit.php: -------------------------------------------------------------------------------- 1 | id = $id; 8 | $this->defineContext(); 9 | $this->defineForm(); 10 | $this->run($id); 11 | } 12 | public function run() { 13 | $record = $this->mysql->{$this->resource->name}->where("id=".$this->id)->get(); 14 | $record = $record[0]; 15 | foreach($this->resource->data as $item) { 16 | if($item->presenter == "File" || $item->presenter == "Image") { 17 | $record->{$item->name."_hidden"} = $record->{$item->name}; 18 | } 19 | if($item->presenter == "Check") { 20 | $record->{$item->name} = explode(",", $record->{$item->name}); 21 | } 22 | } 23 | $this->form->update(array_merge($_POST, $_FILES), $record); 24 | if($this->form->submitted && $this->form->success) { 25 | // Form is submitted 26 | $data = $this->handleFileUploads($this->form->data); 27 | $data = $this->formatData($data); 28 | $this->mysql->{$this->resource->name}->save($data); 29 | header("Location: ".ADMINUI_URL."resources/".$this->resource->name); 30 | die(); 31 | } else { 32 | $this->response->write(view("layout.html", array( 33 | "pageTitle" => $this->resource->title, 34 | "content" => view("resource/edit.html", array( 35 | "title" => $this->resource->title, 36 | "name" => $this->resource->name, 37 | "form" => $this->form->markup, 38 | "childs" => $this->getChildResourcesMarkup() 39 | )), 40 | "nav" => view("nav.html") 41 | )))->send(); 42 | } 43 | } 44 | 45 | } 46 | 47 | ?> -------------------------------------------------------------------------------- /modules/SessionManager/index.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /modules/View/index.php: -------------------------------------------------------------------------------- 1 | $file = $content; 15 | } 16 | public static function get($file) { 17 | if(isset(self::$cache->$file)) { 18 | return self::$cache->$file; 19 | } else { 20 | return false; 21 | } 22 | } 23 | 24 | // view logic 25 | public $tplFileContent = NULL; 26 | public $vars = array(); 27 | 28 | public function __construct($path, $data, $root = "") { 29 | if($root != "") { 30 | View::$root = $root; 31 | } 32 | $cache = View::get($path); 33 | if(!$cache) { 34 | $path = View::$root.$path; 35 | $fh = @fopen($path, "r"); 36 | if(!$fh) { 37 | throw new ErrorException("Missing file '".$path."'."); 38 | } 39 | $this->tplFileContent = fread($fh, filesize($path)); 40 | fclose($fh); 41 | View::add($path, $this->tplFileContent); 42 | } else { 43 | $this->tplFileContent = $cache; 44 | } 45 | $this->vars = $data; 46 | } 47 | public function __toString() { 48 | // adding assigned variabls 49 | $output = $this->tplFileContent; 50 | if(isset(View::$forEachView)) { 51 | $this->vars = array_merge($this->vars, View::$forEachView); 52 | } 53 | foreach($this->vars as $key => $value) { 54 | $output = str_replace("{".$key."}", $value, $output); 55 | } 56 | return $output; 57 | } 58 | } 59 | 60 | function view($path, $data = array(), $root = "") { 61 | return new View($path, $data, $root); 62 | } 63 | 64 | ?> -------------------------------------------------------------------------------- /modules/Former/plugins/datepicker/datepicker.css: -------------------------------------------------------------------------------- 1 | .calendar { 2 | font-family: 'Trebuchet MS', Tahoma, Verdana, Arial, sans-serif; 3 | font-size: 0.9em; 4 | background-color: #EEE; 5 | color: #333; 6 | border: 1px solid #DDD; 7 | -moz-border-radius: 4px; 8 | -webkit-border-radius: 4px; 9 | border-radius: 4px; 10 | padding: 0.2em; 11 | width: 14em; 12 | } 13 | 14 | .calendar .months { 15 | background-color: #F6AF3A; 16 | border: 1px solid #E78F08; 17 | -moz-border-radius: 4px; 18 | -webkit-border-radius: 4px; 19 | border-radius: 4px; 20 | color: #FFF; 21 | padding: 0.2em; 22 | text-align: center; 23 | } 24 | 25 | .calendar .prev-month, 26 | .calendar .next-month { 27 | padding: 0; 28 | } 29 | 30 | .calendar .prev-month { 31 | float: left; 32 | } 33 | 34 | .calendar .next-month { 35 | float: right; 36 | } 37 | 38 | .calendar .current-month { 39 | margin: 0 auto; 40 | } 41 | 42 | .calendar .months .prev-month, 43 | .calendar .months .next-month { 44 | color: #FFF; 45 | text-decoration: none; 46 | padding: 0 0.4em; 47 | -moz-border-radius: 4px; 48 | -webkit-border-radius: 4px; 49 | border-radius: 4px; 50 | cursor: pointer; 51 | } 52 | 53 | .calendar .months .prev-month:hover, 54 | .calendar .months .next-month:hover { 55 | background-color: #FDF5CE; 56 | color: #C77405; 57 | } 58 | 59 | .calendar table { 60 | border-collapse: collapse; 61 | padding: 0; 62 | font-size: 0.8em; 63 | width: 100%; 64 | } 65 | 66 | .calendar th { 67 | text-align: center; 68 | } 69 | 70 | .calendar td { 71 | text-align: right; 72 | padding: 1px; 73 | width: 14.3%; 74 | } 75 | 76 | .calendar td span { 77 | display: block; 78 | color: #1C94C4; 79 | background-color: #F6F6F6; 80 | border: 1px solid #CCC; 81 | text-decoration: none; 82 | padding: 0.2em; 83 | cursor: pointer; 84 | } 85 | 86 | .calendar td span:hover { 87 | color: #C77405; 88 | background-color: #FDF5CE; 89 | border: 1px solid #FBCB09; 90 | } 91 | 92 | .calendar td.today span { 93 | background-color: #FFF0A5; 94 | border: 1px solid #FED22F; 95 | color: #363636; 96 | } -------------------------------------------------------------------------------- /controllers/helpers/actions/ActionPosition.php: -------------------------------------------------------------------------------- 1 | id = $id; 8 | $this->defineContext(); 9 | $this->defineForm(); 10 | $this->run($direction); 11 | } 12 | public function run($direction) { 13 | $records = $this->mysql->{$this->resource->name}->order("position")->asc()->get(); 14 | $numOfRecords = count($records); 15 | for($i=0; $i<$numOfRecords; $i++) { 16 | $record = $records[$i]; 17 | if($record->id == $this->id) { 18 | if($direction == "up") { 19 | if($i > 0) { 20 | $tmp = $record->position; 21 | $record->position = $records[$i-1]->position; 22 | $records[$i-1]->position = $tmp; 23 | $this->mysql->{$this->resource->name}->save($records[$i-1]); 24 | $this->mysql->{$this->resource->name}->save($record); 25 | header("Location: ".ADMINUI_URL."resources/".$this->resource->name); 26 | die(); 27 | } 28 | } else { 29 | if($i < $numOfRecords-1) { 30 | $tmp = $record->position; 31 | $record->position = $records[$i+1]->position; 32 | $records[$i+1]->position = $tmp; 33 | $this->mysql->{$this->resource->name}->save($records[$i+1]); 34 | $this->mysql->{$this->resource->name}->save($record); 35 | header("Location: ".ADMINUI_URL."resources/".$this->resource->name); 36 | die(); 37 | } 38 | } 39 | } 40 | } 41 | header("Location: ".ADMINUI_URL."resources/".$this->resource->name); 42 | die(); 43 | } 44 | 45 | } 46 | 47 | ?> -------------------------------------------------------------------------------- /modules/Former/plugins/tinymce/themes/simple/editor_template.js: -------------------------------------------------------------------------------- 1 | (function(){var a=tinymce.DOM;tinymce.ThemeManager.requireLangPack("simple");tinymce.create("tinymce.themes.SimpleTheme",{init:function(c,d){var e=this,b=["Bold","Italic","Underline","Strikethrough","InsertUnorderedList","InsertOrderedList"],f=c.settings;e.editor=c;c.contentCSS.push(d+"/skins/"+f.skin+"/content.css");c.onInit.add(function(){c.onNodeChange.add(function(h,g){tinymce.each(b,function(i){g.get(i.toLowerCase()).setActive(h.queryCommandState(i))})})});a.loadCSS((f.editor_css?c.documentBaseURI.toAbsolute(f.editor_css):"")||d+"/skins/"+f.skin+"/ui.css")},renderUI:function(h){var e=this,i=h.targetNode,b,c,d=e.editor,f=d.controlManager,g;i=a.insertAfter(a.create("span",{id:d.id+"_container","class":"mceEditor "+d.settings.skin+"SimpleSkin"}),i);i=g=a.add(i,"table",{cellPadding:0,cellSpacing:0,"class":"mceLayout"});i=c=a.add(i,"tbody");i=a.add(c,"tr");i=b=a.add(a.add(i,"td"),"div",{"class":"mceIframeContainer"});i=a.add(a.add(c,"tr",{"class":"last"}),"td",{"class":"mceToolbar mceLast",align:"center"});c=e.toolbar=f.createToolbar("tools1");c.add(f.createButton("bold",{title:"simple.bold_desc",cmd:"Bold"}));c.add(f.createButton("italic",{title:"simple.italic_desc",cmd:"Italic"}));c.add(f.createButton("underline",{title:"simple.underline_desc",cmd:"Underline"}));c.add(f.createButton("strikethrough",{title:"simple.striketrough_desc",cmd:"Strikethrough"}));c.add(f.createSeparator());c.add(f.createButton("undo",{title:"simple.undo_desc",cmd:"Undo"}));c.add(f.createButton("redo",{title:"simple.redo_desc",cmd:"Redo"}));c.add(f.createSeparator());c.add(f.createButton("cleanup",{title:"simple.cleanup_desc",cmd:"mceCleanup"}));c.add(f.createSeparator());c.add(f.createButton("insertunorderedlist",{title:"simple.bullist_desc",cmd:"InsertUnorderedList"}));c.add(f.createButton("insertorderedlist",{title:"simple.numlist_desc",cmd:"InsertOrderedList"}));c.renderTo(i);return{iframeContainer:b,editorContainer:d.id+"_container",sizeContainer:g,deltaHeight:-20}},getInfo:function(){return{longname:"Simple theme",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.ThemeManager.add("simple",tinymce.themes.SimpleTheme)})(); -------------------------------------------------------------------------------- /modules/Former/plugins/tinymce/themes/simple/skins/default/ui.css: -------------------------------------------------------------------------------- 1 | /* Reset */ 2 | .defaultSimpleSkin table, .defaultSimpleSkin tbody, .defaultSimpleSkin a, .defaultSimpleSkin img, .defaultSimpleSkin tr, .defaultSimpleSkin div, .defaultSimpleSkin td, .defaultSimpleSkin iframe, .defaultSimpleSkin span, .defaultSimpleSkin * {border:0; margin:0; padding:0; background:transparent; white-space:nowrap; text-decoration:none; font-weight:normal; cursor:default; color:#000} 3 | 4 | /* Containers */ 5 | .defaultSimpleSkin {position:relative} 6 | .defaultSimpleSkin table.mceLayout {background:#F0F0EE; border:1px solid #CCC;} 7 | .defaultSimpleSkin iframe {display:block; background:#FFF; border-bottom:1px solid #CCC;} 8 | .defaultSimpleSkin .mceToolbar {height:24px;} 9 | 10 | /* Layout */ 11 | .defaultSimpleSkin span.mceIcon, .defaultSimpleSkin img.mceIcon {display:block; width:20px; height:20px} 12 | .defaultSimpleSkin .mceIcon {background:url(../../img/icons.gif) no-repeat 20px 20px} 13 | 14 | /* Button */ 15 | .defaultSimpleSkin .mceButton {display:block; border:1px solid #F0F0EE; width:20px; height:20px} 16 | .defaultSimpleSkin a.mceButtonEnabled:hover {border:1px solid #0A246A; background-color:#B2BBD0} 17 | .defaultSimpleSkin a.mceButtonActive {border:1px solid #0A246A; background-color:#C2CBE0} 18 | .defaultSimpleSkin .mceButtonDisabled span {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} 19 | 20 | /* Separator */ 21 | .defaultSimpleSkin .mceSeparator {display:block; background:url(../../img/icons.gif) -180px 0; width:2px; height:20px; margin:0 2px 0 4px} 22 | 23 | /* Theme */ 24 | .defaultSimpleSkin span.mce_bold {background-position:0 0} 25 | .defaultSimpleSkin span.mce_italic {background-position:-60px 0} 26 | .defaultSimpleSkin span.mce_underline {background-position:-140px 0} 27 | .defaultSimpleSkin span.mce_strikethrough {background-position:-120px 0} 28 | .defaultSimpleSkin span.mce_undo {background-position:-160px 0} 29 | .defaultSimpleSkin span.mce_redo {background-position:-100px 0} 30 | .defaultSimpleSkin span.mce_cleanup {background-position:-40px 0} 31 | .defaultSimpleSkin span.mce_insertunorderedlist {background-position:-20px 0} 32 | .defaultSimpleSkin span.mce_insertorderedlist {background-position:-80px 0} 33 | -------------------------------------------------------------------------------- /modules/Autoloader/README.md: -------------------------------------------------------------------------------- 1 | # Loader 2 | 3 | - - - 4 | 5 | Once you include *Autoloader.php* into your page, the loader parses the file structure of your project and creates a cache file. It is good to know that this process run only if there is no cache file or the class/file required by you is not found. 6 | 7 | There are two static methods, which you can use: 8 | 9 | - loadModule - accepts strings, names of the modules. 10 | - loadResource - accepts strings, path to files or group of files 11 | 12 | It searches for files based on the current directory. For example if you have the following file structure: 13 | 14 | site 15 | └ libs 16 | └ modules 17 | └ View 18 | └ index.php 19 | └ logic.php 20 | └ custom 21 | └ config.php 22 | └ logic.php 23 | └ index.php 24 | 25 | And if you type the following code in **index.php** 26 | 27 | global $F; 28 | $F->loadModule("View"); 29 | 30 | Fabrico will start to search for the module **View** in /site/libs/ and all the inner folders. 31 | 32 | Here are fiew examples: 33 | 34 | // requiring Router 35 | $F->loadModule("Router"); 36 | 37 | // requiring more then one module 38 | $F->loadModule("Router", "View", "ErrorHandler", "MyCustomModule"); 39 | 40 | // requiring specific php file 41 | $F->loadResource("libs/configs.php", "external/emailsender.php"); 42 | 43 | // requiring all the php files in a folder and its subfolders 44 | $F->loadResource("libs/*"); 45 | 46 | A valid module is a directory, which matches the name that you pass and contains *index.php*. All the modules should be placed in a subfolder **modules**. For example: 47 | 48 | Valid module with name *View*: 49 | 50 | site 51 | └ libs 52 | └ modules 53 | └ View 54 | └ index.php 55 | └ logic.php 56 | └ assets 57 | └ css 58 | └ js 59 | 60 | Invalid module with name *View*: 61 | 62 | site 63 | └ libs 64 | └ modules 65 | └ View 66 | └ main.php 67 | └ logic.php 68 | └ assets 69 | └ css 70 | └ js 71 | 72 | ### Troubleshooting 73 | 74 | #### Loader can't find new files 75 | Delete the Loader's cache. It is located in the same directory as *Autoloader.php*. -------------------------------------------------------------------------------- /modules/Former/plugins/tinymce/themes/advanced/langs/en.js: -------------------------------------------------------------------------------- 1 | tinyMCE.addI18n('en.advanced',{"underline_desc":"Underline (Ctrl+U)","italic_desc":"Italic (Ctrl+I)","bold_desc":"Bold (Ctrl+B)",dd:"Definition Description",dt:"Definition Term ",samp:"Code Sample",code:"Code",blockquote:"Block Quote",h6:"Heading 6",h5:"Heading 5",h4:"Heading 4",h3:"Heading 3",h2:"Heading 2",h1:"Heading 1",pre:"Preformatted",address:"Address",div:"DIV",paragraph:"Paragraph",block:"Format",fontdefault:"Font Family","font_size":"Font Size","style_select":"Styles","anchor_delta_height":"","anchor_delta_width":"","charmap_delta_height":"","charmap_delta_width":"","colorpicker_delta_height":"","colorpicker_delta_width":"","link_delta_height":"","link_delta_width":"","image_delta_height":"","image_delta_width":"","more_colors":"More Colors...","toolbar_focus":"Jump to tool buttons - Alt+Q, Jump to editor - Alt-Z, Jump to element path - Alt-X",newdocument:"Are you sure you want clear all contents?",path:"Path","clipboard_msg":"Copy/Cut/Paste is not available in Mozilla and Firefox.\nDo you want more information about this issue?","blockquote_desc":"Block Quote","help_desc":"Help","newdocument_desc":"New Document","image_props_desc":"Image Properties","paste_desc":"Paste (Ctrl+V)","copy_desc":"Copy (Ctrl+C)","cut_desc":"Cut (Ctrl+X)","anchor_desc":"Insert/Edit Anchor","visualaid_desc":"show/Hide Guidelines/Invisible Elements","charmap_desc":"Insert Special Character","backcolor_desc":"Select Background Color","forecolor_desc":"Select Text Color","custom1_desc":"Your Custom Description Here","removeformat_desc":"Remove Formatting","hr_desc":"Insert Horizontal Line","sup_desc":"Superscript","sub_desc":"Subscript","code_desc":"Edit HTML Source","cleanup_desc":"Cleanup Messy Code","image_desc":"Insert/Edit Image","unlink_desc":"Unlink","link_desc":"Insert/Edit Link","redo_desc":"Redo (Ctrl+Y)","undo_desc":"Undo (Ctrl+Z)","indent_desc":"Increase Indent","outdent_desc":"Decrease Indent","numlist_desc":"Insert/Remove Numbered List","bullist_desc":"Insert/Remove Bulleted List","justifyfull_desc":"Align Full","justifyright_desc":"Align Right","justifycenter_desc":"Align Center","justifyleft_desc":"Align Left","striketrough_desc":"Strikethrough","help_shortcut":"Press ALT-F10 for toolbar. Press ALT-0 for help","rich_text_area":"Rich Text Area","shortcuts_desc":"Accessability Help",toolbar:"Toolbar"}); -------------------------------------------------------------------------------- /modules/Former/plugins/tinymce/utils/editable_selects.js: -------------------------------------------------------------------------------- 1 | /** 2 | * editable_selects.js 3 | * 4 | * Copyright 2009, Moxiecode Systems AB 5 | * Released under LGPL License. 6 | * 7 | * License: http://tinymce.moxiecode.com/license 8 | * Contributing: http://tinymce.moxiecode.com/contributing 9 | */ 10 | 11 | var TinyMCE_EditableSelects = { 12 | editSelectElm : null, 13 | 14 | init : function() { 15 | var nl = document.getElementsByTagName("select"), i, d = document, o; 16 | 17 | for (i=0; i 2 | 3 | 4 | {#advanced_dlg.charmap_title} 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 17 | 27 | 28 | 29 | 48 | 49 | 50 | 51 | 52 | 53 |
    15 | 16 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 |
     
     
    26 |
    30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 |
     
     
     
    47 |
    {#advanced_dlg.charmap_usage}
    54 | 55 | 56 | -------------------------------------------------------------------------------- /modules/DBAdapters/README.md: -------------------------------------------------------------------------------- 1 | # Adapters 2 | 3 | An ORM like adapter for managing database. The module creates tables and columns automatically, based on your context definition. 4 | 5 | - - - 6 | 7 | ## MySQL 8 | The module uses [PDO](http://php.net/manual/en/book.pdo.php), so you should have it installed in your server. 9 | 10 | ### Initializing 11 | 12 | $mysql = new MySQLAdapter((object) array( 13 | "host" => "localhost", 14 | "user" => "root", 15 | "pass" => "", 16 | "dbname" => "fabrico_mysqladapter_test" 17 | )); 18 | 19 | ### Defining tables/contexts 20 | 21 | $mysql->defineContext("users", array( 22 | "firstName" => "VARCHAR(250)", 23 | "lastName" => "VARCHAR(250)", 24 | "email" => "VARCHAR(100)", 25 | "password" => "INT", 26 | "createdAt" => "DATETIME", 27 | "bio" => "LONGTEXT" 28 | )); 29 | 30 | ### Adding record 31 | 32 | $record = (object) array( 33 | "firstName" => "Krasimir", 34 | "lastName" => "Tsonev", 35 | "email" => "info@krasimirtsonev.com", 36 | "password" => rand(0, 1000000) 37 | ); 38 | $mysql->users->save($record); 39 | 40 | ### Updating record 41 | 42 | $record->lastName = "My-Custom-Last-Name"; 43 | $mysql->users->save($record); 44 | 45 | ### Deleting record 46 | 47 | $mysql->users->trash($record); 48 | 49 | ### Getting records 50 | 51 | $allUsers = $mysql->users->get(); 52 | 53 | ### Getting user with position=2 54 | 55 | $user = $mysql->users->where("position=2")->get(); 56 | 57 | ### Getting user order by password value 58 | 59 | $user = $mysql->users->order("password")->get(); 60 | 61 | ### Getting user order by password value (ascending) 62 | 63 | $user = $mysql->users->order("password")->asc()->get(); 64 | 65 | ### Getting user order by password value (descending) 66 | 67 | $user = $mysql->users->order("password")->desc()->get(); 68 | 69 | ### Executing custom mysql query 70 | 71 | $res = $mysql->action("SELECT * FROM users WHERE id > 30"); 72 | 73 | ### To view all the queries executed 74 | 75 | var_dump($mysql->queries); 76 | 77 | ### Freezing the adapter 78 | The adapter execute some mysql queries in the background to find out what is created and what is not in your database. By setting the *freeze* property to true, you will stop those queries. It will increase the performance of you application, but you will not get the automatically creation of database, tables and columns. 79 | 80 | $mysql->freeze = true; 81 | -------------------------------------------------------------------------------- /modules/Former/plugins/tinymce/themes/advanced/js/about.js: -------------------------------------------------------------------------------- 1 | tinyMCEPopup.requireLangPack(); 2 | 3 | function init() { 4 | var ed, tcont; 5 | 6 | tinyMCEPopup.resizeToInnerSize(); 7 | ed = tinyMCEPopup.editor; 8 | 9 | // Give FF some time 10 | window.setTimeout(insertHelpIFrame, 10); 11 | 12 | tcont = document.getElementById('plugintablecontainer'); 13 | document.getElementById('plugins_tab').style.display = 'none'; 14 | 15 | var html = ""; 16 | html += ''; 17 | html += ''; 18 | html += ''; 19 | html += ''; 20 | html += ''; 21 | html += ''; 22 | html += ''; 23 | html += ''; 24 | html += ''; 25 | 26 | tinymce.each(ed.plugins, function(p, n) { 27 | var info; 28 | 29 | if (!p.getInfo) 30 | return; 31 | 32 | html += ''; 33 | 34 | info = p.getInfo(); 35 | 36 | if (info.infourl != null && info.infourl != '') 37 | html += ''; 38 | else 39 | html += ''; 40 | 41 | if (info.authorurl != null && info.authorurl != '') 42 | html += ''; 43 | else 44 | html += ''; 45 | 46 | html += ''; 47 | html += ''; 48 | 49 | document.getElementById('plugins_tab').style.display = ''; 50 | 51 | }); 52 | 53 | html += ''; 54 | html += '
    ' + ed.getLang('advanced_dlg.about_plugin') + '' + ed.getLang('advanced_dlg.about_author') + '' + ed.getLang('advanced_dlg.about_version') + '
    ' + info.longname + '' + info.longname + '' + info.author + '' + info.author + '' + info.version + '
    '; 55 | 56 | tcont.innerHTML = html; 57 | 58 | tinyMCEPopup.dom.get('version').innerHTML = tinymce.majorVersion + "." + tinymce.minorVersion; 59 | tinyMCEPopup.dom.get('date').innerHTML = tinymce.releaseDate; 60 | } 61 | 62 | function insertHelpIFrame() { 63 | var html; 64 | 65 | if (tinyMCEPopup.getParam('docs_url')) { 66 | html = ''; 67 | document.getElementById('iframecontainer').innerHTML = html; 68 | document.getElementById('help_tab').style.display = 'block'; 69 | document.getElementById('help_tab').setAttribute("aria-hidden", "false"); 70 | } 71 | } 72 | 73 | tinyMCEPopup.onInit.add(init); 74 | -------------------------------------------------------------------------------- /modules/Former/plugins/tinymce/themes/advanced/skins/o2k7/content.css: -------------------------------------------------------------------------------- 1 | body, td, pre {color:#000; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px; margin:8px;} 2 | body {background:#FFF;} 3 | body.mceForceColors {background:#FFF; color:#000;} 4 | h1 {font-size: 2em} 5 | h2 {font-size: 1.5em} 6 | h3 {font-size: 1.17em} 7 | h4 {font-size: 1em} 8 | h5 {font-size: .83em} 9 | h6 {font-size: .75em} 10 | .mceItemTable, .mceItemTable td, .mceItemTable th, .mceItemTable caption, .mceItemVisualAid {border: 1px dashed #BBB;} 11 | a.mceItemAnchor {display:inline-block; width:11px !important; height:11px !important; background:url(../default/img/items.gif) no-repeat 0 0;} 12 | span.mceItemNbsp {background: #DDD} 13 | td.mceSelected, th.mceSelected {background-color:#3399ff !important} 14 | img {border:0;} 15 | table, img, hr, .mceItemAnchor {cursor:default} 16 | table td, table th {cursor:text} 17 | ins {border-bottom:1px solid green; text-decoration: none; color:green} 18 | del {color:red; text-decoration:line-through} 19 | cite {border-bottom:1px dashed blue} 20 | acronym {border-bottom:1px dotted #CCC; cursor:help} 21 | abbr {border-bottom:1px dashed #CCC; cursor:help} 22 | 23 | /* IE */ 24 | * html body { 25 | scrollbar-3dlight-color:#F0F0EE; 26 | scrollbar-arrow-color:#676662; 27 | scrollbar-base-color:#F0F0EE; 28 | scrollbar-darkshadow-color:#DDD; 29 | scrollbar-face-color:#E0E0DD; 30 | scrollbar-highlight-color:#F0F0EE; 31 | scrollbar-shadow-color:#F0F0EE; 32 | scrollbar-track-color:#F5F5F5; 33 | } 34 | 35 | img:-moz-broken {-moz-force-broken-image-icon:1; width:24px; height:24px} 36 | font[face=mceinline] {font-family:inherit !important} 37 | *[contentEditable]:focus {outline:0} 38 | 39 | .mceItemMedia {border:1px dotted #cc0000; background-position:center; background-repeat:no-repeat; background-color:#ffffcc} 40 | .mceItemShockWave {background-image:url(../../img/shockwave.gif)} 41 | .mceItemFlash {background-image:url(../../img/flash.gif)} 42 | .mceItemQuickTime {background-image:url(../../img/quicktime.gif)} 43 | .mceItemWindowsMedia {background-image:url(../../img/windowsmedia.gif)} 44 | .mceItemRealMedia {background-image:url(../../img/realmedia.gif)} 45 | .mceItemVideo {background-image:url(../../img/video.gif)} 46 | .mceItemAudio {background-image:url(../../img/video.gif)} 47 | .mceItemIframe {background-image:url(../../img/iframe.gif)} 48 | .mcePageBreak {display:block;border:0;width:100%;height:12px;border-top:1px dotted #ccc;margin-top:15px;background:#fff url(../../img/pagebreak.gif) no-repeat center top;} 49 | -------------------------------------------------------------------------------- /modules/Former/plugins/tinymce/themes/advanced/link.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | {#advanced_dlg.link_title} 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |
    13 |
    14 | 17 |
    18 | 19 |
    20 |
    21 | 22 | 23 | 24 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 |
    25 | 26 | 27 | 28 | 29 |
     
    48 |
    49 |
    50 | 51 |
    52 | 53 | 54 |
    55 |
    56 | 57 | 58 | -------------------------------------------------------------------------------- /controllers/helpers/Resources.php: -------------------------------------------------------------------------------- 1 | 0) { 16 | $content = file_get_contents(RESOURCE_DIR.$entry); 17 | try { 18 | $content = json_decode($content); 19 | if($content === null) { 20 | throw new Exception("Wrong json format in ".$entry); 21 | } else { 22 | self::$resources []= (object) array( 23 | "file" => $entry, 24 | "content" => $content 25 | ); 26 | } 27 | } catch(Exception $e) { 28 | throw new Exception("Wrong json format in ".$entry); 29 | } 30 | 31 | } 32 | } 33 | closedir($handle); 34 | } 35 | return self::$resources; 36 | } 37 | public static function getByName($name) { 38 | if(isset(self::$cache->$name)) { 39 | return self::$cache->$name; 40 | } 41 | $resources = self::get(); 42 | foreach($resources as $r) { 43 | if($r->content->name == $name) { 44 | if(!self::$cache) self::$cache = (object) array(); 45 | self::$cache->$name = $r; 46 | return $r; 47 | } 48 | } 49 | throw new Exception("Missing resource with name=".$name);die(); 50 | } 51 | public static function getByFilename($file) { 52 | if(isset(self::$cache->$file)) { 53 | return self::$cache->$file; 54 | } 55 | $resources = self::get(); 56 | foreach($resources as $r) { 57 | if($r->file == $file) { 58 | if(!self::$cache) self::$cache = (object) array(); 59 | self::$cache->$file = $r; 60 | return $r; 61 | } 62 | } 63 | throw new Exception("Missing resource with filename=".$file);die(); 64 | } 65 | } 66 | 67 | ?> -------------------------------------------------------------------------------- /modules/Former/plugins/tinymce/themes/advanced/skins/default/content.css: -------------------------------------------------------------------------------- 1 | body, td, pre {color:#000; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px; margin:8px;} 2 | body {background:#FFF;} 3 | body.mceForceColors {background:#FFF; color:#000;} 4 | body.mceBrowserDefaults {background:transparent; color:inherit; font-size:inherit; font-family:inherit;} 5 | h1 {font-size: 2em} 6 | h2 {font-size: 1.5em} 7 | h3 {font-size: 1.17em} 8 | h4 {font-size: 1em} 9 | h5 {font-size: .83em} 10 | h6 {font-size: .75em} 11 | .mceItemTable, .mceItemTable td, .mceItemTable th, .mceItemTable caption, .mceItemVisualAid {border: 1px dashed #BBB;} 12 | a.mceItemAnchor {display:inline-block; -webkit-user-select:all; -webkit-user-modify:read-only; -moz-user-select:all; -moz-user-modify:read-only; width:11px !important; height:11px !important; background:url(img/items.gif) no-repeat center center} 13 | span.mceItemNbsp {background: #DDD} 14 | td.mceSelected, th.mceSelected {background-color:#3399ff !important} 15 | img {border:0;} 16 | table, img, hr, .mceItemAnchor {cursor:default} 17 | table td, table th {cursor:text} 18 | ins {border-bottom:1px solid green; text-decoration: none; color:green} 19 | del {color:red; text-decoration:line-through} 20 | cite {border-bottom:1px dashed blue} 21 | acronym {border-bottom:1px dotted #CCC; cursor:help} 22 | abbr {border-bottom:1px dashed #CCC; cursor:help} 23 | 24 | /* IE */ 25 | * html body { 26 | scrollbar-3dlight-color:#F0F0EE; 27 | scrollbar-arrow-color:#676662; 28 | scrollbar-base-color:#F0F0EE; 29 | scrollbar-darkshadow-color:#DDD; 30 | scrollbar-face-color:#E0E0DD; 31 | scrollbar-highlight-color:#F0F0EE; 32 | scrollbar-shadow-color:#F0F0EE; 33 | scrollbar-track-color:#F5F5F5; 34 | } 35 | 36 | img:-moz-broken {-moz-force-broken-image-icon:1; width:24px; height:24px} 37 | font[face=mceinline] {font-family:inherit !important} 38 | *[contentEditable]:focus {outline:0} 39 | 40 | .mceItemMedia {border:1px dotted #cc0000; background-position:center; background-repeat:no-repeat; background-color:#ffffcc} 41 | .mceItemShockWave {background-image:url(../../img/shockwave.gif)} 42 | .mceItemFlash {background-image:url(../../img/flash.gif)} 43 | .mceItemQuickTime {background-image:url(../../img/quicktime.gif)} 44 | .mceItemWindowsMedia {background-image:url(../../img/windowsmedia.gif)} 45 | .mceItemRealMedia {background-image:url(../../img/realmedia.gif)} 46 | .mceItemVideo {background-image:url(../../img/video.gif)} 47 | .mceItemAudio {background-image:url(../../img/video.gif)} 48 | .mceItemEmbeddedAudio {background-image:url(../../img/video.gif)} 49 | .mceItemIframe {background-image:url(../../img/iframe.gif)} 50 | .mcePageBreak {display:block;border:0;width:100%;height:12px;border-top:1px dotted #ccc;margin-top:15px;background:#fff url(../../img/pagebreak.gif) no-repeat center top;} 51 | -------------------------------------------------------------------------------- /modules/Former/plugins/tinymce/themes/advanced/about.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | {#advanced_dlg.about_title} 5 | 6 | 7 | 8 | 9 | 10 |
    11 | 16 |
    17 | 18 |
    19 |
    20 |

    {#advanced_dlg.about_title}

    21 |

    Version: ()

    22 |

    TinyMCE is a platform independent web based Javascript HTML WYSIWYG editor control released as Open Source under LGPL 23 | by Moxiecode Systems AB. It has the ability to convert HTML TEXTAREA fields or other HTML elements to editor instances.

    24 |

    Copyright © 2003-2008, Moxiecode Systems AB, All rights reserved.

    25 |

    For more information about this software visit the TinyMCE website.

    26 | 27 |
    28 | Got Moxie? 29 |
    30 |
    31 | 32 |
    33 |
    34 |

    {#advanced_dlg.about_loaded}

    35 | 36 |
    37 |
    38 | 39 |

     

    40 |
    41 |
    42 | 43 |
    44 |
    45 |
    46 |
    47 | 48 |
    49 | 50 |
    51 | 52 | 53 | -------------------------------------------------------------------------------- /controllers/helpers/SImpleImage.php: -------------------------------------------------------------------------------- 1 | image_type = $image_info[2]; 32 | if( $this->image_type == IMAGETYPE_JPEG ) { 33 | 34 | $this->image = imagecreatefromjpeg($filename); 35 | } elseif( $this->image_type == IMAGETYPE_GIF ) { 36 | 37 | $this->image = imagecreatefromgif($filename); 38 | } elseif( $this->image_type == IMAGETYPE_PNG ) { 39 | 40 | $this->image = imagecreatefrompng($filename); 41 | } 42 | } 43 | function save($filename, $image_type=IMAGETYPE_JPEG, $compression=75, $permissions=null) { 44 | 45 | if( $image_type == IMAGETYPE_JPEG ) { 46 | imagejpeg($this->image,$filename,$compression); 47 | } elseif( $image_type == IMAGETYPE_GIF ) { 48 | 49 | imagegif($this->image,$filename); 50 | } elseif( $image_type == IMAGETYPE_PNG ) { 51 | 52 | imagepng($this->image,$filename); 53 | } 54 | if( $permissions != null) { 55 | 56 | chmod($filename,$permissions); 57 | } 58 | } 59 | function output($image_type=IMAGETYPE_JPEG) { 60 | 61 | if( $image_type == IMAGETYPE_JPEG ) { 62 | imagejpeg($this->image); 63 | } elseif( $image_type == IMAGETYPE_GIF ) { 64 | 65 | imagegif($this->image); 66 | } elseif( $image_type == IMAGETYPE_PNG ) { 67 | 68 | imagepng($this->image); 69 | } 70 | } 71 | function getWidth() { 72 | 73 | return imagesx($this->image); 74 | } 75 | function getHeight() { 76 | 77 | return imagesy($this->image); 78 | } 79 | function resizeToHeight($height) { 80 | 81 | $ratio = $height / $this->getHeight(); 82 | $width = $this->getWidth() * $ratio; 83 | $this->resize($width,$height); 84 | } 85 | 86 | function resizeToWidth($width) { 87 | $ratio = $width / $this->getWidth(); 88 | $height = $this->getheight() * $ratio; 89 | $this->resize($width,$height); 90 | } 91 | 92 | function scale($scale) { 93 | $width = $this->getWidth() * $scale/100; 94 | $height = $this->getheight() * $scale/100; 95 | $this->resize($width,$height); 96 | } 97 | 98 | function resize($width,$height) { 99 | $new_image = imagecreatetruecolor($width, $height); 100 | imagecopyresampled($new_image, $this->image, 0, 0, 0, 0, $width, $height, $this->getWidth(), $this->getHeight()); 101 | $this->image = $new_image; 102 | } 103 | 104 | } 105 | 106 | ?> -------------------------------------------------------------------------------- /modules/Former/plugins/tinymce/themes/advanced/color_picker.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | {#advanced_dlg.colorpicker_title} 5 | 6 | 7 | 8 | 9 | 10 | 11 |
    12 | 19 | 20 |
    21 |
    22 |
    23 | {#advanced_dlg.colorpicker_picker_title} 24 |
    25 | 26 | 27 |
    28 | 29 |
    30 | 31 |
    32 |
    33 |
    34 |
    35 | 36 |
    37 |
    38 | {#advanced_dlg.colorpicker_palette_title} 39 |
    40 | 41 |
    42 | 43 |
    44 |
    45 |
    46 | 47 |
    48 |
    49 | {#advanced_dlg.colorpicker_named_title} 50 |
    51 | 52 |
    53 | 54 |
    55 | 56 |
    57 | {#advanced_dlg.colorpicker_name} 58 |
    59 |
    60 |
    61 |
    62 | 63 |
    64 | 65 | 66 |
    67 |
    68 |
    69 | 70 | 71 | -------------------------------------------------------------------------------- /modules/Former/plugins/tinymce/themes/advanced/image.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | {#advanced_dlg.image_title} 5 | 6 | 7 | 8 | 9 | 10 | 11 |
    12 |
    13 | 16 |
    17 | 18 |
    19 |
    20 | 21 | 22 | 23 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 51 | 52 | 53 | 54 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 |
    24 | 25 | 26 | 27 | 28 |
     
    55 | x 56 |
    71 |
    72 |
    73 | 74 |
    75 | 76 | 77 |
    78 |
    79 | 80 | 81 | -------------------------------------------------------------------------------- /modules/ErrorHandler/index.php: -------------------------------------------------------------------------------- 1 | getMessage().'\n\r'.' File:'.$e->getFile().' Line:'.$e->getLine().'\n\r'.' Trace: '.$e->getTraceAsString(); 8 | error_log($output); 9 | 10 | // display the error 11 | die(' 12 | 13 | 14 | 15 | {message} 16 | 61 | 62 | 63 |
    64 |

    '.$e->getMessage().'

    65 |

    '.("File: ".$e->getFile()." Line: ".$e->getLine()).'

    66 | 69 |
    70 | 71 | 72 | '); 73 | 74 | } 75 | function shutdown() { 76 | 77 | } 78 | function handleError($errno, $errstr, $errfile, $errline) { 79 | try { 80 | error(new ErrorException($errstr, 0, $errno, $errfile, $errline)); 81 | } catch (Exception $ex) { 82 | // if error logging fails, tray again to log the error during error logging :) 83 | $output = 'message: '.$ex->getMessage().'\n'.'trace: '.$ex->getTraceAsString().'\n'; 84 | error_log($output); 85 | exit(); 86 | } 87 | } 88 | function handleException(Exception $e) { 89 | try { 90 | error($e); 91 | } catch (Exception $ex) { 92 | // if error logging fails, tray again to log the error during error logging :) 93 | $output = 'message: '.$ex->getMessage().'\n'.'trace: '.$ex->getTraceAsString().'\n'; 94 | error_log($output); 95 | 96 | // silently exit 97 | exit(); 98 | } 99 | } 100 | function getFilename($path) { 101 | $parts = explode("/", $path); 102 | $parts = explode(".", array_pop($parts)); 103 | return $parts[0]; 104 | } 105 | 106 | set_error_handler('handleError'); 107 | set_exception_handler('handleException'); 108 | register_shutdown_function('shutdown'); 109 | 110 | error_reporting(E_ALL); 111 | 112 | ?> -------------------------------------------------------------------------------- /modules/Router/index.php: -------------------------------------------------------------------------------- 1 | method = isset($_SERVER['REQUEST_METHOD']) ? $_SERVER['REQUEST_METHOD'] : "GET"; 13 | $this->slug = isset($_GET["slug"]) ? "/".$_GET["slug"] : "/"; 14 | $this->params = array(); 15 | // registering get parameters 16 | $args = parse_url(isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : ""); 17 | if (isset($args['query'])) { 18 | parse_str($args['query'], $this->params); 19 | } 20 | // registering post parameters 21 | $args = isset($_POST) ? $_POST : array(); 22 | foreach($args as $key => $value) { 23 | $this->params[$key] = $value; 24 | } 25 | } 26 | public function register($pattern, $controller, $method = "ALL") { 27 | $methods = explode(",", $method); 28 | foreach($methods as $m) { 29 | $this->rules []= (object) array( 30 | "pattern" => $pattern, 31 | "controller" => $controller, 32 | "method" => $m 33 | ); 34 | } 35 | return $this; 36 | } 37 | public function run() { 38 | $numOfRules = count($this->rules); 39 | for($i=0; $i<$numOfRules; $i++) { 40 | $rule = $this->rules[$i]; 41 | $controller = $rule->controller; 42 | $pattern = $rule->pattern; 43 | if($rule->method == $this->method || $rule->method == "ALL") { 44 | $match = $this->match($pattern, $this->slug, $this->params); 45 | if($match) { 46 | $this->params["ROUTER_RULE_MATCH"] = $rule; 47 | if(is_callable($controller)) { 48 | $controller($this->params); 49 | } else if(is_array($controller)) { 50 | foreach($controller as $controllerItem) { 51 | if(is_callable($controllerItem)) { 52 | $controllerItem($this->params); 53 | } else { 54 | $instance = new $controllerItem($this->params); 55 | } 56 | } 57 | } else { 58 | $instance = new $controller($this->params); 59 | } 60 | return $this; 61 | } 62 | } 63 | } 64 | } 65 | public function match($pattern, $url, &$params) { 66 | $matched = false; 67 | $regex = ""; 68 | $vars = array(); 69 | $patternParts = preg_split("/\//", $pattern); 70 | $numOfParts = count($patternParts); 71 | for($i=0; $i<$numOfParts; $i++) { 72 | $part = $patternParts[$i]; 73 | if(substr($part, 0, 1) == "@") { 74 | $vars []= (object) array( 75 | "index" => $i, 76 | "name" => str_replace("@", "", $part) 77 | ); 78 | $regex .= "[a-zA-Z0-9-_]+"; 79 | } else { 80 | $regex .= $part; 81 | } 82 | $regex .= $i < $numOfParts-1 ? "/" : ""; 83 | } 84 | $pattern = str_replace("/", "\/", $regex); 85 | $result = preg_match("/".$pattern."/", $url); 86 | if($result) { 87 | if(count($vars) > 0) { 88 | $urlParts = preg_split("/\//", $url); 89 | $numOfParts = count($urlParts); 90 | for($i=0; $i<$numOfParts; $i++) { 91 | foreach($vars as $variable) { 92 | if($variable->index == $i) { 93 | $params[$variable->name] = $urlParts[$i]; 94 | } 95 | } 96 | } 97 | } 98 | $matched = true; 99 | } else { 100 | $matched = false; 101 | } 102 | return $matched; 103 | } 104 | } 105 | 106 | ?> -------------------------------------------------------------------------------- /modules/Former/plugins/tinymce/tiny_mce_popup.js: -------------------------------------------------------------------------------- 1 | 2 | // Uncomment and change this document.domain value if you are loading the script cross subdomains 3 | // document.domain = 'moxiecode.com'; 4 | 5 | var tinymce=null,tinyMCEPopup,tinyMCE;tinyMCEPopup={init:function(){var b=this,a,c;a=b.getWin();tinymce=a.tinymce;tinyMCE=a.tinyMCE;b.editor=tinymce.EditorManager.activeEditor;b.params=b.editor.windowManager.params;b.features=b.editor.windowManager.features;b.dom=b.editor.windowManager.createInstance("tinymce.dom.DOMUtils",document,{ownEvents:true,proxy:tinyMCEPopup._eventProxy});b.dom.bind(window,"ready",b._onDOMLoaded,b);if(b.features.popup_css!==false){b.dom.loadCSS(b.features.popup_css||b.editor.settings.popup_css)}b.listeners=[];b.onInit={add:function(e,d){b.listeners.push({func:e,scope:d})}};b.isWindow=!b.getWindowArg("mce_inline");b.id=b.getWindowArg("mce_window_id");b.editor.windowManager.onOpen.dispatch(b.editor.windowManager,window)},getWin:function(){return(!window.frameElement&&window.dialogArguments)||opener||parent||top},getWindowArg:function(c,b){var a=this.params[c];return tinymce.is(a)?a:b},getParam:function(b,a){return this.editor.getParam(b,a)},getLang:function(b,a){return this.editor.getLang(b,a)},execCommand:function(d,c,e,b){b=b||{};b.skip_focus=1;this.restoreSelection();return this.editor.execCommand(d,c,e,b)},resizeToInnerSize:function(){var a=this;setTimeout(function(){var b=a.dom.getViewPort(window);a.editor.windowManager.resizeBy(a.getWindowArg("mce_width")-b.w,a.getWindowArg("mce_height")-b.h,a.id||window)},10)},executeOnLoad:function(s){this.onInit.add(function(){eval(s)})},storeSelection:function(){this.editor.windowManager.bookmark=tinyMCEPopup.editor.selection.getBookmark(1)},restoreSelection:function(){var a=tinyMCEPopup;if(!a.isWindow&&tinymce.isIE){a.editor.selection.moveToBookmark(a.editor.windowManager.bookmark)}},requireLangPack:function(){var b=this,a=b.getWindowArg("plugin_url")||b.getWindowArg("theme_url");if(a&&b.editor.settings.language&&b.features.translate_i18n!==false&&b.editor.settings.language_load!==false){a+="/langs/"+b.editor.settings.language+"_dlg.js";if(!tinymce.ScriptLoader.isDone(a)){document.write(''); 9 | }, 10 | 11 | init : function() { 12 | var f = document.forms[0], ed = tinyMCEPopup.editor; 13 | 14 | // Setup browse button 15 | document.getElementById('hrefbrowsercontainer').innerHTML = getBrowserHTML('hrefbrowser', 'href', 'file', 'theme_advanced_link'); 16 | if (isVisible('hrefbrowser')) 17 | document.getElementById('href').style.width = '180px'; 18 | 19 | this.fillClassList('class_list'); 20 | this.fillFileList('link_list', 'tinyMCELinkList'); 21 | this.fillTargetList('target_list'); 22 | 23 | if (e = ed.dom.getParent(ed.selection.getNode(), 'A')) { 24 | f.href.value = ed.dom.getAttrib(e, 'href'); 25 | f.linktitle.value = ed.dom.getAttrib(e, 'title'); 26 | f.insert.value = ed.getLang('update'); 27 | selectByValue(f, 'link_list', f.href.value); 28 | selectByValue(f, 'target_list', ed.dom.getAttrib(e, 'target')); 29 | selectByValue(f, 'class_list', ed.dom.getAttrib(e, 'class')); 30 | } 31 | }, 32 | 33 | update : function() { 34 | var f = document.forms[0], ed = tinyMCEPopup.editor, e, b, href = f.href.value.replace(/ /g, '%20'); 35 | 36 | tinyMCEPopup.restoreSelection(); 37 | e = ed.dom.getParent(ed.selection.getNode(), 'A'); 38 | 39 | // Remove element if there is no href 40 | if (!f.href.value) { 41 | if (e) { 42 | b = ed.selection.getBookmark(); 43 | ed.dom.remove(e, 1); 44 | ed.selection.moveToBookmark(b); 45 | tinyMCEPopup.execCommand("mceEndUndoLevel"); 46 | tinyMCEPopup.close(); 47 | return; 48 | } 49 | } 50 | 51 | // Create new anchor elements 52 | if (e == null) { 53 | ed.getDoc().execCommand("unlink", false, null); 54 | tinyMCEPopup.execCommand("mceInsertLink", false, "#mce_temp_url#", {skip_undo : 1}); 55 | 56 | tinymce.each(ed.dom.select("a"), function(n) { 57 | if (ed.dom.getAttrib(n, 'href') == '#mce_temp_url#') { 58 | e = n; 59 | 60 | ed.dom.setAttribs(e, { 61 | href : href, 62 | title : f.linktitle.value, 63 | target : f.target_list ? getSelectValue(f, "target_list") : null, 64 | 'class' : f.class_list ? getSelectValue(f, "class_list") : null 65 | }); 66 | } 67 | }); 68 | } else { 69 | ed.dom.setAttribs(e, { 70 | href : href, 71 | title : f.linktitle.value 72 | }); 73 | 74 | if (f.target_list) { 75 | ed.dom.setAttrib(e, 'target', getSelectValue(f, "target_list")); 76 | } 77 | 78 | if (f.class_list) { 79 | ed.dom.setAttrib(e, 'class', getSelectValue(f, "class_list")); 80 | } 81 | } 82 | 83 | // Don't move caret if selection was image 84 | if (e.childNodes.length != 1 || e.firstChild.nodeName != 'IMG') { 85 | ed.focus(); 86 | ed.selection.select(e); 87 | ed.selection.collapse(0); 88 | tinyMCEPopup.storeSelection(); 89 | } 90 | 91 | tinyMCEPopup.execCommand("mceEndUndoLevel"); 92 | tinyMCEPopup.close(); 93 | }, 94 | 95 | checkPrefix : function(n) { 96 | if (n.value && Validator.isEmail(n) && !/^\s*mailto:/i.test(n.value) && confirm(tinyMCEPopup.getLang('advanced_dlg.link_is_email'))) 97 | n.value = 'mailto:' + n.value; 98 | 99 | if (/^\s*www\./i.test(n.value) && confirm(tinyMCEPopup.getLang('advanced_dlg.link_is_external'))) 100 | n.value = 'http://' + n.value; 101 | }, 102 | 103 | fillFileList : function(id, l) { 104 | var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl; 105 | 106 | l = window[l]; 107 | 108 | if (l && l.length > 0) { 109 | lst.options[lst.options.length] = new Option('', ''); 110 | 111 | tinymce.each(l, function(o) { 112 | lst.options[lst.options.length] = new Option(o[0], o[1]); 113 | }); 114 | } else 115 | dom.remove(dom.getParent(id, 'tr')); 116 | }, 117 | 118 | fillClassList : function(id) { 119 | var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl; 120 | 121 | if (v = tinyMCEPopup.getParam('theme_advanced_styles')) { 122 | cl = []; 123 | 124 | tinymce.each(v.split(';'), function(v) { 125 | var p = v.split('='); 126 | 127 | cl.push({'title' : p[0], 'class' : p[1]}); 128 | }); 129 | } else 130 | cl = tinyMCEPopup.editor.dom.getClasses(); 131 | 132 | if (cl.length > 0) { 133 | lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('not_set'), ''); 134 | 135 | tinymce.each(cl, function(o) { 136 | lst.options[lst.options.length] = new Option(o.title || o['class'], o['class']); 137 | }); 138 | } else 139 | dom.remove(dom.getParent(id, 'tr')); 140 | }, 141 | 142 | fillTargetList : function(id) { 143 | var dom = tinyMCEPopup.dom, lst = dom.get(id), v; 144 | 145 | lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('not_set'), ''); 146 | lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('advanced_dlg.link_target_same'), '_self'); 147 | lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('advanced_dlg.link_target_blank'), '_blank'); 148 | 149 | if (v = tinyMCEPopup.getParam('theme_advanced_link_targets')) { 150 | tinymce.each(v.split(','), function(v) { 151 | v = v.split('='); 152 | lst.options[lst.options.length] = new Option(v[0], v[1]); 153 | }); 154 | } 155 | } 156 | }; 157 | 158 | LinkDialog.preInit(); 159 | tinyMCEPopup.onInit.add(LinkDialog.init, LinkDialog); 160 | -------------------------------------------------------------------------------- /modules/FlightNet/Response.php: -------------------------------------------------------------------------------- 1 | 6 | * @license http://www.opensource.org/licenses/mit-license.php 7 | */ 8 | 9 | namespace flight\net; 10 | 11 | /** 12 | * The Response class represents an HTTP response. The object 13 | * contains the response headers, HTTP status code, and response 14 | * body. 15 | */ 16 | class Response { 17 | protected $headers = array(); 18 | protected $status = 200; 19 | protected $body; 20 | 21 | public static $codes = array( 22 | 200 => 'OK', 23 | 201 => 'Created', 24 | 202 => 'Accepted', 25 | 203 => 'Non-Authoritative Information', 26 | 204 => 'No Content', 27 | 205 => 'Reset Content', 28 | 206 => 'Partial Content', 29 | 30 | 300 => 'Multiple Choices', 31 | 301 => 'Moved Permanently', 32 | 302 => 'Found', 33 | 303 => 'See Other', 34 | 304 => 'Not Modified', 35 | 305 => 'Use Proxy', 36 | 307 => 'Temporary Redirect', 37 | 38 | 400 => 'Bad Request', 39 | 401 => 'Unauthorized', 40 | 403 => 'Forbidden', 41 | 404 => 'Not Found', 42 | 405 => 'Method Not Allowed', 43 | 406 => 'Not Acceptable', 44 | 407 => 'Proxy Authentication Required', 45 | 408 => 'Request Timeout', 46 | 409 => 'Conflict', 47 | 410 => 'Gone', 48 | 411 => 'Length Required', 49 | 412 => 'Precondition Failed', 50 | 413 => 'Request Entity Too Large', 51 | 414 => 'Request-URI Too Long', 52 | 415 => 'Unsupported Media Type', 53 | 416 => 'Requested Range Not Satisfiable', 54 | 417 => 'Expectation Failed', 55 | 56 | 500 => 'Internal Server Error', 57 | 501 => 'Not Implemented', 58 | 502 => 'Bad Gateway', 59 | 503 => 'Service Unavailable', 60 | 504 => 'Gateway Timeout', 61 | 505 => 'HTTP Version Not Supported' 62 | ); 63 | 64 | /** 65 | * Sets the HTTP status of the response. 66 | * 67 | * @param int $code HTTP status code. 68 | * @return object Self reference 69 | * @throws \Exception If invalid status code 70 | */ 71 | public function status($code) { 72 | if (array_key_exists($code, self::$codes)) { 73 | if (strpos(php_sapi_name(), 'cgi') !== false) { 74 | header( 75 | sprintf( 76 | 'Status: %d %s', 77 | $code, 78 | self::$codes[$code] 79 | ), 80 | true 81 | ); 82 | } 83 | else { 84 | header( 85 | sprintf( 86 | '%s %d %s', 87 | getenv('SERVER_PROTOCOL') ?: 'HTTP/1.1', 88 | $code, 89 | self::$codes[$code]), 90 | true, 91 | $code 92 | ); 93 | } 94 | } 95 | else { 96 | throw new \Exception('Invalid status code.'); 97 | } 98 | 99 | return $this; 100 | } 101 | 102 | /** 103 | * Adds a header to the response. 104 | * 105 | * @param string|array $name Header name or array of names and values 106 | * @param string $value Header value 107 | * @return object Self reference 108 | */ 109 | public function header($name, $value = null) { 110 | if (is_array($name)) { 111 | foreach ($name as $k => $v) { 112 | $this->headers[$k] = $v; 113 | } 114 | } 115 | else { 116 | $this->headers[$name] = $value; 117 | } 118 | 119 | return $this; 120 | } 121 | 122 | /** 123 | * Writes content to the response body. 124 | * 125 | * @param string $str Response content 126 | * @return object Self reference 127 | */ 128 | public function write($str) { 129 | $this->body .= $str; 130 | 131 | return $this; 132 | } 133 | 134 | /** 135 | * Clears the response. 136 | * 137 | * @return object Self reference 138 | */ 139 | public function clear() { 140 | $this->headers = array(); 141 | $this->status = 200; 142 | $this->body = ''; 143 | 144 | return $this; 145 | } 146 | 147 | /** 148 | * Sets caching headers for the response. 149 | * 150 | * @param int|string $expires Expiration time 151 | * @return object Self reference 152 | */ 153 | public function cache($expires) { 154 | if ($expires === false) { 155 | $this->headers['Expires'] = 'Mon, 26 Jul 1997 05:00:00 GMT'; 156 | $this->headers['Cache-Control'] = array( 157 | 'no-store, no-cache, must-revalidate', 158 | 'post-check=0, pre-check=0', 159 | 'max-age=0' 160 | ); 161 | $this->headers['Pragma'] = 'no-cache'; 162 | } 163 | else { 164 | $expires = is_int($expires) ? $expires : strtotime($expires); 165 | $this->headers['Expires'] = gmdate('D, d M Y H:i:s', $expires) . ' GMT'; 166 | $this->headers['Cache-Control'] = 'max-age='.($expires - time()); 167 | } 168 | 169 | return $this; 170 | } 171 | 172 | /** 173 | * Sends the response and exits the program. 174 | */ 175 | public function send() { 176 | if (ob_get_length() > 0) { 177 | ob_end_clean(); 178 | } 179 | 180 | if (!headers_sent()) { 181 | foreach ($this->headers as $field => $value) { 182 | if (is_array($value)) { 183 | foreach ($value as $v) { 184 | header($field.': '.$v); 185 | } 186 | } 187 | else { 188 | header($field.': '.$value); 189 | } 190 | } 191 | } 192 | 193 | exit($this->body); 194 | } 195 | } 196 | ?> 197 | -------------------------------------------------------------------------------- /modules/Former/plugins/tinymce/themes/advanced/skins/default/dialog.css: -------------------------------------------------------------------------------- 1 | /* Generic */ 2 | body { 3 | font-family:Verdana, Arial, Helvetica, sans-serif; font-size:11px; 4 | scrollbar-3dlight-color:#F0F0EE; 5 | scrollbar-arrow-color:#676662; 6 | scrollbar-base-color:#F0F0EE; 7 | scrollbar-darkshadow-color:#DDDDDD; 8 | scrollbar-face-color:#E0E0DD; 9 | scrollbar-highlight-color:#F0F0EE; 10 | scrollbar-shadow-color:#F0F0EE; 11 | scrollbar-track-color:#F5F5F5; 12 | background:#F0F0EE; 13 | padding:0; 14 | margin:8px 8px 0 8px; 15 | } 16 | 17 | html {background:#F0F0EE;} 18 | td {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;} 19 | textarea {resize:none;outline:none;} 20 | a:link, a:visited {color:black;} 21 | a:hover {color:#2B6FB6;} 22 | .nowrap {white-space: nowrap} 23 | 24 | /* Forms */ 25 | fieldset {margin:0; padding:4px; border:1px solid #919B9C; font-family:Verdana, Arial; font-size:10px;} 26 | legend {color:#2B6FB6; font-weight:bold;} 27 | label.msg {display:none;} 28 | label.invalid {color:#EE0000; display:inline;} 29 | input.invalid {border:1px solid #EE0000;} 30 | input {background:#FFF; border:1px solid #CCC;} 31 | input, select, textarea {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;} 32 | input, select, textarea {border:1px solid #808080;} 33 | input.radio {border:1px none #000000; background:transparent; vertical-align:middle;} 34 | input.checkbox {border:1px none #000000; background:transparent; vertical-align:middle;} 35 | .input_noborder {border:0;} 36 | 37 | /* Buttons */ 38 | #insert, #cancel, input.button, .updateButton { 39 | border:0; margin:0; padding:0; 40 | font-weight:bold; 41 | width:94px; height:26px; 42 | background:url(img/buttons.png) 0 -26px; 43 | cursor:pointer; 44 | padding-bottom:2px; 45 | float:left; 46 | } 47 | 48 | #insert {background:url(img/buttons.png) 0 -52px} 49 | #cancel {background:url(img/buttons.png) 0 0; float:right} 50 | 51 | /* Browse */ 52 | a.pickcolor, a.browse {text-decoration:none} 53 | a.browse span {display:block; width:20px; height:18px; background:url(../../img/icons.gif) -860px 0; border:1px solid #FFF; margin-left:1px;} 54 | .mceOldBoxModel a.browse span {width:22px; height:20px;} 55 | a.browse:hover span {border:1px solid #0A246A; background-color:#B2BBD0;} 56 | a.browse span.disabled {border:1px solid white; opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} 57 | a.browse:hover span.disabled {border:1px solid white; background-color:transparent;} 58 | a.pickcolor span {display:block; width:20px; height:16px; background:url(../../img/icons.gif) -840px 0; margin-left:2px;} 59 | .mceOldBoxModel a.pickcolor span {width:21px; height:17px;} 60 | a.pickcolor:hover span {background-color:#B2BBD0;} 61 | a.pickcolor:hover span.disabled {} 62 | 63 | /* Charmap */ 64 | table.charmap {border:1px solid #AAA; text-align:center} 65 | td.charmap, #charmap a {width:18px; height:18px; color:#000; border:1px solid #AAA; text-align:center; font-size:12px; vertical-align:middle; line-height: 18px;} 66 | #charmap a {display:block; color:#000; text-decoration:none; border:0} 67 | #charmap a:hover {background:#CCC;color:#2B6FB6} 68 | #charmap #codeN {font-size:10px; font-family:Arial,Helvetica,sans-serif; text-align:center} 69 | #charmap #codeV {font-size:40px; height:80px; border:1px solid #AAA; text-align:center} 70 | 71 | /* Source */ 72 | .wordWrapCode {vertical-align:middle; border:1px none #000000; background:transparent;} 73 | .mceActionPanel {margin-top:5px;} 74 | 75 | /* Tabs classes */ 76 | .tabs {width:100%; height:18px; line-height:normal; background:url(img/tabs.gif) repeat-x 0 -72px;} 77 | .tabs ul {margin:0; padding:0; list-style:none;} 78 | .tabs li {float:left; background:url(img/tabs.gif) no-repeat 0 0; margin:0 2px 0 0; padding:0 0 0 10px; line-height:17px; height:18px; display:block;} 79 | .tabs li.current {background:url(img/tabs.gif) no-repeat 0 -18px; margin-right:2px;} 80 | .tabs span {float:left; display:block; background:url(img/tabs.gif) no-repeat right -36px; padding:0px 10px 0 0;} 81 | .tabs .current span {background:url(img/tabs.gif) no-repeat right -54px;} 82 | .tabs a {text-decoration:none; font-family:Verdana, Arial; font-size:10px;} 83 | .tabs a:link, .tabs a:visited, .tabs a:hover {color:black;} 84 | 85 | /* Panels */ 86 | .panel_wrapper div.panel {display:none;} 87 | .panel_wrapper div.current {display:block; width:100%; height:300px; overflow:visible;} 88 | .panel_wrapper {border:1px solid #919B9C; border-top:0px; padding:10px; padding-top:5px; clear:both; background:white;} 89 | 90 | /* Columns */ 91 | .column {float:left;} 92 | .properties {width:100%;} 93 | .properties .column1 {} 94 | .properties .column2 {text-align:left;} 95 | 96 | /* Titles */ 97 | h1, h2, h3, h4 {color:#2B6FB6; margin:0; padding:0; padding-top:5px;} 98 | h3 {font-size:14px;} 99 | .title {font-size:12px; font-weight:bold; color:#2B6FB6;} 100 | 101 | /* Dialog specific */ 102 | #link .panel_wrapper, #link div.current {height:125px;} 103 | #image .panel_wrapper, #image div.current {height:200px;} 104 | #plugintable thead {font-weight:bold; background:#DDD;} 105 | #plugintable, #about #plugintable td {border:1px solid #919B9C;} 106 | #plugintable {width:96%; margin-top:10px;} 107 | #pluginscontainer {height:290px; overflow:auto;} 108 | #colorpicker #preview {display:inline-block; padding-left:40px; height:14px; border:1px solid black; margin-left:5px; margin-right: 5px} 109 | #colorpicker #previewblock {position: relative; top: -3px; padding-left:5px; padding-top: 0px; display:inline} 110 | #colorpicker #preview_wrapper { text-align:center; padding-top:4px; white-space: nowrap} 111 | #colorpicker #colors {float:left; border:1px solid gray; cursor:crosshair;} 112 | #colorpicker #light {border:1px solid gray; margin-left:5px; float:left;width:15px; height:150px; cursor:crosshair;} 113 | #colorpicker #light div {overflow:hidden;} 114 | #colorpicker .panel_wrapper div.current {height:175px;} 115 | #colorpicker #namedcolors {width:150px;} 116 | #colorpicker #namedcolors a {display:block; float:left; width:10px; height:10px; margin:1px 1px 0 0; overflow:hidden;} 117 | #colorpicker #colornamecontainer {margin-top:5px;} 118 | #colorpicker #picker_panel fieldset {margin:auto;width:325px;} 119 | -------------------------------------------------------------------------------- /modules/Former/plugins/tinymce/langs/en.js: -------------------------------------------------------------------------------- 1 | tinyMCE.addI18n({en:{common:{"more_colors":"More Colors...","invalid_data":"Error: Invalid values entered, these are marked in red.","popup_blocked":"Sorry, but we have noticed that your popup-blocker has disabled a window that provides application functionality. You will need to disable popup blocking on this site in order to fully utilize this tool.","clipboard_no_support":"Currently not supported by your browser, use keyboard shortcuts instead.","clipboard_msg":"Copy/Cut/Paste is not available in Mozilla and Firefox.\nDo you want more information about this issue?","not_set":"-- Not Set --","class_name":"Class",browse:"Browse",close:"Close",cancel:"Cancel",update:"Update",insert:"Insert",apply:"Apply","edit_confirm":"Do you want to use the WYSIWYG mode for this textarea?","invalid_data_number":"{#field} must be a number","invalid_data_min":"{#field} must be a number greater than {#min}","invalid_data_size":"{#field} must be a number or percentage",value:"(value)"},contextmenu:{full:"Full",right:"Right",center:"Center",left:"Left",align:"Alignment"},insertdatetime:{"day_short":"Sun,Mon,Tue,Wed,Thu,Fri,Sat,Sun","day_long":"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday,Sunday","months_short":"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec","months_long":"January,February,March,April,May,June,July,August,September,October,November,December","inserttime_desc":"Insert Time","insertdate_desc":"Insert Date","time_fmt":"%H:%M:%S","date_fmt":"%Y-%m-%d"},print:{"print_desc":"Print"},preview:{"preview_desc":"Preview"},directionality:{"rtl_desc":"Direction Right to Left","ltr_desc":"Direction Left to Right"},layer:{content:"New layer...","absolute_desc":"Toggle Absolute Positioning","backward_desc":"Move Backward","forward_desc":"Move Forward","insertlayer_desc":"Insert New Layer"},save:{"save_desc":"Save","cancel_desc":"Cancel All Changes"},nonbreaking:{"nonbreaking_desc":"Insert Non-Breaking Space Character"},iespell:{download:"ieSpell not detected. Do you want to install it now?","iespell_desc":"Check Spelling"},advhr:{"delta_height":"","delta_width":"","advhr_desc":"Insert Horizontal Line"},emotions:{"delta_height":"","delta_width":"","emotions_desc":"Emotions"},searchreplace:{"replace_desc":"Find/Replace","delta_width":"","delta_height":"","search_desc":"Find"},advimage:{"delta_width":"","image_desc":"Insert/Edit Image","delta_height":""},advlink:{"delta_height":"","delta_width":"","link_desc":"Insert/Edit Link"},xhtmlxtras:{"attribs_delta_height":"","attribs_delta_width":"","ins_delta_height":"","ins_delta_width":"","del_delta_height":"","del_delta_width":"","acronym_delta_height":"","acronym_delta_width":"","abbr_delta_height":"","abbr_delta_width":"","cite_delta_height":"","cite_delta_width":"","attribs_desc":"Insert/Edit Attributes","ins_desc":"Insertion","del_desc":"Deletion","acronym_desc":"Acronym","abbr_desc":"Abbreviation","cite_desc":"Citation"},style:{"delta_height":"","delta_width":"",desc:"Edit CSS Style"},paste:{"plaintext_mode_stick":"Paste is now in plain text mode. Click again to toggle back to regular paste mode.","plaintext_mode":"Paste is now in plain text mode. Click again to toggle back to regular paste mode. After you paste something you will be returned to regular paste mode.","selectall_desc":"Select All","paste_word_desc":"Paste from Word","paste_text_desc":"Paste as Plain Text"},"paste_dlg":{"word_title":"Use Ctrl+V on your keyboard to paste the text into the window.","text_linebreaks":"Keep Linebreaks","text_title":"Use Ctrl+V on your keyboard to paste the text into the window."},table:{"merge_cells_delta_height":"","merge_cells_delta_width":"","table_delta_height":"","table_delta_width":"","cellprops_delta_height":"","cellprops_delta_width":"","rowprops_delta_height":"","rowprops_delta_width":"",cell:"Cell",col:"Column",row:"Row",del:"Delete Table","copy_row_desc":"Copy Table Row","cut_row_desc":"Cut Table Row","paste_row_after_desc":"Paste Table Row After","paste_row_before_desc":"Paste Table Row Before","props_desc":"Table Properties","cell_desc":"Table Cell Properties","row_desc":"Table Row Properties","merge_cells_desc":"Merge Table Cells","split_cells_desc":"Split Merged Table Cells","delete_col_desc":"Delete Column","col_after_desc":"Insert Column After","col_before_desc":"Insert Column Before","delete_row_desc":"Delete Row","row_after_desc":"Insert Row After","row_before_desc":"Insert Row Before",desc:"Insert/Edit Table"},autosave:{"warning_message":"If you restore the saved content, you will lose all the content that is currently in the editor.\n\nAre you sure you want to restore the saved content?","restore_content":"Restore auto-saved content.","unload_msg":"The changes you made will be lost if you navigate away from this page."},fullscreen:{desc:"Toggle Full Screen Mode"},media:{"delta_height":"","delta_width":"",edit:"Edit Embedded Media",desc:"Insert/Edit Embedded Media"},fullpage:{desc:"Document Properties","delta_width":"","delta_height":""},template:{desc:"Insert Predefined Template Content"},visualchars:{desc:"Show/Hide Visual Control Characters"},spellchecker:{desc:"Toggle Spell Checker",menu:"Spell Checker Settings","ignore_word":"Ignore Word","ignore_words":"Ignore All",langs:"Languages",wait:"Please wait...",sug:"Suggestions","no_sug":"No Suggestions","no_mpell":"No misspellings found.","learn_word":"Learn word"},pagebreak:{desc:"Insert Page Break for Printing"},advlist:{types:"Types",def:"Default","lower_alpha":"Lower Alpha","lower_greek":"Lower Greek","lower_roman":"Lower Roman","upper_alpha":"Upper Alpha","upper_roman":"Upper Roman",circle:"Circle",disc:"Disc",square:"Square"},colors:{"333300":"Dark olive","993300":"Burnt orange","000000":"Black","003300":"Dark green","003366":"Dark azure","000080":"Navy Blue","333399":"Indigo","333333":"Very dark gray","800000":"Maroon",FF6600:"Orange","808000":"Olive","008000":"Green","008080":"Teal","0000FF":"Blue","666699":"Grayish blue","808080":"Gray",FF0000:"Red",FF9900:"Amber","99CC00":"Yellow green","339966":"Sea green","33CCCC":"Turquoise","3366FF":"Royal blue","800080":"Purple","999999":"Medium gray",FF00FF:"Magenta",FFCC00:"Gold",FFFF00:"Yellow","00FF00":"Lime","00FFFF":"Aqua","00CCFF":"Sky blue","993366":"Brown",C0C0C0:"Silver",FF99CC:"Pink",FFCC99:"Peach",FFFF99:"Light yellow",CCFFCC:"Pale green",CCFFFF:"Pale cyan","99CCFF":"Light sky blue",CC99FF:"Plum",FFFFFF:"White"},aria:{"rich_text_area":"Rich Text Area"},wordcount:{words:"Words:"},visualblocks:{desc:'Show/hide block elements'}}}); -------------------------------------------------------------------------------- /modules/Former/plugins/tinymce/themes/advanced/skins/o2k7/dialog.css: -------------------------------------------------------------------------------- 1 | /* Generic */ 2 | body { 3 | font-family:Verdana, Arial, Helvetica, sans-serif; font-size:11px; 4 | scrollbar-3dlight-color:#F0F0EE; 5 | scrollbar-arrow-color:#676662; 6 | scrollbar-base-color:#F0F0EE; 7 | scrollbar-darkshadow-color:#DDDDDD; 8 | scrollbar-face-color:#E0E0DD; 9 | scrollbar-highlight-color:#F0F0EE; 10 | scrollbar-shadow-color:#F0F0EE; 11 | scrollbar-track-color:#F5F5F5; 12 | background:#F0F0EE; 13 | padding:0; 14 | margin:8px 8px 0 8px; 15 | } 16 | 17 | html {background:#F0F0EE;} 18 | td {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;} 19 | textarea {resize:none;outline:none;} 20 | a:link, a:visited {color:black;} 21 | a:hover {color:#2B6FB6;} 22 | .nowrap {white-space: nowrap} 23 | 24 | /* Forms */ 25 | fieldset {margin:0; padding:4px; border:1px solid #919B9C; font-family:Verdana, Arial; font-size:10px;} 26 | legend {color:#2B6FB6; font-weight:bold;} 27 | label.msg {display:none;} 28 | label.invalid {color:#EE0000; display:inline;} 29 | input.invalid {border:1px solid #EE0000;} 30 | input {background:#FFF; border:1px solid #CCC;} 31 | input, select, textarea {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;} 32 | input, select, textarea {border:1px solid #808080;} 33 | input.radio {border:1px none #000000; background:transparent; vertical-align:middle;} 34 | input.checkbox {border:1px none #000000; background:transparent; vertical-align:middle;} 35 | .input_noborder {border:0;} 36 | 37 | /* Buttons */ 38 | #insert, #cancel, input.button, .updateButton { 39 | border:0; margin:0; padding:0; 40 | font-weight:bold; 41 | width:94px; height:26px; 42 | background:url(../default/img/buttons.png) 0 -26px; 43 | cursor:pointer; 44 | padding-bottom:2px; 45 | float:left; 46 | } 47 | 48 | #insert {background:url(../default/img/buttons.png) 0 -52px} 49 | #cancel {background:url(../default/img/buttons.png) 0 0; float:right} 50 | 51 | /* Browse */ 52 | a.pickcolor, a.browse {text-decoration:none} 53 | a.browse span {display:block; width:20px; height:18px; background:url(../../img/icons.gif) -860px 0; border:1px solid #FFF; margin-left:1px;} 54 | .mceOldBoxModel a.browse span {width:22px; height:20px;} 55 | a.browse:hover span {border:1px solid #0A246A; background-color:#B2BBD0;} 56 | a.browse span.disabled {border:1px solid white; opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} 57 | a.browse:hover span.disabled {border:1px solid white; background-color:transparent;} 58 | a.pickcolor span {display:block; width:20px; height:16px; background:url(../../img/icons.gif) -840px 0; margin-left:2px;} 59 | .mceOldBoxModel a.pickcolor span {width:21px; height:17px;} 60 | a.pickcolor:hover span {background-color:#B2BBD0;} 61 | a.pickcolor:hover span.disabled {} 62 | 63 | /* Charmap */ 64 | table.charmap {border:1px solid #AAA; text-align:center} 65 | td.charmap, #charmap a {width:18px; height:18px; color:#000; border:1px solid #AAA; text-align:center; font-size:12px; vertical-align:middle; line-height: 18px;} 66 | #charmap a {display:block; color:#000; text-decoration:none; border:0} 67 | #charmap a:hover {background:#CCC;color:#2B6FB6} 68 | #charmap #codeN {font-size:10px; font-family:Arial,Helvetica,sans-serif; text-align:center} 69 | #charmap #codeV {font-size:40px; height:80px; border:1px solid #AAA; text-align:center} 70 | 71 | /* Source */ 72 | .wordWrapCode {vertical-align:middle; border:1px none #000000; background:transparent;} 73 | .mceActionPanel {margin-top:5px;} 74 | 75 | /* Tabs classes */ 76 | .tabs {width:100%; height:18px; line-height:normal; background:url(../default/img/tabs.gif) repeat-x 0 -72px;} 77 | .tabs ul {margin:0; padding:0; list-style:none;} 78 | .tabs li {float:left; background:url(../default/img/tabs.gif) no-repeat 0 0; margin:0 2px 0 0; padding:0 0 0 10px; line-height:17px; height:18px; display:block;} 79 | .tabs li.current {background:url(../default/img/tabs.gif) no-repeat 0 -18px; margin-right:2px;} 80 | .tabs span {float:left; display:block; background:url(../default/img/tabs.gif) no-repeat right -36px; padding:0px 10px 0 0;} 81 | .tabs .current span {background:url(../default/img/tabs.gif) no-repeat right -54px;} 82 | .tabs a {text-decoration:none; font-family:Verdana, Arial; font-size:10px;} 83 | .tabs a:link, .tabs a:visited, .tabs a:hover {color:black;} 84 | 85 | /* Panels */ 86 | .panel_wrapper div.panel {display:none;} 87 | .panel_wrapper div.current {display:block; width:100%; height:300px; overflow:visible;} 88 | .panel_wrapper {border:1px solid #919B9C; border-top:0px; padding:10px; padding-top:5px; clear:both; background:white;} 89 | 90 | /* Columns */ 91 | .column {float:left;} 92 | .properties {width:100%;} 93 | .properties .column1 {} 94 | .properties .column2 {text-align:left;} 95 | 96 | /* Titles */ 97 | h1, h2, h3, h4 {color:#2B6FB6; margin:0; padding:0; padding-top:5px;} 98 | h3 {font-size:14px;} 99 | .title {font-size:12px; font-weight:bold; color:#2B6FB6;} 100 | 101 | /* Dialog specific */ 102 | #link .panel_wrapper, #link div.current {height:125px;} 103 | #image .panel_wrapper, #image div.current {height:200px;} 104 | #plugintable thead {font-weight:bold; background:#DDD;} 105 | #plugintable, #about #plugintable td {border:1px solid #919B9C;} 106 | #plugintable {width:96%; margin-top:10px;} 107 | #pluginscontainer {height:290px; overflow:auto;} 108 | #colorpicker #preview {display:inline-block; padding-left:40px; height:14px; border:1px solid black; margin-left:5px; margin-right: 5px} 109 | #colorpicker #previewblock {position: relative; top: -3px; padding-left:5px; padding-top: 0px; display:inline} 110 | #colorpicker #preview_wrapper { text-align:center; padding-top:4px; white-space: nowrap} 111 | #colorpicker #colors {float:left; border:1px solid gray; cursor:crosshair;} 112 | #colorpicker #light {border:1px solid gray; margin-left:5px; float:left;width:15px; height:150px; cursor:crosshair;} 113 | #colorpicker #light div {overflow:hidden;} 114 | #colorpicker .panel_wrapper div.current {height:175px;} 115 | #colorpicker #namedcolors {width:150px;} 116 | #colorpicker #namedcolors a {display:block; float:left; width:10px; height:10px; margin:1px 1px 0 0; overflow:hidden;} 117 | #colorpicker #colornamecontainer {margin-top:5px;} 118 | #colorpicker #picker_panel fieldset {margin:auto;width:325px;} 119 | -------------------------------------------------------------------------------- /modules/Former/plugins/tinymce/utils/form_utils.js: -------------------------------------------------------------------------------- 1 | /** 2 | * form_utils.js 3 | * 4 | * Copyright 2009, Moxiecode Systems AB 5 | * Released under LGPL License. 6 | * 7 | * License: http://tinymce.moxiecode.com/license 8 | * Contributing: http://tinymce.moxiecode.com/contributing 9 | */ 10 | 11 | var themeBaseURL = tinyMCEPopup.editor.baseURI.toAbsolute('themes/' + tinyMCEPopup.getParam("theme")); 12 | 13 | function getColorPickerHTML(id, target_form_element) { 14 | var h = "", dom = tinyMCEPopup.dom; 15 | 16 | if (label = dom.select('label[for=' + target_form_element + ']')[0]) { 17 | label.id = label.id || dom.uniqueId(); 18 | } 19 | 20 | h += ''; 21 | h += ' '; 22 | 23 | return h; 24 | } 25 | 26 | function updateColor(img_id, form_element_id) { 27 | document.getElementById(img_id).style.backgroundColor = document.forms[0].elements[form_element_id].value; 28 | } 29 | 30 | function setBrowserDisabled(id, state) { 31 | var img = document.getElementById(id); 32 | var lnk = document.getElementById(id + "_link"); 33 | 34 | if (lnk) { 35 | if (state) { 36 | lnk.setAttribute("realhref", lnk.getAttribute("href")); 37 | lnk.removeAttribute("href"); 38 | tinyMCEPopup.dom.addClass(img, 'disabled'); 39 | } else { 40 | if (lnk.getAttribute("realhref")) 41 | lnk.setAttribute("href", lnk.getAttribute("realhref")); 42 | 43 | tinyMCEPopup.dom.removeClass(img, 'disabled'); 44 | } 45 | } 46 | } 47 | 48 | function getBrowserHTML(id, target_form_element, type, prefix) { 49 | var option = prefix + "_" + type + "_browser_callback", cb, html; 50 | 51 | cb = tinyMCEPopup.getParam(option, tinyMCEPopup.getParam("file_browser_callback")); 52 | 53 | if (!cb) 54 | return ""; 55 | 56 | html = ""; 57 | html += ''; 58 | html += ' '; 59 | 60 | return html; 61 | } 62 | 63 | function openBrowser(img_id, target_form_element, type, option) { 64 | var img = document.getElementById(img_id); 65 | 66 | if (img.className != "mceButtonDisabled") 67 | tinyMCEPopup.openBrowser(target_form_element, type, option); 68 | } 69 | 70 | function selectByValue(form_obj, field_name, value, add_custom, ignore_case) { 71 | if (!form_obj || !form_obj.elements[field_name]) 72 | return; 73 | 74 | if (!value) 75 | value = ""; 76 | 77 | var sel = form_obj.elements[field_name]; 78 | 79 | var found = false; 80 | for (var i=0; iloaded = (object) array(); 16 | $this->rootPath = $this->getPath(2); 17 | if(!file_exists(dirname(__FILE__)."/".FABRICO_LOADER_CACHE_FILE)) { 18 | $this->updateCache(); 19 | } 20 | require(dirname(__FILE__)."/".FABRICO_LOADER_CACHE_FILE); 21 | } 22 | public function loaded() { 23 | return $this->loaded; 24 | } 25 | public function loadModule() { 26 | $this->currentPath = $this->getPath(); 27 | if(func_num_args() === 0) throw new Exception ("Invalid arguments of 'loadModule' method."); 28 | $modules = func_get_args(); 29 | foreach($modules as $module) { 30 | if(!$this->load(str_replace($this->rootPath, "", $this->currentPath).FABRICO_MODULES_DIR."/".$module."/index.php")) { 31 | throw new Exception ("Missing module '".$module."'."); 32 | } 33 | } 34 | return $this; 35 | } 36 | public function loadResource() { 37 | $this->currentPath = $this->getPath(); 38 | if(func_num_args() === 0) throw new Exception ("Invalid arguments of 'loadResource' method."); 39 | $resources = func_get_args(); 40 | foreach($resources as $resource) { 41 | if(!$this->load(str_replace($this->rootPath, "", $this->currentPath).$resource)) { 42 | throw new Exception ("Missing resource '".$resource."'."); 43 | } 44 | } 45 | return $this; 46 | } 47 | private function load($resource) { 48 | $success = true; 49 | if(!isset($this->loaded->{$this->rootPath.$resource})) { 50 | if(!$this->resolvePath($resource)) { 51 | $this->updateCache(); 52 | if(!$this->resolvePath($resource)) { 53 | $success = false; 54 | } 55 | } 56 | } 57 | return $success; 58 | } 59 | private function getPath($level = 1) { 60 | $trace = debug_backtrace(); 61 | if(isset($trace[$level])) { 62 | return dirname($trace[$level]["file"])."/"; 63 | } else { 64 | return dirname($_SERVER["SCRIPT_FILENAME"])."/"; 65 | } 66 | } 67 | private function resolvePath($path, $tree = null, $originalPath = "") { 68 | global $FABRICO_TREE; 69 | if(is_string($path)) { 70 | $path = substr($path, 0, 1) === "/" ? substr($path, 1, strlen($path)) : $path; 71 | $path = substr($path, 0, 2) === "./" ? substr($path, 2, strlen($path)) : $path; 72 | $originalPath = $path; 73 | $path = explode("/", $path); 74 | } 75 | if($tree === null) { 76 | $tree = $FABRICO_TREE->files; 77 | } 78 | $entry = array_shift($path); 79 | if(isset($tree->$entry)) { 80 | if(is_string($tree->$entry) && $tree->$entry === "file") { 81 | $this->requireResource($originalPath); 82 | return true; 83 | } else { 84 | return $this->resolvePath($path, $tree->$entry, $originalPath); 85 | } 86 | } else if($entry === "*") { 87 | foreach($tree as $key => $value) { 88 | if(is_string($value) && $value === "file") { 89 | $file = str_replace("/*", "/", $originalPath).$key; 90 | $this->requireResource($file); 91 | } else { 92 | $this->resolvePath(str_replace("/*", "/".$key."/*", $originalPath)); 93 | } 94 | } 95 | return true; 96 | } else { 97 | return false; 98 | } 99 | } 100 | private function requireResource($file) { 101 | $this->loaded->{$this->rootPath.$file} = true; 102 | require($this->rootPath.$file); 103 | } 104 | public function updateCache() { 105 | global $FABRICO_TREE; 106 | $files = (object) array(); 107 | $this->readDir($this->rootPath, $files); 108 | $FABRICO_TREE = (object) array( 109 | "files" => $files 110 | ); 111 | $content = ''; 115 | file_put_contents(dirname(__FILE__)."/".FABRICO_LOADER_CACHE_FILE, $content); 116 | chmod(dirname(__FILE__)."/".FABRICO_LOADER_CACHE_FILE, 0777); 117 | } 118 | private function readDir($dir, $obj) { 119 | if ($handle = @opendir($dir)) { 120 | $entries = array(); 121 | while (false !== ($entry = readdir($handle))) { 122 | if ($entry != "." && $entry != "..") { 123 | $entries []= $entry; 124 | } 125 | } 126 | sort($entries); 127 | foreach ($entries as $entry) { 128 | if(is_dir($dir."/".$entry)) { 129 | $dirPath = str_replace($this->rootPath, "", $dir."/".$entry); 130 | $this->readDir($dir."/".$entry, $obj->$entry = (object) array()); 131 | } else if(is_file($dir."/".$entry)) { 132 | if(strpos($entry, ".php") !== FALSE) { 133 | $obj->$entry = "file"; 134 | } 135 | } 136 | } 137 | closedir($handle); 138 | } 139 | return $obj; 140 | } 141 | } 142 | 143 | global $F; 144 | $F = new FabricoLoader(); 145 | 146 | function fabricoAutoload($class) { 147 | global $F; 148 | $F->updateCache(); 149 | $F->loadResource($class); 150 | } 151 | spl_autoload_register('fabricoAutoload'); 152 | 153 | } 154 | 155 | ?> -------------------------------------------------------------------------------- /modules/Former/plugins/tinymce/utils/validate.js: -------------------------------------------------------------------------------- 1 | /** 2 | * validate.js 3 | * 4 | * Copyright 2009, Moxiecode Systems AB 5 | * Released under LGPL License. 6 | * 7 | * License: http://tinymce.moxiecode.com/license 8 | * Contributing: http://tinymce.moxiecode.com/contributing 9 | */ 10 | 11 | /** 12 | // String validation: 13 | 14 | if (!Validator.isEmail('myemail')) 15 | alert('Invalid email.'); 16 | 17 | // Form validation: 18 | 19 | var f = document.forms['myform']; 20 | 21 | if (!Validator.isEmail(f.myemail)) 22 | alert('Invalid email.'); 23 | */ 24 | 25 | var Validator = { 26 | isEmail : function(s) { 27 | return this.test(s, '^[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+@[-!#$%&\'*+\\/0-9=?A-Z^_`a-z{|}~]+\.[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+$'); 28 | }, 29 | 30 | isAbsUrl : function(s) { 31 | return this.test(s, '^(news|telnet|nttp|file|http|ftp|https)://[-A-Za-z0-9\\.]+\\/?.*$'); 32 | }, 33 | 34 | isSize : function(s) { 35 | return this.test(s, '^[0-9.]+(%|in|cm|mm|em|ex|pt|pc|px)?$'); 36 | }, 37 | 38 | isId : function(s) { 39 | return this.test(s, '^[A-Za-z_]([A-Za-z0-9_])*$'); 40 | }, 41 | 42 | isEmpty : function(s) { 43 | var nl, i; 44 | 45 | if (s.nodeName == 'SELECT' && s.selectedIndex < 1) 46 | return true; 47 | 48 | if (s.type == 'checkbox' && !s.checked) 49 | return true; 50 | 51 | if (s.type == 'radio') { 52 | for (i=0, nl = s.form.elements; i parseInt(v)) 199 | st = this.mark(f, n); 200 | } 201 | } 202 | 203 | return st; 204 | }, 205 | 206 | hasClass : function(n, c, d) { 207 | return new RegExp('\\b' + c + (d ? '[0-9]+' : '') + '\\b', 'g').test(n.className); 208 | }, 209 | 210 | getNum : function(n, c) { 211 | c = n.className.match(new RegExp('\\b' + c + '([0-9]+)\\b', 'g'))[0]; 212 | c = c.replace(/[^0-9]/g, ''); 213 | 214 | return c; 215 | }, 216 | 217 | addClass : function(n, c, b) { 218 | var o = this.removeClass(n, c); 219 | n.className = b ? c + (o != '' ? (' ' + o) : '') : (o != '' ? (o + ' ') : '') + c; 220 | }, 221 | 222 | removeClass : function(n, c) { 223 | c = n.className.replace(new RegExp("(^|\\s+)" + c + "(\\s+|$)"), ' '); 224 | return n.className = c != ' ' ? c : ''; 225 | }, 226 | 227 | tags : function(f, s) { 228 | return f.getElementsByTagName(s); 229 | }, 230 | 231 | mark : function(f, n) { 232 | var s = this.settings; 233 | 234 | this.addClass(n, s.invalid_cls); 235 | n.setAttribute('aria-invalid', 'true'); 236 | this.markLabels(f, n, s.invalid_cls); 237 | 238 | return false; 239 | }, 240 | 241 | markLabels : function(f, n, ic) { 242 | var nl, i; 243 | 244 | nl = this.tags(f, "label"); 245 | for (i=0; i'); 9 | }, 10 | 11 | init : function() { 12 | var f = document.forms[0], ed = tinyMCEPopup.editor; 13 | 14 | // Setup browse button 15 | document.getElementById('srcbrowsercontainer').innerHTML = getBrowserHTML('srcbrowser','src','image','theme_advanced_image'); 16 | if (isVisible('srcbrowser')) 17 | document.getElementById('src').style.width = '180px'; 18 | 19 | e = ed.selection.getNode(); 20 | 21 | this.fillFileList('image_list', tinyMCEPopup.getParam('external_image_list', 'tinyMCEImageList')); 22 | 23 | if (e.nodeName == 'IMG') { 24 | f.src.value = ed.dom.getAttrib(e, 'src'); 25 | f.alt.value = ed.dom.getAttrib(e, 'alt'); 26 | f.border.value = this.getAttrib(e, 'border'); 27 | f.vspace.value = this.getAttrib(e, 'vspace'); 28 | f.hspace.value = this.getAttrib(e, 'hspace'); 29 | f.width.value = ed.dom.getAttrib(e, 'width'); 30 | f.height.value = ed.dom.getAttrib(e, 'height'); 31 | f.insert.value = ed.getLang('update'); 32 | this.styleVal = ed.dom.getAttrib(e, 'style'); 33 | selectByValue(f, 'image_list', f.src.value); 34 | selectByValue(f, 'align', this.getAttrib(e, 'align')); 35 | this.updateStyle(); 36 | } 37 | }, 38 | 39 | fillFileList : function(id, l) { 40 | var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl; 41 | 42 | l = typeof(l) === 'function' ? l() : window[l]; 43 | 44 | if (l && l.length > 0) { 45 | lst.options[lst.options.length] = new Option('', ''); 46 | 47 | tinymce.each(l, function(o) { 48 | lst.options[lst.options.length] = new Option(o[0], o[1]); 49 | }); 50 | } else 51 | dom.remove(dom.getParent(id, 'tr')); 52 | }, 53 | 54 | update : function() { 55 | var f = document.forms[0], nl = f.elements, ed = tinyMCEPopup.editor, args = {}, el; 56 | 57 | tinyMCEPopup.restoreSelection(); 58 | 59 | if (f.src.value === '') { 60 | if (ed.selection.getNode().nodeName == 'IMG') { 61 | ed.dom.remove(ed.selection.getNode()); 62 | ed.execCommand('mceRepaint'); 63 | } 64 | 65 | tinyMCEPopup.close(); 66 | return; 67 | } 68 | 69 | if (!ed.settings.inline_styles) { 70 | args = tinymce.extend(args, { 71 | vspace : nl.vspace.value, 72 | hspace : nl.hspace.value, 73 | border : nl.border.value, 74 | align : getSelectValue(f, 'align') 75 | }); 76 | } else 77 | args.style = this.styleVal; 78 | 79 | tinymce.extend(args, { 80 | src : f.src.value.replace(/ /g, '%20'), 81 | alt : f.alt.value, 82 | width : f.width.value, 83 | height : f.height.value 84 | }); 85 | 86 | el = ed.selection.getNode(); 87 | 88 | if (el && el.nodeName == 'IMG') { 89 | ed.dom.setAttribs(el, args); 90 | tinyMCEPopup.editor.execCommand('mceRepaint'); 91 | tinyMCEPopup.editor.focus(); 92 | } else { 93 | tinymce.each(args, function(value, name) { 94 | if (value === "") { 95 | delete args[name]; 96 | } 97 | }); 98 | 99 | ed.execCommand('mceInsertContent', false, tinyMCEPopup.editor.dom.createHTML('img', args), {skip_undo : 1}); 100 | ed.undoManager.add(); 101 | } 102 | 103 | tinyMCEPopup.close(); 104 | }, 105 | 106 | updateStyle : function() { 107 | var dom = tinyMCEPopup.dom, st = {}, v, f = document.forms[0]; 108 | 109 | if (tinyMCEPopup.editor.settings.inline_styles) { 110 | tinymce.each(tinyMCEPopup.dom.parseStyle(this.styleVal), function(value, key) { 111 | st[key] = value; 112 | }); 113 | 114 | // Handle align 115 | v = getSelectValue(f, 'align'); 116 | if (v) { 117 | if (v == 'left' || v == 'right') { 118 | st['float'] = v; 119 | delete st['vertical-align']; 120 | } else { 121 | st['vertical-align'] = v; 122 | delete st['float']; 123 | } 124 | } else { 125 | delete st['float']; 126 | delete st['vertical-align']; 127 | } 128 | 129 | // Handle border 130 | v = f.border.value; 131 | if (v || v == '0') { 132 | if (v == '0') 133 | st['border'] = '0'; 134 | else 135 | st['border'] = v + 'px solid black'; 136 | } else 137 | delete st['border']; 138 | 139 | // Handle hspace 140 | v = f.hspace.value; 141 | if (v) { 142 | delete st['margin']; 143 | st['margin-left'] = v + 'px'; 144 | st['margin-right'] = v + 'px'; 145 | } else { 146 | delete st['margin-left']; 147 | delete st['margin-right']; 148 | } 149 | 150 | // Handle vspace 151 | v = f.vspace.value; 152 | if (v) { 153 | delete st['margin']; 154 | st['margin-top'] = v + 'px'; 155 | st['margin-bottom'] = v + 'px'; 156 | } else { 157 | delete st['margin-top']; 158 | delete st['margin-bottom']; 159 | } 160 | 161 | // Merge 162 | st = tinyMCEPopup.dom.parseStyle(dom.serializeStyle(st), 'img'); 163 | this.styleVal = dom.serializeStyle(st, 'img'); 164 | } 165 | }, 166 | 167 | getAttrib : function(e, at) { 168 | var ed = tinyMCEPopup.editor, dom = ed.dom, v, v2; 169 | 170 | if (ed.settings.inline_styles) { 171 | switch (at) { 172 | case 'align': 173 | if (v = dom.getStyle(e, 'float')) 174 | return v; 175 | 176 | if (v = dom.getStyle(e, 'vertical-align')) 177 | return v; 178 | 179 | break; 180 | 181 | case 'hspace': 182 | v = dom.getStyle(e, 'margin-left') 183 | v2 = dom.getStyle(e, 'margin-right'); 184 | if (v && v == v2) 185 | return parseInt(v.replace(/[^0-9]/g, '')); 186 | 187 | break; 188 | 189 | case 'vspace': 190 | v = dom.getStyle(e, 'margin-top') 191 | v2 = dom.getStyle(e, 'margin-bottom'); 192 | if (v && v == v2) 193 | return parseInt(v.replace(/[^0-9]/g, '')); 194 | 195 | break; 196 | 197 | case 'border': 198 | v = 0; 199 | 200 | tinymce.each(['top', 'right', 'bottom', 'left'], function(sv) { 201 | sv = dom.getStyle(e, 'border-' + sv + '-width'); 202 | 203 | // False or not the same as prev 204 | if (!sv || (sv != v && v !== 0)) { 205 | v = 0; 206 | return false; 207 | } 208 | 209 | if (sv) 210 | v = sv; 211 | }); 212 | 213 | if (v) 214 | return parseInt(v.replace(/[^0-9]/g, '')); 215 | 216 | break; 217 | } 218 | } 219 | 220 | if (v = dom.getAttrib(e, at)) 221 | return v; 222 | 223 | return ''; 224 | }, 225 | 226 | resetImageData : function() { 227 | var f = document.forms[0]; 228 | 229 | f.width.value = f.height.value = ""; 230 | }, 231 | 232 | updateImageData : function() { 233 | var f = document.forms[0], t = ImageDialog; 234 | 235 | if (f.width.value == "") 236 | f.width.value = t.preloadImg.width; 237 | 238 | if (f.height.value == "") 239 | f.height.value = t.preloadImg.height; 240 | }, 241 | 242 | getImageData : function() { 243 | var f = document.forms[0]; 244 | 245 | this.preloadImg = new Image(); 246 | this.preloadImg.onload = this.updateImageData; 247 | this.preloadImg.onerror = this.resetImageData; 248 | this.preloadImg.src = tinyMCEPopup.editor.documentBaseURI.toAbsolute(f.src.value); 249 | } 250 | }; 251 | 252 | ImageDialog.preInit(); 253 | tinyMCEPopup.onInit.add(ImageDialog.init, ImageDialog); 254 | -------------------------------------------------------------------------------- /controllers/helpers/actions/ActionList.php: -------------------------------------------------------------------------------- 1 | initPagination(); 11 | $this->defineContext(); 12 | $this->run(); 13 | } 14 | public function run() { 15 | 16 | // getting the records and prepare the html markup 17 | $records = $this->mysql->{$this->resource->name}->order("position")->desc()->limit($this->pagination->from.",".$this->pagination->to)->get(); 18 | $recordsMarkup = ''; 19 | $headersMarkup = ''; 20 | $skipColumns = $this->getColumnsForSkipping(); 21 | if($records != false && count($records) > 0) { 22 | // table header 23 | foreach($this->resource->data as $item) { 24 | if(!in_array($item->name, $skipColumns)) { 25 | $headersMarkup .= view("resource/list-item-column.html", array( 26 | "value" => $item->title 27 | )); 28 | } 29 | } 30 | $recordsMarkup .= view("resource/list-item-row-headers.html", array( 31 | "columns" => $headersMarkup 32 | )); 33 | // table body 34 | foreach($records as $record) { 35 | $columnsMarkup = ''; 36 | foreach($this->resource->data as $item) { 37 | if(!in_array($item->name, $skipColumns) && $item->name != "id" && $item->name != "position") { 38 | $value = $record->{$item->name}; 39 | if($item->presenter == "Check") { 40 | $options = $this->getOptions($item->options); 41 | $value = explode(",", $value); 42 | $valueStr = ''; 43 | $numOfValues = count($value); 44 | for($i=0; $i<$numOfValues; $i++) { 45 | if(isset($options[$value[$i]])) { 46 | $valueStr .= $options[$value[$i]]; 47 | if($i < $numOfValues-1) { 48 | $valueStr .= ", "; 49 | } 50 | } 51 | } 52 | $value = $valueStr; 53 | } 54 | if($item->presenter == "File") { 55 | $columnsMarkup .= view("resource/list-item-column.html", array( 56 | "value" => $this->formatFileLink($value) 57 | )); 58 | } else if($item->presenter == "Image") { 59 | $columnsMarkup .= view("resource/list-item-column.html", array( 60 | "value" => $this->formatImageLink($value) 61 | )); 62 | } else { 63 | $columnsMarkup .= view("resource/list-item-column.html", array( 64 | "value" => $this->formatListText($value) 65 | )); 66 | } 67 | } 68 | } 69 | $recordsMarkup .= view("resource/list-item-row.html", array( 70 | "columns" => $columnsMarkup, 71 | "id" => $record->id, 72 | "resourceName" => $this->resource->name 73 | )); 74 | } 75 | } else { 76 | $recordsMarkup = 'There is no added data.'; 77 | } 78 | $this->response->write(view("layout.html", array( 79 | "pageTitle" => $this->resource->title, 80 | "content" => view("resource/index.html", array( 81 | "title" => $this->resource->title, 82 | "name" => $this->resource->name, 83 | "records" => $recordsMarkup, 84 | "pagination" => $this->pagination->markup, 85 | "childs" => $this->getChildResourcesMarkup(), 86 | "totalRecords" => $this->pagination->total 87 | )), 88 | "nav" => view("nav.html") 89 | )))->send(); 90 | 91 | } 92 | protected function initPagination() { 93 | $allRecords = $this->mysql->action("SELECT COUNT(*) as num FROM ".$this->resource->name); 94 | if(count($allRecords) === 0) { 95 | $allRecords = 0; 96 | } else { 97 | $allRecords = $allRecords[0]->num; 98 | } 99 | $this->pagination = (object) array( 100 | "current" => isset($this->params["page"]) ? $this->params["page"] : 0, 101 | "total" => $allRecords, 102 | "markup" => "", 103 | "from" => isset($this->params["page"]) ? $this->params["page"] : 0 * $this->itemsPerPage, 104 | "to" => $this->itemsPerPage 105 | ); 106 | for($i=0; $ipagination->total / $this->itemsPerPage); $i++) { 107 | $this->pagination->markup .= view("resource/list-pagination.html", array( 108 | "link" => ADMINUI_URL."resources/".$this->resource->name."?page=".$i, 109 | "label" => $i+1 110 | )); 111 | } 112 | } 113 | protected function getColumnsForSkipping() { 114 | if(isset($this->resource->listing) && $this->resource->listing->skip) { 115 | $skipColumns = explode(",", str_replace(" ", "", $this->resource->listing->skip)); 116 | return $skipColumns; 117 | } else { 118 | return array(); 119 | } 120 | } 121 | protected function formatListText($str) { 122 | $str = strip_tags($str); 123 | if(strlen($str) > 150) { 124 | $str = substr($str, 0, 100)."..."; 125 | } 126 | $str = wordwrap($str, 25, '
    ', true); 127 | return $str; 128 | } 129 | protected function formatImageLink($file) { 130 | $info = pathinfo($file); 131 | if(!isset($info["extension"])) { 132 | return ""; 133 | } 134 | $ext = strtolower($info["extension"]); 135 | if(in_array($ext, array("jpg", "jpeg", "png", "gif", "bmp"))) { 136 | return view("resource/list-link-with-image.html", array( 137 | "src" => ADMINUI_URL.FILES_DIR.dirname($file)."/list_".basename($file), 138 | "link" => ADMINUI_URL.FILES_DIR.$file 139 | )); 140 | } else { 141 | return view("resource/list-link.html", array( 142 | "label" => $info["basename"], 143 | "link" => ADMINUI_URL.FILES_DIR.$file 144 | )); 145 | } 146 | } 147 | protected function formatFileLink($file) { 148 | return view("resource/list-link.html", array( 149 | "label" => basename($file), 150 | "link" => ADMINUI_URL.FILES_DIR.$file 151 | )); 152 | } 153 | } 154 | 155 | ?> 156 | --------------------------------------------------------------------------------