------------------------------------------------------------------------------------------------------------------ FRAMEWORK: ver 1.0.1 26/03/2012 AUTHOR: PHILIP NIXON DESCRIPTION: Built on jquery mobile with PHP extensions for standard website features and form handling ------------------------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------------------------ FUNCTIONS IN class.core.php ... ------------------------------------------------------------------------------------------------------------------ core() - core top sets up session and manages form handlers and actions loader($module_name) - used to dynamically load modules getURL($page, $root, $section="base") - gets correct links depending on whether pretty links are used or not mobile_menu() - generates a menu suitable for mobile sites menu() - generates the standard desktop menu breadcrumb() - generates a page breadcrumb sidebar($side) - generates the sidebar openform($id, $data=array(), $action="") - generates html for jqm compliant form top field($type, $id, $opts) - generates html for jqm compliant fields block($name, $model, $repeat=false, $opts=array("inline"=>true, "allow_duplicates"=>false,"duplicates_ignore"=>array("qty","name"))) - shorthand to generate mutiple fields from a pre-defined model addBlock($formid, $name, $model, $itemid, $opts=array()) - generates html for add form block (eg. used by products in a shop) products($opts, $cols = 2) - generates html for a set of products from an array uploader($id) - generates html for a file uploader form element closeform() - generates html for jqm compliant form bottom collapsible($opts) - generates a jqm compaint collapsible li($items, $opts) - generates a jqm compaint list jplayer($jpid="1") - generates jplayer complaint html download_link($filename) - generate a link to force download a file map($doc_id) - generates html for a google map with markers taken from a google spreadsheet obfuscate($content="fpbggl@lnat.vq.nh", $mail=true) - generates code to support javascript obfuscation of email addresses carousel() - generates code to create a carousel. takes an array with google doc ids and options DEPRECATED summary($opts) - generates a non jqm compaint collapsible - DEPRECATED? socialLinks - generates social links - DEPRECATED? ------------------------------------------------------------------------------------------------------------------ THE SITE IS COMPLETELY CONFIGURED BY 'core-config.php' in the CONTENT folder of the site ------------------------------------------------------------------------------------------------------------------ ---- START SAMPLE CONFIG ----- $c = array( /* * SITE DEFINITION */ "name" => "framework", "version"=>"1.0", "root"=>"http://dreamsedge.ie/mobile", // SHOULD BE FULLY QUALIFIED DOMAIN IF https IS USED ON THE SITE. "sections"=>array("sample-section"), // SITE CONFIGURATION - CONFIGURE SECTIONS "titles"=>array("base"=>"Just Because", "test"=>"Just Because Test"), // SITE CONFIGURATION - CONFIGURE SECTIONS "pretty"=>true, // SET TO TRUE TO USE PRETTY URLS "keys" => array("forms"=>"_forms", "errors"=>"_errors", "response"=>"_response", "ts"=>"_ts", "remember"=>"_remember"), // SPECIAL FOR INPUT IDS "analytics"=>"24973314-1", // GOOGLE ANALYTICS CODE "backgrounds"=>array('BG-SAMPLEA.jpg', 'BG-SAMPLEB.jpg'), // THESE WILL BE LOADED DYNAMICALLY (IF SET) // SETTING FOR FORM HANDLERS "formaction"=>"internal", "handlers" => array("email","spreadsheet","contact","upload","realex","paypal","pdf-download","pdf-email","encrypted","debug"), // AVAILABLE HANDLERS "seconds"=>60*10, // TIMEOUT FOR FORMS "encrypt_session"=>false, "form_repeat_delete_text"=>"X", "paypal" => array( // PAYPAL EXPRESS CHECKOUT SETTINGS "API_USERNAME"=>"philip1_api1.dreamsedge.ie", "API_PASSWORD"=>"W56NNUHT9E7L4WZP", "API_SIGNATURE"=>"AxVuvOaP-VKW1h0Zvfk2RLrsNzt2AoxhzUGpx18ZzA3b0OtQNsP0T5qr", "API_ENDPOINT"=>"https://api-3t.sandbox.paypal.com/nvp", //"https://api-3t.sandbox.paypal.com/nvp", "PAYPAL_URL"=>"https://www.sandbox.paypal.com/webscr&cmd=_express-checkout&token=", //"https://www.sandbox.paypal.com/webscr&cmd=_express-checkout&token=" "amount"=>10, "accumulate"=>true ) "company"=>$company, // FOR EMAIL BASED HANDLERS "subject"=>$subject, "from"=>array("Name"=>$company, "Address"=>$e_account."@".$domain), "bcc"=>array("Name"=>"Dreamsedge Studios", "Address"=>"info@dreamsedge.ie"), "list_names"=>array(), // eg. "newsletter" // CHECK THIS? "password"=>"12worship", // will be used for encrypting and decrypting SESSION variables and email content "salt" => $u["path"], // FOR ENCRYPTED SESSIONS? "spreadsheet"=>array( "username"=>"info@dreamsedge.ie", "password"=>"12worship", "file"=>"SAMPLEFILE", "sheet"=>"Sheet1" ), // SPREADSHEET TO UPDATE /* * SOCIAL NETWORKING LINKS */ "social" => array( "lead"=>"Follow us on ", "icons"=>array( // "twitter"=>"https://twitter.com/#!/arch_beauty ", // "facebook"=>"http://www.facebook.com/pages/Arch-Beauty-Clinic/247482625308565", // "linkedin"=>"#", // "wordpress"=>"#" ) ), /* * PAGES TO BE INCLUDED IN SITE * FORMAT: pages[section_slug][page_slug][][][heading|description|elements][page_slug] * * WHERE * [section_slug] is the slug that will appear in the URL * [page_slug] is an array containing * label - Text Description of page that will appear in the menu * hide - set to TRUE to hide the page from the menu * link - An external link that is used instead of the page-slug * footer - Identifies the footer that a page uses. Set to false to inhibit the footer display * left - Identifies an array of blocks used in the left sidebar. FALSE means no left sidebar, array("blank") will leave and empty sidebar * right - Identifies an array of blocks used in the right sidebar. FALSE means no right sidebar, array("blank") will leave and empty sidebar * - optional array containing columns of elements to be displays in the menu * heading - This is the heading for this column in the menu * description - This is the description for this column in the menu * - optional array containing elements to be displays in this column of the menu * description - This is the description that accompanies columns elements in the menu * image - This is the description that accompanies columns elements in the menu */ "pages" => array( "base" => array( "home"=>array( "hide"=>true, "footer"=>false ), /* "treatments"=>array( "columns"=>array( 1=>array( "heading"=>"Face & Body", "description"=>"Column 1 Description", "elements"=>array( "hands-feet"=>array("label"=>"Hands & Feet", "description"=>"Pamper your Hands & Feet", "image"=>"wowbrown.jpg"), "facials"=>array("description"=>"Choose from our amazing Facials line up", "image"=>"wowbrown.jpg"), "hands-feet"=>array("label"=>"Hands & Feet", "description"=>"Pamper your Hands & Feet", "image"=>"wowbrown.jpg"), ) ), 2=>array( "heading"=>"More Treatments", "description"=>"Column 2 Description", "elements"=>array( "make-up"=>array("description"=>"Achieve a flawless, long lasting, up-to-date look", "image"=>"wowbrown.jpg" ), "waxing"=>array("description"=>"Choose from a variety of LYCON waxing treatments", "image"=>"wowbrown.jpg" ), ) ), 3=>array( "heading"=>"Other", "description"=>"Column 3 Description", "elements"=>array( "express"=>array("description"=>"Treatments from 30mins", "image"=>"wowbrown.jpg"), "therapies"=>array(), "procedures"=>array() ) ) ), "blocks"=>array("favourites","handb","giftcards","opening","facebook") ), */ "samples"=>array( "columns"=>array( 1=>array( // Single Column Menu "elements"=>array( "sample-player"=>array( "label"=>"player", "left"=>array("blank"), "right"=>array("blank") ), "sample-donate"=>array( "label"=>"donate", "left"=>array("blank"), "right"=>array("blank") ), "sample-shop"=>array( "label"=>"shop", "right"=>array("shop") ), "sample-checkout"=>array( "label"=>"checkout", "hide"=>true, "right"=>array("checkout") ), "sample-form"=>array( "label"=>"form", "left"=>array("blank"), "right"=>array("blank") ), "sample-form-2"=>array( "label"=>"form #2", "left"=>array("blank"), "right"=>array("blank") ), "sample-gallery"=>array( "label"=>"gallery", "left"=>array("blank"), "right"=>array("blank") ), "sample-table"=>array( "label"=>"table", "left"=>array("blank"), "right"=>array("blank") ), "sample-list"=>array( "label"=>"list", "left"=>array("blank"), "right"=>array("blank") ), "sample-upload"=>array( "label"=>"upload", "left"=>array("blank"), "right"=>array("blank") ), "sample-link"=>array( "label"=>"link", "link"=>"http://youtube.com" ) ) ) ), "label"=>"Sample Pages", "left"=>array("blank"), "right"=>array("blank") ), "about-us"=>array( ), "contact-us"=>array( ), "request"=>array( "hide"=>true, "left"=>array("blank"), "right"=>array("blank") ), //PAYPAL REQUIRED PAGES ... "paypal-error"=>array( "hide"=>true, "left"=>array("blank"), "right"=>array("blank") ), "paypal-confirm"=>array( "hide"=>true, "left"=>array("blank"), "right"=>array("blank") ), "paypal-complete"=>array( "hide"=>true, "left"=>array("blank"), "right"=>array("blank") ), "paypal-cancel"=>array( "hide"=>true, "left"=>array("blank"), "right"=>array("blank") ) ) ) ); include $_SERVER['DOCUMENT_ROOT']."/framework/".$c['version']."/class.core.php"; ---- END SAMPLE CONFIG ----- ------------------------------------------------------------------------------------------------------------------ THE FRAMEWORK IN INSTALLED IN /FRAMEWORK/1.0 IN THE ROOT OF THE SERVER AND CONTAINS ... ------------------------------------------------------------------------------------------------------------------ readme.txt - this file class.core.php - the php framework core class - called all other classes etc. core-scripts.php - this file is loaded in page header - loads all css and scripts needed for the framework actions - simple php actions that are carried out using the GET actions framework css . core.css - css to extend and enhance jquerymobile - support extra desktop features . multi-column.css - multi-columns classes in a seperate file to allow implementation by IE . fixes - files for IE fixes an patches . icons . images . layout . layout-1320.css - full resolution desktop site 1136px minimum size . layout-1000.css - xga resolution desktop site . layout-680.css - iphone 4s+ resolution desktop site . layout-520.css - iphone 4 ladscape resolution desktop site . layout-360.css - iphone 4 resolution desktop site . layout-mobile.css - makes all columns single scolumn for mobile device and replaces menu with mobile menu handler - built in form handler functions for common features . classes - supporting classes for handlers. Also used in some core class functions . templates - messsage templates used by the form processor . email . html . pdf images - empty js - the javascript framework files . core-lib.js - my additional functions for javascript framework . css3-multi-column.js - allows IR to use multi-columns . jquery.mediaqueries.js - allow IE to use media queries . jquery.easing.1.3.js . jquery.mousewheel.js . plupload.flash.swf . plupload.silverlight.xap . jQuery.jPlayer.2.1.0 - supporting library and theme files for jPlayer models - common blocks and field definitions used for forms ------------------------------------------------------------------------------------------------------------------ THE SITE IS GENERALLY PLACED IN THE ROOT OF THE SERVER AND CONTAINS THE FOLLOWING FILES ------------------------------------------------------------------------------------------------------------------ .htaccess - required for pretty links index.php content . core-config.php . podcast-config.php . css . js - contains section and page specific js - loaded automatically if named correctly via 'core-scripts.php' . _base.js . modules . custom-footer.php - standard footer for site . custom-header.php - standard header for site . podcast.php - used by media/podcast to auto generate podcast from google doc . blocks - reusable blocks for the site . blank.php - dummy black php for used for blank sidebars . checkout.php - preconfigured sample checkout for use with shop . shop.php - preconfigured sample product list for use with shop . social.php - standard social block for site . getid3 - used by podcast.php to calculate duration of mp3s for podcast rss . sample-section _scripts.php . pages - comes preloaded with sample pages - ignore what you don't need . 404.php - standard error page . gDoc.php - loads google doc into site . request.php - for test . home.php . about.php . contact.php . sample*.php - all sample menu pages as defined in 'core-config.php' . paypal-cancel.php - all paypal required pages . paypal-complete.php . paypal-confirm.php . paypal-error.php css . .htaccess - for woff fiels - not sure it's working . site.css - for site wide definitions . images - supporting css images . src . HOME-2011-FINAL.png - sample composite site images . carousel . menus media . .htaccess - used for podcasts and ubuntu one mp3 redirects