initial cmap module checkin
authorgreg gay <ggay@ocad.ca>
Fri, 6 Oct 2006 19:28:46 +0000 (19:28 -0000)
committergreg gay <ggay@ocad.ca>
Fri, 6 Oct 2006 19:28:46 +0000 (19:28 -0000)
mods/cmap/README [new file with mode: 0644]
mods/cmap/cmap_logo.jpg [new file with mode: 0644]
mods/cmap/index.php [new file with mode: 0644]
mods/cmap/index_admin.php [new file with mode: 0644]
mods/cmap/index_instructor.php [new file with mode: 0644]
mods/cmap/module.php [new file with mode: 0644]
mods/cmap/module.sql [new file with mode: 0644]
mods/cmap/module.xml [new file with mode: 0644]
mods/cmap/module_install.php [new file with mode: 0644]

diff --git a/mods/cmap/README b/mods/cmap/README
new file mode 100644 (file)
index 0000000..0365434
--- /dev/null
@@ -0,0 +1,19 @@
+# CMAP README
+
+CMAP is a collaborative concept mapping application. It is possible to the CMAP tools alone to generate concept maps and  export them as images or Web pages, which can then be added to an ATutor course. Or, if the CMAP server is installed in a central location, and students have the CMAPTools installed, they can collaborate through the server to create concept maps.
+
+Web services for CMAP are currently under development, and in a future release will allow the authoring and storing of Maps from directly within ATutor. For now CMAP is a simple addon to an external application.
+
+See the CMAP web site for complete details about the system.
+CMAP Home
+http://cmap.ihmc.us/
+
+Sample Concept Maps
+http://cmapskm.ihmc.us/
+
+CMAP Documentation
+http://cmap.ihmc.us/Documentation/index.php
+
+**Installing the ATutor-CMAP module**
+Once the CMAP server has been installed and is functioning properly, unpack the atutor_cmap.tar.gz file into your ATutor mods/ directory. Then login to ATutor as the administrator, choose the modules tab, then choose Install Modules from the Modules submenu. Follow the instructions to install the module, then when installed, enable it to make it avalable to courses on that ATutor server. Finally, access the CMAP tab that gets added to the Administrator main menu, and there enter the URL to the CMAP server. Done.
+
diff --git a/mods/cmap/cmap_logo.jpg b/mods/cmap/cmap_logo.jpg
new file mode 100644 (file)
index 0000000..779a75b
Binary files /dev/null and b/mods/cmap/cmap_logo.jpg differ
diff --git a/mods/cmap/index.php b/mods/cmap/index.php
new file mode 100644 (file)
index 0000000..b044094
--- /dev/null
@@ -0,0 +1,29 @@
+<?php\r
+define('AT_INCLUDE_PATH', '../../include/');\r
+require (AT_INCLUDE_PATH.'vitals.inc.php');\r
+require (AT_INCLUDE_PATH.'header.inc.php');\r
+\r
+\r
+if ($_config['cmap']): ?>\r
+       <div class="input-form">\r
+               <div class="row">\r
+                       <p><?php echo _AT('cmap_text', $_config['cmap'] );  ?></p>\r
+               </div>\r
+       </div>\r
+<?php else: ?>\r
+       <div class="input-form">\r
+               <div class="row">\r
+                       <p><?php echo _AT('cmap_missing_url');  ?></p>\r
+               </div>\r
+       </div>\r
+<?php endif; ?>\r
+<div class="input-form">\r
+| <a href="<?php echo $_SERVER['PHP_SELF']; ?>" onclick="window.open('<?php echo $_config['cmap']; ?>','cmapwin','width=800,height=720,scrollbars=yes, resizable=yes'); return false"><?php echo  _AT('cmap_own_window'); ?></a> \r
+| <a href="<?php echo $_SERVER['PHP_SELF']; ?>" onclick="window.open('http://cmap.ihmc.us/Support/Help/','cmapwin','width=800,height=720,scrollbars=yes, resizable=yes'); return false"><?php echo  _AT('cmap_help_window'); ?></a> \r
+| <br /><br />\r
+</div>\r
+<iframe name="cmap" id="cmap" title="ePresence" scrolling="yes" src="<?php echo $_config['cmap']; ?>" height="800" width="90%" align="center" style="border:thin white solid; align:center;"></iframe>\r
+\r
+\r
+\r
+<?php require (AT_INCLUDE_PATH.'footer.inc.php'); ?>
\ No newline at end of file
diff --git a/mods/cmap/index_admin.php b/mods/cmap/index_admin.php
new file mode 100644 (file)
index 0000000..ce36964
--- /dev/null
@@ -0,0 +1,76 @@
+<?php\r
+/*\r
+This is the ATutor CMAP module page. It allows an admin user\r
+to set or edit  the URL for the CMAP installation for ATutor.\r
+\r
+*/\r
+define('AT_INCLUDE_PATH', '../../include/');\r
+require (AT_INCLUDE_PATH.'vitals.inc.php');\r
+\r
+\r
+if (isset($_POST['submit'])) {\r
+       $_POST['uri'] = trim($_POST['uri']);\r
+\r
+       if (!$_POST['uri']){\r
+               $msg->addError('CMAPURL_ADD_EMPTY');\r
+       }\r
+                       \r
+       if (!$msg->containsErrors()) {\r
+               $_POST['uri'] = $addslashes($_POST['uri']);\r
+               $sql = "REPLACE INTO ".TABLE_PREFIX."config VALUES ('cmap', '$_POST[uri]')";\r
+               mysql_query($sql, $db);\r
+               $msg->addFeedback('CMAPURL_ADD_SAVED');\r
+\r
+               header('Location: '.$_SERVER['PHP_SELF']);\r
+               exit;\r
+       }\r
+}\r
+\r
+require (AT_INCLUDE_PATH.'header.inc.php');\r
+\r
+?>\r
+\r
+<?php if ($_config['cmap']): ?>\r
+       <div class="input-form">\r
+               <div class="row">\r
+                       <p><?php  echo _AT('cmap_admin_text'); ?></p>\r
+               </div>\r
+\r
+       </div>\r
+<?php else: ?>\r
+       <div class="input-form">\r
+               <div class="row">\r
+                       <p><?php echo _AT('cmap_missing_url');  ?></p>\r
+               </div>\r
+       </div>\r
+<?php endif; ?>\r
+\r
+<form action="<?php  $_SERVER['PHP_SELF']; ?>" method="post">\r
+       <div class="input-form">\r
+               <div class="row">\r
+                       <p><label for="uri"><?php echo _AT('cmap_location'); ?></label></p>\r
+       \r
+                       <input type="text" name="uri" value="<?php echo $_config['cmap']; ?>" id="uri" size="80" style="min-width: 95%;" />\r
+               </div>\r
+\r
+               <div class="row buttons">\r
+                       <input type="submit" name="submit" value="<?php echo _AT('save'); ?>"  />\r
+               </div>\r
+       </div>\r
+</form>\r
+<?php if ($_config['cmap']): ?>\r
+\r
+<div class="input-form">\r
+| <a href="<?php echo $_SERVER['PHP_SELF']; ?>" onclick="window.open('<?php echo $_config['cmap']; ?>','cmapwin','width=800,height=720,scrollbars=yes, resizable=yes'); return false"><?php echo  _AT('cmap_own_window'); ?></a> \r
+| <a href="<?php echo $_SERVER['PHP_SELF']; ?>" onclick="window.open('http://cmap.ihmc.us/Support/Help/','cmapwin','width=800,height=720,scrollbars=yes, resizable=yes'); return false"><?php echo  _AT('cmap_help_window'); ?></a> \r
+| <br /><br />\r
+</div>\r
+<iframe name="cmap" id="cmap" title="ePresence" scrolling="yes" src="<?php echo $_config['cmap']; ?>" height="800" width="90%" align="center" style="border:thin white solid; align:center;"></iframe>\r
+<?php else: ?>\r
+               <div class="row">\r
+                       <p><?php echo _AT('cmap_missing_url');  ?></p>\r
+               </div>\r
+\r
+<?php endif; ?>\r
+\r
+<?php require (AT_INCLUDE_PATH.'footer.inc.php'); ?>
\ No newline at end of file
diff --git a/mods/cmap/index_instructor.php b/mods/cmap/index_instructor.php
new file mode 100644 (file)
index 0000000..44374c2
--- /dev/null
@@ -0,0 +1,30 @@
+<?php\r
+define('AT_INCLUDE_PATH', '../../include/');\r
+require (AT_INCLUDE_PATH.'vitals.inc.php');\r
+authenticate(AT_PRIV_CMAP);\r
+require (AT_INCLUDE_PATH.'header.inc.php');\r
+?>\r
+\r
+<?php if ($_config['cmap']): ?>\r
+       <div class="input-form">\r
+               <div class="row">\r
+                       <p><?php echo _AT('cmap_text', $_config['cmap'] );  ?></p>\r
+               </div>\r
+       </div>\r
+<?php else: ?>\r
+       <div class="input-form">\r
+               <div class="row">\r
+                       <p><?php echo _AT('cmap_missing_url');  ?></p>\r
+               </div>\r
+       </div>\r
+<?php endif; ?>\r
+<div class="input-form">\r
+| <a href="<?php echo $_SERVER['PHP_SELF']; ?>" onclick="window.open('<?php echo $_config['cmap']; ?>','cmapwin','width=800,height=720,scrollbars=yes, resizable=yes'); return false"><?php echo  _AT('cmap_own_window'); ?></a> \r
+| <a href="<?php echo $_SERVER['PHP_SELF']; ?>" onclick="window.open('http://cmap.ihmc.us/Support/Help/','cmapwin','width=800,height=720,scrollbars=yes, resizable=yes'); return false"><?php echo  _AT('cmap_help_window'); ?></a> \r
+| <br /><br />\r
+</div>\r
+<iframe name="cmap" id="cmap" title="CMAP" scrolling="yes" src="<?php echo $_config['cmap']; ?>" height="800" width="90%" align="center" style="border:thin white solid; align:center;"></iframe>\r
+\r
+\r
+\r
+<?php require (AT_INCLUDE_PATH.'footer.inc.php'); ?>
\ No newline at end of file
diff --git a/mods/cmap/module.php b/mods/cmap/module.php
new file mode 100644 (file)
index 0000000..046c947
--- /dev/null
@@ -0,0 +1,73 @@
+<?php\r
+/*\r
+This file defines privileges, and where the modules will be linked into ATutor, as tabs, tool icons, or side menu blocks.\r
+\r
+*/\r
+/*******\r
+ * doesn't allow this file to be loaded with a browser.\r
+ */\r
+if (!defined('AT_INCLUDE_PATH')) { exit; }\r
+\r
+/******\r
+ * this file must only be included within a Module obj\r
+ */\r
+if (!isset($this) || (isset($this) && (strtolower(get_class($this)) != 'module'))) { exit(__FILE__ . ' is not a Module'); }\r
+\r
+/*******\r
+ * assign the instructor and admin privileges to the constants.\r
+ */\r
+define('AT_PRIV_CMAP',       $this->getPrivilege());\r
+define('AT_ADMIN_PRIV_CMAP', $this->getAdminPrivilege());\r
+define('AT_CMAP_WSDL', 'http://greg-pc.atrc.utoronto.ca::8080/services/CmapWebService');\r
+\r
+/*******\r
+ * create a side menu box/stack.\r
+ */\r
+//$this->_stacks['cmap'] = array('title_var'=>'cmap', 'file'=>'mods/cmap/side_menu.inc.php');\r
+// ** possible alternative: **\r
+// $this->addStack('cmap', array('title_var' => 'cmap', 'file' => './side_menu.inc.php');\r
+\r
+/*******\r
+ * if this module is to be made available to students on the Home or Main Navigation.\r
+ */\r
+$_student_tool = 'mods/cmap/index.php';\r
+// ** possible alternative: **\r
+// $this->addTool('./index.php');\r
+\r
+/*******\r
+ * add the admin pages when needed.\r
+ */\r
+if (admin_authenticate(AT_ADMIN_PRIV_CMAP, TRUE) || admin_authenticate(AT_ADMIN_PRIV_ADMIN, TRUE)) {\r
+       $this->_pages[AT_NAV_ADMIN] = array('mods/cmap/index_admin.php');\r
+       $this->_pages['mods/cmap/index_admin.php']['title_var'] = 'cmap';\r
+       $this->_pages['mods/cmap/index_admin.php']['parent']    = AT_NAV_ADMIN;\r
+}\r
+\r
+/*******\r
+ * instructor Manage section:\r
+ */\r
+$this->_pages['mods/cmap/index_instructor.php']['title_var'] = 'cmap';\r
+$this->_pages['mods/cmap/index_instructor.php']['parent']   = 'tools/index.php';\r
+// ** possible alternative: **\r
+// $this->pages['./index_instructor.php']['title_var'] = 'cmap';\r
+// $this->pages['./index_instructor.php']['parent']    = 'tools/index.php';\r
+\r
+/*******\r
+ * student page.\r
+ */\r
+$this->_pages['mods/cmap/index.php']['title_var'] = 'cmap';\r
+$this->_pages['mods/cmap/index.php']['img']       = 'mods/cmap/cmap_logo.jpg';\r
+\r
+\r
+/* public pages */\r
+// $this->_pages[AT_NAV_PUBLIC] = array('mods/cmap/index_public.php');\r
+// $this->_pages['mods/cmap/index_public.php']['title_var'] = 'cmap';\r
+// $this->_pages['mods/cmap/index_public.php']['parent'] = 'login.php';\r
+// $this->_pages['login.php']['children'] = array('mods/cmap/index_public.php');\r
+\r
+/* my start page pages */\r
+// $this->_pages[AT_NAV_START]  = array('mods/cmap/index_mystart.php');\r
+// $this->_pages['mods/cmap/index_mystart.php']['title_var'] = 'cmap';\r
+// $this->_pages['mods/cmap/index_mystart.php']['parent'] = 'users/index.php';\r
+// $this->_pages['users/index.php']['children'] = array('mods/cmap/index_mystart.php');\r
+?>
\ No newline at end of file
diff --git a/mods/cmap/module.sql b/mods/cmap/module.sql
new file mode 100644 (file)
index 0000000..b9adfa9
--- /dev/null
@@ -0,0 +1,15 @@
+# sql file for Cmap module\r
+\r
+INSERT INTO `language_text` VALUES ('en', '_module', 'cmap_missing_url', 'You must supply the URL to your Cmap installation in the field below.', NOW(), '');\r
+INSERT INTO `language_text` VALUES ('en', '_module','cmap','Cmap',NOW(),'');\r
+INSERT INTO `language_text` VALUES ('en', '_module','cmap_admin_text',' The CMAP server admin can be found in the CmapTools client application, which can be downloaded from the <a href="http://cmap.ihmc.us/download/">CMAP Download Site</a>. The URL entered below should appear something like http://www.mysite.com:8080/, adjusting the port number to the one choosen during installation. See the <a href="http://cmap.ihmc.us/Documentation/index.php" target="cmap">CMAP documention</a> for installation and configuration instructions.',NOW(),'');\r
+INSERT INTO `language_text` VALUES ('en', '_module','cmap_help_window','Cmap Help Window',NOW(),'');\r
+INSERT INTO `language_text` VALUES ('en', '_module','cmap','Cmap',NOW(),'');\r
+\r
+INSERT INTO `language_text` VALUES ('en', '_module','cmap_own_window','Open Cmap in its own Window',NOW(),'');\r
+INSERT INTO `language_text` VALUES ('en', '_module','cmap_text','Use Cmap for collaborative authoring of concept maps, and to retrieve and create concept maps. For collaborative authoring download the latest <a href="http://cmap.ihmc.us/download/index.php">CmapTools client application</a>. The URL to your Cmap server is %s' ,NOW(),'');\r
+INSERT INTO `language_text` VALUES ('en', '_module','cmap_open','Open Cmap',NOW(),'');\r
+INSERT INTO `language_text` VALUES ('en', '_module','cmap_location','The location of your Cmap installation:',NOW(),'');\r
+INSERT INTO `language_text` VALUES ('en', '_msgs','AT_FEEDBACK_CMAPURL_ADD_SAVED','Location of Cmap was successfully saved.',NOW(),'');\r
+INSERT INTO `language_text` VALUES ('en', '_msgs','AT_ERROR_CMAPURL_ADD_EMPTY','You must enter a URL to the location of your Cmap installation.',NOW(),'');\r
+\r
diff --git a/mods/cmap/module.xml b/mods/cmap/module.xml
new file mode 100644 (file)
index 0000000..8dd9769
--- /dev/null
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="ISO-8859-1"?> \r
+<module version="0.1"> \r
+    <name lang="en">Cmap Concept Mapping Server</name> \r
+    <description lang="en">This module links the Cmap concept mapping server into ATutor.</description> \r
+    <maintainers>\r
+        <maintainer> \r
+            <name>ATutor Team</name> \r
+            <email>info@atutor.ca</email> \r
+        </maintainer>\r
+    </maintainers> \r
+    <url>http://atutor.ca</url> \r
+    <license>GPL</license> \r
+       <release> \r
+        <version>0.1</version> \r
+        <date>2006-09-29</date> \r
+        <state>stable</state> \r
+       <notes>A Cmap server must be running and functioning properly to make use of this module once installed. There is also a client CmapTools that can be installed on the users system so they to can interact with the server for collaborative concept map authoring. See the Cmap site for full details (http://cmap.ihmc.us/) Once the module is installed, go to the Cmap admin tool created in ATutor, and enter the URL to your Cmap server.</notes> \r
+    </release> \r
+</module>
\ No newline at end of file
diff --git a/mods/cmap/module_install.php b/mods/cmap/module_install.php
new file mode 100644 (file)
index 0000000..9168b45
--- /dev/null
@@ -0,0 +1,26 @@
+<?php\r
+/*******\r
+ * the line below safe-guards this file from being accessed directly from\r
+ * a web browser. It will only execute if required from within an ATutor script,\r
+ * in our case the Module::install() method.\r
+ */\r
+if (!defined('AT_INCLUDE_PATH')) { exit; }\r
+\r
+\r
+$_course_privilege  = TRUE; // possible values: FALSE | TRUE\r
+$_admin_privilege  = TRUE; // possible values: FALSE | TRUE\r
+//$_cron_interval    = 35; // run every 30 minutes\r
+\r
+if (!$msg->containsErrors() && file_exists(dirname(__FILE__) . '/module.sql')) {\r
+       // deal with the SQL file:\r
+       require(AT_INCLUDE_PATH . 'classes/sqlutility.class.php');\r
+       $sqlUtility =& new SqlUtility();\r
+\r
+       /*\r
+        * the SQL file could be stored anywhere, and named anything, "module.sql" is simply\r
+        * a convention we're using.\r
+        */\r
+       $sqlUtility->queryFromFile(dirname(__FILE__) . '/module.sql', TABLE_PREFIX);\r
+}\r
+\r
+?>
\ No newline at end of file