+ <{$commentsnav}> <{$lang_notice}>
+
+
+ <{if $comment_mode == "flat"}>
+ <{include file="db:system_comments_flat.html"}>
+ <{elseif $comment_mode == "thread"}>
+ <{include file="db:system_comments_thread.html"}>
+ <{elseif $comment_mode == "nest"}>
+ <{include file="db:system_comments_nest.html"}>
+ <{/if}>
+
+
+ |
+
<{$smarty.const._AM_BASEMODULE_REQUIREMENTS_INFO}>
+<{foreach item=failed_requirement from=$failed_requirements}> +<{$smarty.const._AM_BASEMODULE_REQUIREMENTS_SUPPORT}>
\ No newline at end of file diff --git a/basemodule/basefiles/templates/blocks/index.html b/basemodule/basefiles/templates/blocks/index.html new file mode 100755 index 0000000..990cbd6 --- /dev/null +++ b/basemodule/basefiles/templates/blocks/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/basemodule/basefiles/templates/index.html b/basemodule/basefiles/templates/index.html new file mode 100644 index 0000000..990cbd6 --- /dev/null +++ b/basemodule/basefiles/templates/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/basemodule/model/admin/menu.php b/basemodule/model/admin/menu.php new file mode 100644 index 0000000..2118aae --- /dev/null +++ b/basemodule/model/admin/menu.php @@ -0,0 +1,30 @@ + + * @package basemodule + * @version $Id$ + */ + +/** IMBUILDING_ADMIN_MENU_ITEMS */ + +$module = icms::handler("icms_module")->getByDirname(basename(dirname(dirname(__FILE__)))); + +$headermenu[] = array( + "title" => _PREFERENCES, + "link" => "../../system/admin.php?fct=preferences&op=showmod&mod=" . $module->getVar("mid")); +$headermenu[] = array( + "title" => _CO_ICMS_GOTOMODULE, + "link" => ICMS_URL . "/modules/basemodule/"); +$headermenu[] = array( + "title" => _CO_ICMS_UPDATE_MODULE, + "link" => ICMS_URL . "/modules/system/admin.php?fct=modulesadmin&op=update&module=" . basename(dirname(dirname(__FILE__)))); +$headermenu[] = array( + "title" => _MODABOUT_ABOUT, + "link" => ICMS_URL . "/modules/basemodule/admin/about.php"); + +unset($module_handler); \ No newline at end of file diff --git a/basemodule/model/admin/object.php b/basemodule/model/admin/object.php new file mode 100644 index 0000000..ff0c37b --- /dev/null +++ b/basemodule/model/admin/object.php @@ -0,0 +1,99 @@ + + * @package basemodule + * @version $Id$ + */ + +/** + * Edit a Item + * + * @param int $item_id Itemid to be edited +*/ +function edititem($item_id = 0) { + global $basemodule_item_handler, $icmsModule, $icmsAdminTpl; + + $itemObj = $basemodule_item_handler->get($item_id); + + if (!$itemObj->isNew()){ + $icmsModule->displayAdminMenu(/** IMBUILDING_OBJECT_SORT **/, _AM_BASEMODULE_ITEMS . " > " . _CO_ICMS_EDITING); + $sform = $itemObj->getForm(_AM_BASEMODULE_ITEM_EDIT, "additem"); + $sform->assign($icmsAdminTpl); + } else { + $icmsModule->displayAdminMenu(/** IMBUILDING_OBJECT_SORT **/, _AM_BASEMODULE_ITEMS . " > " . _CO_ICMS_CREATINGNEW); + $sform = $itemObj->getForm(_AM_BASEMODULE_ITEM_CREATE, "additem"); + $sform->assign($icmsAdminTpl); + + } + $icmsAdminTpl->display("db:basemodule_admin_item.html"); +} + +include_once "admin_header.php"; + +$basemodule_item_handler = icms_getModuleHandler("item", basename(dirname(dirname(__FILE__))), "basemodule"); +/** Use a naming convention that indicates the source of the content of the variable */ +$clean_op = ""; +/** Create a whitelist of valid values, be sure to use appropriate types for each value + * Be sure to include a value for no parameter, if you have a default condition + */ +$valid_op = array ("mod", "changedField", "additem", "del", "view", ""); + +if (isset($_GET["op"])) $clean_op = htmlentities($_GET["op"]); +if (isset($_POST["op"])) $clean_op = htmlentities($_POST["op"]); + +/** Again, use a naming convention that indicates the source of the content of the variable */ +$clean_item_id = isset($_GET["item_id"]) ? (int)$_GET["item_id"] : 0 ; + +/** + * in_array() is a native PHP function that will determine if the value of the + * first argument is found in the array listed in the second argument. Strings + * are case sensitive and the 3rd argument determines whether type matching is + * required +*/ +if (in_array($clean_op, $valid_op, TRUE)) { + switch ($clean_op) { + case "mod": + case "changedField": + icms_cp_header(); + edititem($clean_item_id); + break; + + case "additem": + $controller = new icms_ipf_Controller($basemodule_item_handler); + $controller->storeFromDefaultForm(_AM_BASEMODULE_ITEM_CREATED, _AM_BASEMODULE_ITEM_MODIFIED); + break; + + case "del": + $controller = new icms_ipf_Controller($basemodule_item_handler); + $controller->handleObjectDeletion(); + break; + + case "view" : + $itemObj = $basemodule_item_handler->get($clean_item_id); + icms_cp_header(); + $itemObj->displaySingleObject(); + break; + + default: + icms_cp_header(); + $icmsModule->displayAdminMenu(/** IMBUILDING_OBJECT_SORT **/, _AM_BASEMODULE_ITEMS); + $objectTable = new icms_ipf_view_Table($basemodule_item_handler); + $objectTable->addColumn(new icms_ipf_view_Column("object_identifier_name")); + $objectTable->addIntroButton("additem", "item.php?op=mod", _AM_BASEMODULE_ITEM_CREATE); + $icmsAdminTpl->assign("basemodule_item_table", $objectTable->fetch()); + $icmsAdminTpl->display("db:basemodule_admin_item.html"); + break; + } + icms_cp_footer(); +} +/** + * If you want to have a specific action taken because the user input was invalid, + * place it at this point. Otherwise, a blank page will be displayed + */ \ No newline at end of file diff --git a/basemodule/model/class/persistableobject.php b/basemodule/model/class/persistableobject.php new file mode 100644 index 0000000..9a1358a --- /dev/null +++ b/basemodule/model/class/persistableobject.php @@ -0,0 +1,42 @@ + + * @package basemodule + * @version $Id$ + */ + +defined("ICMS_ROOT_PATH") or die("ICMS root path not defined"); + +class mod_basemodule_Item extends icms_ipf_Object { + /** + * Constructor + * + * @param mod_basemodule_Item $handler Object handler + */ + public function __construct(&$handler) { + parent::__construct($handler); + + $this->quickInitVar("item_id", XOBJ_DTYPE_INT, TRUE); +/** IMBUILDING_INITIATE_VARS **/ + } + + /** + * Overriding the icms_ipf_Object::getVar method to assign a custom method on some + * specific fields to handle the value before returning it + * + * @param str $key key of the field + * @param str $format format that is requested + * @return mixed value of the field that is requested + */ + public function getVar($key, $format = "s") { + if ($format == "s" && in_array($key, array())) { + return call_user_func(array ($this, $key)); + } + return parent::getVar($key, $format); + } +} \ No newline at end of file diff --git a/basemodule/model/class/persistableobjecthandler.php b/basemodule/model/class/persistableobjecthandler.php new file mode 100644 index 0000000..e1a74eb --- /dev/null +++ b/basemodule/model/class/persistableobjecthandler.php @@ -0,0 +1,27 @@ + + * @package basemodule + * @version $Id$ + */ + +defined("ICMS_ROOT_PATH") or die("ICMS root path not defined"); + +class mod_basemodule_ItemHandler extends icms_ipf_Handler { + /** + * Constructor + * + * @param icms_db_legacy_Database $db database connection object + */ + public function __construct(&$db) { + parent::__construct($db, "item", "item_id", "object_identifier_name", "object_identifier_desc", "basemodule"); +/** IMBUILDING_HANDLER_ENABLE_UPLOAD **/ + } + +/** IMBUILDING_HANDLER_EVENT_METHODS **/ +} \ No newline at end of file diff --git a/basemodule/model/class/persistableseoobject.php b/basemodule/model/class/persistableseoobject.php new file mode 100644 index 0000000..941e921 --- /dev/null +++ b/basemodule/model/class/persistableseoobject.php @@ -0,0 +1,44 @@ + + * @package basemodule + * @version $Id$ + */ + +defined("ICMS_ROOT_PATH") or die("ICMS root path not defined"); + +class mod_basemodule_Item extends icms_ipf_seo_Object { + /** + * Constructor + * + * @param mod_basemodule_Item $handler Object handler + */ + public function __construct(&$handler) { + icms_ipf_object::__construct($handler); + + $this->quickInitVar("item_id", XOBJ_DTYPE_INT, TRUE); +/** IMBUILDING_INITIATE_VARS **/ + + $this->initiateSEO(); + } + + /** + * Overriding the icms_ipf_Object::getVar method to assign a custom method on some + * specific fields to handle the value before returning it + * + * @param str $key key of the field + * @param str $format format that is requested + * @return mixed value of the field that is requested + */ + public function getVar($key, $format = "s") { + if ($format == "s" && in_array($key, array())) { + return call_user_func(array ($this, $key)); + } + return parent::getVar($key, $format); + } +} \ No newline at end of file diff --git a/basemodule/model/icms_version.php b/basemodule/model/icms_version.php new file mode 100644 index 0000000..0200027 --- /dev/null +++ b/basemodule/model/icms_version.php @@ -0,0 +1,95 @@ + + * @package basemodule + * @version $Id$ + */ + +defined("ICMS_ROOT_PATH") or die("ICMS root path not defined"); + +/** General Information */ +$modversion = array( + "name" => _MI_BASEMODULE_MD_NAME, + "version" => 1.0, + "description" => _MI_BASEMODULE_MD_DESC, + "author" => "IMBUILDING_TAG_AUTHOR_NAME", + "credits" => "IMBUILDING_TAG_CREDITS", + "help" => "", + "license" => "GNU General Public License (GPL)", + "official" => 0, + "dirname" => basename(dirname(__FILE__)), + "modname" => "basemodule", + +/** Images information */ + "iconsmall" => "images/icon_small.png", + "iconbig" => "images/icon_big.png", + "image" => "images/icon_big.png", /* for backward compatibility */ + +/** Development information */ + "status_version" => "1.0", + "status" => "Beta", + "date" => "Unreleased", + "author_word" => "", + "warning" => _CO_ICMS_WARNING_BETA, + +/** Contributors */ + "developer_website_url" => "IMBUILDING_TAG_AUTHOR_WEBSITE_URL", + "developer_website_name" => "IMBUILDING_TAG_AUTHOR_WEBSITE_NAME", + "developer_email" => "IMBUILDING_TAG_AUTHOR_EMAIL", + +/** Administrative information */ + "hasAdmin" => 1, + "adminindex" => "admin/index.php", + "adminmenu" => "admin/menu.php", + +/** Install and update informations */ + "onInstall" => "include/onupdate.inc.php", + "onUpdate" => "include/onupdate.inc.php", + +/** Search information */ + "hasSearch" => 0, + "search" => array("file" => "include/search.inc.php", "func" => "basemodule_search"), + +/** Menu information */ + "hasMain" => 1, + +/** Comments information */ + "hasComments" => 1, + "comments" => array( + "itemName" => "post_id", + "pageName" => "post.php", + "callbackFile" => "include/comment.inc.php", + "callback" => array("approve" => "basemodule_com_approve", + "update" => "basemodule_com_update"))); + +/** other possible types: testers, translators, documenters and other */ +$modversion['people']['developers'][] = "IMBUILDING_TAG_DEVELOPER_INFO"; + +/** Manual */ +$modversion['manual']['wiki'][] = "English"; + +/** Database information */ +/** IMBUILDING_OBJECT_ITEMS */ +$modversion["tables"] = icms_getTablesArray($modversion['dirname'], $modversion['object_items']); + +/** Templates information */ +$modversion['templates'] = array( +/** IMBUILDING_OBJECT_TEMPLATES */ + array('file' => 'basemodule_header.html', 'description' => 'Module Header'), + array('file' => 'basemodule_footer.html', 'description' => 'Module Footer')); + +/** Blocks information */ +/** To come soon in imBuilding... */ + +/** Preferences information */ +/** To come soon in imBuilding... */ + +/** Notification information */ +/** To come soon in imBuilding... */ \ No newline at end of file diff --git a/basemodule/model/language/english/admin.php b/basemodule/model/language/english/admin.php new file mode 100644 index 0000000..102e112 --- /dev/null +++ b/basemodule/model/language/english/admin.php @@ -0,0 +1,21 @@ + + * @package basemodule + * @version $Id$ + */ + +defined("ICMS_ROOT_PATH") or die("ICMS root path not defined"); + +// Requirements +define("_AM_BASEMODULE_REQUIREMENTS", "BaseModule Requirements"); +define("_AM_BASEMODULE_REQUIREMENTS_INFO", "We've reviewed your system, unfortunately it doesn't meet all the requirements needed for BaseModule to function. Below are the requirements needed."); +define("_AM_BASEMODULE_REQUIREMENTS_ICMS_BUILD", "BaseModule requires at least ImpressCMS 1.3."); +define("_AM_BASEMODULE_REQUIREMENTS_SUPPORT", "Should you have any question or concerns, please visit our forums at http://community.impresscms.org."); + +/** IMBUILDING_ADMIN_LANGUAGE_DATA */ \ No newline at end of file diff --git a/basemodule/model/language/english/admin_language.tpl b/basemodule/model/language/english/admin_language.tpl new file mode 100644 index 0000000..083de5a --- /dev/null +++ b/basemodule/model/language/english/admin_language.tpl @@ -0,0 +1,12 @@ +// Item +define("_AM_BASEMODULE_ITEMS", "Items"); +define("_AM_BASEMODULE_ITEMS_DSC", "All items in the module"); +define("_AM_BASEMODULE_ITEM_CREATE", "Add a item"); +define("_AM_BASEMODULE_ITEM", "Item"); +define("_AM_BASEMODULE_ITEM_CREATE_INFO", "Fill-out the following form to create a new item."); +define("_AM_BASEMODULE_ITEM_EDIT", "Edit this item"); +define("_AM_BASEMODULE_ITEM_EDIT_INFO", "Fill-out the following form in order to edit this item."); +define("_AM_BASEMODULE_ITEM_MODIFIED", "The item was successfully modified."); +define("_AM_BASEMODULE_ITEM_CREATED", "The item has been successfully created."); +define("_AM_BASEMODULE_ITEM_VIEW", "Item info"); +define("_AM_BASEMODULE_ITEM_VIEW_DSC", "Here is the info about this item."); \ No newline at end of file diff --git a/basemodule/model/language/english/common.php b/basemodule/model/language/english/common.php new file mode 100644 index 0000000..cfe2e58 --- /dev/null +++ b/basemodule/model/language/english/common.php @@ -0,0 +1,15 @@ + + * @package basemodule + * @version $Id$ + */ + +defined("ICMS_ROOT_PATH") or die("ICMS root path not defined"); + +/** IMBUILDING_COMMON_LANGUAGE_DATA */ \ No newline at end of file diff --git a/basemodule/model/language/english/main.php b/basemodule/model/language/english/main.php new file mode 100644 index 0000000..6eeb4b6 --- /dev/null +++ b/basemodule/model/language/english/main.php @@ -0,0 +1,17 @@ + + * @package basemodule + * @version $Id$ + */ + +defined("ICMS_ROOT_PATH") or die("ICMS root path not defined"); + +define("_MD_BASEMODULE_ADMIN_PAGE", ":: Admin page ::"); + +/** IMBUILDING_MAIN_LANGUAGE_DATA */ \ No newline at end of file diff --git a/basemodule/model/language/english/modinfo.php b/basemodule/model/language/english/modinfo.php new file mode 100644 index 0000000..d6cc5ea --- /dev/null +++ b/basemodule/model/language/english/modinfo.php @@ -0,0 +1,18 @@ + + * @package basemodule + * @version $Id$ + */ + +defined("ICMS_ROOT_PATH") or die("ICMS root path not defined"); + +define("_MI_BASEMODULE_MD_NAME", "BaseModule"); +define("_MI_BASEMODULE_MD_DESC", "ImpressCMS Simple BaseModule"); + +/** IMBUILDING_MI_LANGUAGE_DATA */ \ No newline at end of file diff --git a/basemodule/model/object.php b/basemodule/model/object.php new file mode 100644 index 0000000..8bb0730 --- /dev/null +++ b/basemodule/model/object.php @@ -0,0 +1,37 @@ + +* @package basemodule +* @version $Id$ +*/ + +include_once "header.php"; + +$xoopsOption["template_main"] = "basemodule_item.html"; +include_once ICMS_ROOT_PATH . "/header.php"; + +$basemodule_item_handler = icms_getModuleHandler("item", basename(dirname(__FILE__)), "basemodule"); + +/** Use a naming convention that indicates the source of the content of the variable */ +$clean_item_id = isset($_GET["item_id"]) ? (int)$_GET["item_id"] : 0 ; +$itemObj = $basemodule_item_handler->get($clean_item_id); + +if ($itemObj && !$itemObj->isNew()) { + $icmsTpl->assign("basemodule_item", $itemObj->toArray()); +} else { + $icmsTpl->assign("basemodule_title", _MD_BASEMODULE_ALL_ITEMS); + + $objectTable = new icms_ipf_view_Table($basemodule_item_handler, FALSE, array()); + $objectTable->isForUserSide(); + $objectTable->addColumn(new icms_ipf_view_Column("object_identifier_name")); + $icmsTpl->assign("basemodule_item_table", $objectTable->fetch()); +} + +$icmsTpl->assign("basemodule_module_home", 'getVar("dirname") . '/">' . icms::$module->getVar("name") . ""); + +include_once "footer.php"; \ No newline at end of file diff --git a/basemodule/model/seoobject.php b/basemodule/model/seoobject.php new file mode 100644 index 0000000..63be87f --- /dev/null +++ b/basemodule/model/seoobject.php @@ -0,0 +1,40 @@ + +* @package basemodule +* @version $Id$ +*/ + +include_once "header.php"; + +$xoopsOption["template_main"] = "basemodule_item.html"; +include_once ICMS_ROOT_PATH . "/header.php"; + +$basemodule_item_handler = icms_getModuleHandler("item", basename(dirname(__FILE__)), "basemodule"); + +/** Use a naming convention that indicates the source of the content of the variable */ +$clean_item_id = isset($_GET["item_id"]) ? (int)$_GET["item_id"] : 0 ; +$itemObj = $basemodule_item_handler->get($clean_item_id); + +if($itemObj && !$itemObj->isNew()) { + $icmsTpl->assign("basemodule_item", $itemObj->toArray()); + + $icms_metagen = new icms_ipf_Metagen($itemObj->getVar("object_identifier_name"), $itemObj->getVar("meta_keywords", "n"), $itemObj->getVar("meta_description", "n")); + $icms_metagen->createMetaTags(); +} else { + $icmsTpl->assign("basemodule_title", _MD_BASEMODULE_ALL_ITEMS); + + $objectTable = new icms_ipf_view_Table($basemodule_item_handler, FALSE, array()); + $objectTable->isForUserSide(); + $objectTable->addColumn(new icms_ipf_view_Column("object_identifier_name")); + $icmsTpl->assign("basemodule_item_table", $objectTable->fetch()); +} + +$icmsTpl->assign("basemodule_module_home", 'getVar("dirname") . '/">' . icms::$module->getVar("name") . ""); + +include_once "footer.php"; \ No newline at end of file diff --git a/basemodule/model/templates/basemodule_admin_item.html b/basemodule/model/templates/basemodule_admin_item.html new file mode 100644 index 0000000..6d72f5e --- /dev/null +++ b/basemodule/model/templates/basemodule_admin_item.html @@ -0,0 +1,4 @@ +<{if $basemodule_item_title}><{$basemodule_item_info}>
<{/if}> +<{if $basemodule_item_table}><{$basemodule_item_table}><{/if}> +<{if $additem}><{includeq file='db:system_common_form.html' form=$additem}><{/if}> \ No newline at end of file diff --git a/basemodule/model/templates/basemodule_item.html b/basemodule/model/templates/basemodule_item.html new file mode 100644 index 0000000..b91d660 --- /dev/null +++ b/basemodule/model/templates/basemodule_item.html @@ -0,0 +1,12 @@ +<{includeq file='db:basemodule_header.html'}> +<{if $basemodule_item}> +<{$imbuilding_field_info}>
<{/if}> +<{if $imbuilding_field_table}><{$imbuilding_field_table}><{/if}> +<{if $addfield}> +<{$imbuilding_form_header_info}>
+<{includeq file='db:system_common_form.html' form=$addfield}> +<{/if}> +<{if $imbuilding_field_singleview}><{$imbuilding_field_singleview}><{/if}> \ No newline at end of file diff --git a/templates/imbuilding_admin_index.html b/templates/imbuilding_admin_index.html new file mode 100644 index 0000000..3882160 --- /dev/null +++ b/templates/imbuilding_admin_index.html @@ -0,0 +1,3 @@ +<{$imbuilding_new_module_info}>
+<{includeq file='db:system_default_form.html' form=$imbuilding_new_module}> \ No newline at end of file diff --git a/templates/imbuilding_admin_module.html b/templates/imbuilding_admin_module.html new file mode 100644 index 0000000..f4fca86 --- /dev/null +++ b/templates/imbuilding_admin_module.html @@ -0,0 +1,23 @@ +<{if $modules_breadcrumb}><{$modules_breadcrumb}><{/if}> +<{if $imbuilding_module_title}><{$imbuilding_module_info}>
<{/if}> +<{if $imbuilding_module_table}><{$imbuilding_module_table}><{/if}> +<{if $addmodule}> +<{$imbuilding_form_header_info}>
+<{includeq file='db:system_common_form.html' form=$addmodule}> +<{/if}> +<{if $imbuilding_module_singleview}><{$imbuilding_module_singleview}><{/if}> +<{if $imbuilding_object_table}> +<{$imbuilding_object_info}>
<{/if}> +<{if $imbuilding_object_table}><{$imbuilding_object_table}><{/if}> +<{if $addobject}> +<{$imbuilding_form_header_info}>
+<{includeq file='db:system_common_form.html' form=$addobject}> +<{/if}> +<{if $imbuilding_object_singleview}><{$imbuilding_object_singleview}><{/if}> +<{if $imbuilding_field_table}> +<{$smarty.const._AM_IMBUILDING_REQUIREMENTS_INFO}>
+<{foreach item=failed_requirement from=$failed_requirements}> +<{$smarty.const._AM_IMBUILDING_REQUIREMENTS_SUPPORT}>
\ No newline at end of file diff --git a/templates/index.html b/templates/index.html new file mode 100644 index 0000000..990cbd6 --- /dev/null +++ b/templates/index.html @@ -0,0 +1 @@ + \ No newline at end of file