Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'v2.0Kohana3.0' of ssh://dev2.winterroot.net/var/www/git…

…/fullobject into v2.0Kohana3.0
  • Loading branch information...
commit b2b9f6b938ee4f883bcb25816ab323729c197b82 2 parents 8bf0cdf + bcfab75
Thiago de Mello Bueno authored
Showing with 0 additions and 7,186 deletions.
  1. +0 −304 modules/gms/controllers/gms.php
  2. +0 −107 modules/gms/controllers/gms_filebrowser.php
  3. +0 −57 modules/gms/controllers/gms_work.class.php
  4. +0 −33 modules/gms/gms.contents.php
  5. +0 −130 modules/gms/gms.css
  6. +0 −225 modules/gms/gms.js
  7. +0 −9 modules/gms/gms_filebrowser.contents.php
  8. +0 −146 modules/gms/gms_filebrowser.js
  9. BIN  modules/gms/images/icon_delete.gif
  10. BIN  modules/gms/images/icon_delete_hover.gif
  11. BIN  modules/gms/images/img_bg.gif
  12. +0 −20 modules/gms/settings/working.settings.php
  13. +0 −35 modules/gms/views/gms.php
  14. +0 −58 modules/gms/views/gms_filebrowser.php
  15. +0 −13 modules/gms/views/gms_image.php
  16. +0 −12 modules/listmodule/config/listmodule.php
  17. +0 −24 modules/listmodule/config/listmodule_example.php
  18. +0 −51 modules/listmodule/models/list.php
  19. +0 −397 modules/listmodule/views/listmodule.js
  20. +0 −17 modules/listmodule/views/listmodule.php
  21. +0 −24 modules/listmodule/views/listmodule_item.php
  22. +0 −15 modules/mopmvc/config/adminpage.php
  23. +0 −29 modules/mopmvc/config/data.dtd
  24. +0 −32 modules/mopmvc/config/frontend.dtd
  25. +0 −51 modules/mopmvc/config/homepagesample.txt
  26. +0 −10 modules/mopmvc/config/mop.php
  27. +0 −163 modules/mopmvc/config/objects.dtd
  28. +0 −17 modules/mopmvc/controllers/accessdenied.php
  29. +0 −7 modules/mopmvc/controllers/adminheader.php
  30. +0 −208 modules/mopmvc/controllers/display.php
  31. +0 −26 modules/mopmvc/controllers/displayadmin.php
  32. +0 −26 modules/mopmvc/controllers/displaylogin.php
  33. +0 −25 modules/mopmvc/controllers/displaypublic.php
  34. +0 −18 modules/mopmvc/controllers/error.php
  35. +0 −14 modules/mopmvc/controllers/msielanding.php
  36. +0 −7 modules/mopmvc/controllers/publicheader.php
  37. +0 −52 modules/mopmvc/controllers/publicnav.php
  38. +0 −93 modules/mopmvc/controllers/site.php
  39. 0  modules/mopmvc/controllers/virtual.php
  40. +0 −54 modules/mopmvc/helpers/frontend.php
  41. +0 −313 modules/mopmvc/helpers/mop.php
  42. +0 −29 modules/mopmvc/hooks/MOP_HTTP_Errors.php
  43. +0 −29 modules/mopmvc/hooks/mopready.php
  44. +0 −61 modules/mopmvc/hooks/protocolrouting.php
  45. +0 −19 modules/mopmvc/hooks/routingchain.php
  46. +0 −97 modules/mopmvc/hooks/slugs.php
  47. +0 −56 modules/mopmvc/hooks/staging.php
  48. +0 −46 modules/mopmvc/hooks/virtualmodules.php
  49. +0 −26 modules/mopmvc/i18n/en_US/form_errors.php
  50. +0 −21 modules/mopmvc/libraries/Database_Expr.php
  51. +0 −31 modules/mopmvc/libraries/DisplayView.php
  52. +0 −575 modules/mopmvc/libraries/MOP_Controller.php
  53. +0 −89 modules/mopmvc/libraries/MOP_DataQuery.php
  54. +0 −95 modules/mopmvc/libraries/MOP_ORM.php
  55. +0 −150 modules/mopmvc/libraries/MOP_View.php
  56. +0 −157 modules/mopmvc/libraries/MY_Database.php
  57. +0 −1  modules/mopmvc/views/404.php
  58. +0 −4 modules/mopmvc/views/accessdenied.php
  59. 0  modules/mopmvc/views/adminfooter.php
  60. +0 −1  modules/mopmvc/views/adminheader.php
  61. +0 −36 modules/mopmvc/views/adminpage.php
  62. +0 −16 modules/mopmvc/views/default.php
  63. +0 −22 modules/mopmvc/views/loginpage.php
  64. +0 −122 modules/mopmvc/views/msielanding.php
  65. 0  modules/mopmvc/views/publicfooter.php
  66. +0 −1  modules/mopmvc/views/publicheader.php
  67. +0 −13 modules/mopmvc/views/publicnav.php
  68. +0 −27 modules/mopmvc/views/publicpage.php
  69. +0 −5 modules/mopsite/config/formmail.php
  70. +0 −19 modules/mopsite/controllers/formmail.php
  71. +0 −5 modules/mopsite/controllers/mop_contact.php
  72. +0 −29 modules/mopsite/views/contact.php
  73. +0 −52 modules/oldAuth/config/auth.php
  74. +0 −189 modules/oldAuth/controllers/auth.php
  75. +0 −113 modules/oldAuth/controllers/auth_demo.php
  76. +0 −12 modules/oldAuth/controllers/keepalive.php
  77. +0 −11 modules/oldAuth/i18n/en_US/auth.php
  78. +0 −228 modules/oldAuth/libraries/Auth.php
  79. +0 −63 modules/oldAuth/libraries/drivers/Auth.php
  80. +0 −134 modules/oldAuth/libraries/drivers/Auth/File.php
  81. +0 −195 modules/oldAuth/libraries/drivers/Auth/ORM.php
  82. +0 −20 modules/oldAuth/models/auth_role.php
  83. +0 −46 modules/oldAuth/models/auth_user.php
  84. +0 −102 modules/oldAuth/models/auth_user_token.php
  85. +0 −7 modules/oldAuth/models/role.php
  86. +0 −61 modules/oldAuth/models/user.php
  87. +0 −7 modules/oldAuth/models/user_token.php
  88. +0 −19 modules/oldAuth/views/auth/forgot.php
  89. +0 −61 modules/oldAuth/views/auth/install.php
  90. +0 −14 modules/oldAuth/views/auth/template.php
  91. +0 −1  modules/oldAuth/views/noaccess.php
  92. +0 −135 modules/yaml/lib/sfYaml.php
  93. +0 −60 modules/yaml/lib/sfYamlDumper.php
  94. +0 −442 modules/yaml/lib/sfYamlInline.php
  95. +0 −610 modules/yaml/lib/sfYamlParser.php
View
304 modules/gms/controllers/gms.php
@@ -1,304 +0,0 @@
-<?
-require_once('../includes/resample.php');
-
-class GMS_Controller extends Controller{
-
- var $gallerytable = 'galleries';
- var $imagetable = 'gallery_images';
-
- var $gms_resize = array(
- 'tag' => 'thumb',
- 'width'=> 160,
- 'height'=>117,
- 'prefix'=>'thumb_',
- 'forceheight'=> true,
- );
-
- function GMS($featurettename, $arguments=null){
- parent::Featurette($featurettename);
- $this->galleryid = $_REQUEST['galleryid'];
- $this->assigns['galleryid'] = $_REQUEST['galleryid'];
-
- if($arguments){
- $this->instance = $arguments['instance'];
- } else {
- $this->instance = $_REQUEST['instance'];
- }
- if($this->instance == 'undefined'){
- $this->instance = NULL;
- }
-
- if($this->instance){
- require('../modules/gms/settings/'.$this->instance.'.settings.php');
- $this->setup = $settings;
- }
- $this->setup[] = $this->gms_resize;
- }
-
- function buildFeaturette(){
- parent::buildFeaturette();
- if($this->galleryid){
- $gallery = DB_DataObject::factory($this->gallerytable);
- $gallery->galleryid = $this->galleryid;
- if(!$gallery->find(true)){
- $gallery = DB_DataObject::factory($this->gallerytable);
- $gallery->galleryid = $this->galleryid;
- $gallery->insert();
- }
- $data = $gallery->toArray();
- foreach($data as $name => $value){
- $this->assigns[$name] = $value;
- }
- }
- $galleries = DB_DataObject::factory($this->gallerytable);
- $galleries->find();
- $this->assigns['galleries'] = array();
- while($galleries->fetch()){
- $this->assigns['galleries'][] = $galleries->toArray();
- }
- }
-
- function doActions(){
- switch($_REQUEST['action']){
- case 'add':
- $gallery = DB_DataObject::factory($this->gallerytable);
- $gallery->title = 'New Gallery';
- $this->galleryid = $gallery->insert();
- break;
- }
- }
-
- function getImageData($imageobj){
- $data = $imageobj->toArray();
-
- $imageid = $imageobj->imageid;
- foreach($this->setup as $setup){
- $data[$setup['tag'].'src'] = 'galleryimage_'.$setup['prefix'].$imageid.'.jpg';
- if(file_exists(FULLPATH.'/../media/'.'galleryimage_'.$setup['prefix'].$imageid.'.jpg')){
- $size = getImageSize(FULLPATH.'/../media/'.'galleryimage_'.$setup['prefix'].$imageid.'.jpg');
- $data[$setup['tag'].'width'] = $size[0];
- $data[$setup['tag'].'height'] = $size[1];
- }
- }
- return $data;
- }
-
- function doAjax(){
- switch($_REQUEST['action']){
- case 'load':
- $this->buildFeaturette();
- return $this->toHTML();
- break;
- case 'initgms':
- $gimages = DB_DataObject::factory($this->imagetable);
- $gimages->galleryid = $this->galleryid;
- $gimages->orderby('sortorder');
- $gimages->find();
-
- $html='';
- $data=array();
-
- while($gimages->fetch()){
- $this->assigns['image'] = $gimages->toArray();
- $this->loadTemplate('gms_image');
- $html .= $this->toHTML();
- $data[] = $this->getImageData($gimages);
- }
- $output = array('data'=>$data, 'html'=>$html);
-
- // header('Content-type: text/x-json');
- $json = new Services_JSON();
- $output = $json->encode($output);
- return $output;
-
- break;
- case 'addimage':
-
- $filename = FULLPATH.'/../uploads/'.$_REQUEST['newimage'];
- $gimage = DB_DataObject::factory($this->imagetable);
- $gimage->galleryid = $_REQUEST['galleryid'];
-// $exif = read_exif_data( $filename );
-// $gimage->photographer = $exif['IFD0']['Copyright'];
-// $date = explode(' ', $exif['DateTime']);
-// $date = $date[0];
-// $gimage->copyright_date = $date;
-
-
- $imagename = explode('/', $_REQUEST['newimage']);
- $gimage->title = $imagename[count($imagename)-1];
- $imageid = $gimage->insert();
-
- if(file_exists($filename) ) {
- $dimensions = getimagesize( $filename );
- $img_width = $dimensions[0];
- $img_height = $dimensions[1];
- }
-
-
- foreach($this->setup as $resize){
-
- //if the original image is smaller than the resize, don't resize it at all
- if($img_width <= $resize['width'] && $img_height <= $resize['height'] ) {
- copy( $filename, FULLPATH.'/../media/'.'galleryimage_'.$resize['prefix'].$imageid.'.jpg');
- continue;
- }
-
-
-
- if($img_width < $resize['width'] && $resize['forcewidth'] && $resize['height']){
- $resize['forcewidth'] = false;
- $resize['forceheight'] = true;
- } else if($img_height < $resize['height'] && $resize['forceheight'] && $resize['width']){
- $resize['forcewidth'] = true;
- $resize['forceheight'] = false;
- }
-
- //set up sizes
- if($resize['forcewidth']&&$resize['forceheight']){
- $height = $resize['height'];
- $width = $resize['width'];
- } else {
- //maintain aspect ratio
- if( (!$resize['forcewidth'] && ($img_width > $img_height) ) // might just be able to say, are we streching, and if so, skip and then just copy at the end..
-
- || $resize['forceheight'] ){
-
- //if image will strech vertically but there's no width set, don't resize
- if($img_height < $resize['height'] && !$resize['width']){
- copy( $filename, FULLPATH.'/../media/'.'galleryimage_'.$resize['prefix'].$imageid.'.jpg');
- continue;
- }
-
- //go ahead and resize
- $height = $resize['height'];
- $width = $resize['height']/$img_height * $img_width;
- } else {
-
- //if the image will stretch horizontally but there is not height set, don't resize
- if($img_width < $resize['width'] && !$resize['height']){
- copy( $filename, FULLPATH.'/../media/'.'galleryimage_'.$resize['prefix'].$imageid.'.jpg');
- continue;
- }
-
- //go ahead and resize it
- $height = $resize['width']/$img_width * $img_height;
- $width = $resize['width'];
- }
- }
-// error_log("$width $height ");
-
-
- resampimagejpg( $width, $height, $filename, FULLPATH.'/../media/'.'galleryimage_'.$resize['prefix'].$imageid.'.jpg', '0');
- chmod(FULLPATH.'/../media/'.'galleryimage_'.$resize['prefix'].$imageid.'.jpg', 0777);
- }
-
-
- $gimage = DB_DataObject::factory($this->imagetable);
- $gimage->get($imageid);
-
-
- // convert a complex value to JSON notation
-
- $this->loadTemplate('gms_image');
- $imageinfo = $gimage->toArray();
- $this->assigns['image'] = $imageinfo;
- $this->assigns['width'] = $resize['width']; // value no exist! $thumbwidth;
- $this->assigns['height'] = $resize['height']; // value no exist! $thumbheight;
- $html = $this->toHTML();
-
- $data = $this->getImageData($gimage);
-
- $output = array();
- $output['html'] = "$html";
- $output['data'] = $data;
-
- $json = new Services_JSON();
- $output = $json->encode($output);
-
- header('Content-type: text/x-json');
- return $output;
- break;
- case 'saveSortOrder':
- $order = explode(',', $_REQUEST['sortorder']);
-
- for($i=0; $i<count($order); $i++){
- $image = DB_DataObject::factory($this->imagetable);
- $image->imageid = $order[$i];
- $image->find(true);
- $orig = clone($image);
- $image->sortorder = $i+1;
- $image->update();
- }
- break;
-
- case 'delete':
- $image = DB_DataObject::factory($this->imagetable);
- $image->get($_REQUEST['imageid']);
- $image->imageid = $_REQUEST['imageid'];
- $images->galleryid = $_REQUEST['galleryid'];
- $image->delete();
- foreach($this->setup as $setup){
- unlink('galleryimage_'.$setup['prefix'].$_REQUEST['imageid'].'.jpg');
- }
- break;
-
- case 'deleteGallery':
- $gallery = DB_DataObject::factory($this->gallerytable);
- $gallery->galleryid = $_REQUEST['galleryid'];
- $gallery->delete();
- $images = DB_DataObject::factory($this->imagetable);
- $images->galleryid = $_REQUEST['galleryid'];
- $images->find();
- while($images->fetch()){
- foreach($this->setup as $setup){
- unlink('galleryimage_'.$setup['prefix'].$images->imageid.'.jpg');
- $dimage = DB_DataObject::factory($this->imagetable);
- $dimage->imageid = $images->imageid;
- $dimage->delete();
- }
- }
- break;
-
- case 'savefield':
- $gallery = DB_DataObject::factory($this->gallerytable);
- $gallery->get($_REQUEST['galleryid']);
- $orig = clone($gallery);
-
- //request string to see what fields are present
- if($_REQUEST['field']){
- $gallery->$_REQUEST['field'] = $_REQUEST['value'];
- } else {
- foreach($orig->toArray as $field=>$value){
- $gallery->$field = $_REQUEST[$field];
- }
- }
- $gallery->update($orig);
- $gallery = DB_DataObject::factory($this->gallerytable);
- $gallery->get($_REQUEST['galleryid']);
- return $gallery->$_REQUEST['field'];
- break;
-
- case 'saveimagefield':
- $image = DB_DataObject::factory($this->imagetable);
- $image->get($_REQUEST['imageid']);
- $orig = clone($image);
-
- //request string to see what fields are present
- if($_REQUEST['field']){
- $image->$_REQUEST['field'] = $_REQUEST['value'];
- } else {
- foreach($orig->toArray as $field=>$value){
- $image->$field = $_REQUEST[$field];
- }
- }
- $image->update($orig);
- $image = DB_DataObject::factory($this->imagetable);
- $image->get($_REQUEST['imageid']);
- return $image->$_REQUEST['field'];
- break;
- }
- }
-
-}
-
-?>
View
107 modules/gms/controllers/gms_filebrowser.php
@@ -1,107 +0,0 @@
-<?
-require_once('../includes/resample.php');
-class GMS_FileBrowser extends Featurette{
-
- function GMS_FileBrowser($featurettename){
- parent::Featurette($featurettename);
- }
-
- function buildFeaturette(){
- parent::buildFeaturette();
-
-
- $this->getDirectoryAssigns();
-
- }
-
- function doActions(){
- if($_FILES['uploadfile']){
- update_image('uploadfile', '/../uploads/'.$_FILES['uploadfile']['name']);
- }
- }
-
- function doAjax(){
- switch($_REQUEST['action']){
- case 'getDirectory':
- $this->getDirectoryAssigns();
- $this->loadTemplate('gms_filebrowser');
- return $this->toHTML();
- break;
-
- case 'upload':
- $ftmp = $_FILES['attachfile']['tmp_name'];
- $oname = $_FILES['attachfile']['name'];
- $directory = $_REQUEST['directory'];
-
- if(file_exists("../uploads/{$directory}$oname")){
- $xarray = explode('.', $oname);
- $nr = count($xarray);
- $ext = $xarray[$nr-1];
- $name = array_slice($xarray, 0, $nr-1);
- $name = implode('.', $name);
- $i=1;
- for(; file_exists("../uploads/{$directory}$name".$i.'.'.$ext); $i++){}
- $savename = $name.$i.'.'.$ext;
- } else {
- $savename = $oname;
- }
-
- if(!move_uploaded_file($ftmp, '../uploads/'.$directory.$savename)){
- echo 'file upload error';
- }
- ob_start()
- ?>
- <script type="text/javascript">
- window.parent.fb.reload();
- </script>
- <?php
- $js = ob_get_clean();
- return $js;
- break;
- }
- }
-
- function getDirectoryAssigns(){
- $directories = array();
- $files = array();
-
- $pathhistory = explode('/', $_REQUEST['directory']);
- if($pathhistory[count($pathhistory)-2] == '..'){
- unset($pathhistory[count($pathhistory)-1]);
- unset($pathhistory[count($pathhistory)-1]);
- unset($pathhistory[count($pathhistory)-1]);
- $currentdirectory = implode('/', $pathhistory);
- if(strlen($currentdirectory)){
- $currentdirectory = $currentdirectory . '/';
- }
- } else {
- $currentdirectory = $_REQUEST['directory'];
- }
-
- $dir = opendir(FULLPATH . '/../uploads/'.$currentdirectory);
- //sort the damn files by alpha
- while($item = readdir($dir)){
- if(strpos($item, '.') === 0)
- continue;
-
- if(is_dir(FULLPATH.'/../uploads/'.$currentdirectory.$item)){
- $directories[] = array(
- 'directory' =>$currentdirectory.$item,
- 'name' => $item
- );
- } else {
- $data['filename'] = $item;
- $data['path'] = $fullpathitem;
- $files[] = $data;
- }
- }
- $this->assigns['directories'] = $directories;
- $this->assigns['files'] = $files;
- $this->assigns['currentdirectory'] = $currentdirectory;
-
-
- }
-
-}
-
-?>
View
57 modules/gms/controllers/gms_work.class.php
@@ -1,57 +0,0 @@
-<?
-require('../modules/gms/gms.class.php');
-class gms_work extends gms{
-
- var $setup = array (
- array(
- 'tag' => '',
- 'width'=>708,
- 'height'=>329,
- 'path'=> "../media/gallerymodule/galleryimages/",
- 'forceheight'=>true,
- ),
- array(
- 'tag' => 'userthumb',
- 'width'=> 90,
- 'height'=>40,
- 'path'=> "../media/gallerymodule/galleryimagesuserthumbs/",
- 'forcewidth'=> true,
- ),
- array(
- 'tag' => 'thumb',
- 'width'=> 160,
- 'height'=>117,
- 'path'=> "../media/gallerymodule/galleryimagesthumbs/",
- 'forceheight'=> true,
- ),
-
- );
-
- function gms_work($featurettename){
- parent::gms($featurettename);
- }
-
- function buildFeaturette(){
- parent::buildFeaturette();
- }
-
- function loadContent(){
- parent::loadContent('gms');
- }
-
- function loadTemplate( $module = 'gms'){
- parent::loadTemplate($module);
- }
-
- function loadCSS($module = 'gms'){
- parent::loadCSS($module);
- }
-
- function loadJS($module='gms'){
- parent::loadJS($module);
- }
-
-
-}
-
-?>
View
33 modules/gms/gms.contents.php
@@ -1,33 +0,0 @@
-<?
-
-$content = array(
-
- array(
- 'name' => 'gms_navigation',
- 'type' => 'inlinefeaturette',
- 'featurettename' => 'gms_navigation'
- ),
- array(
- 'name' => 'gms_filebrowser',
- 'type' => 'inlinefeaturette',
- 'featurettename' => 'gms_filebrowser'
- ),
- array(
- 'name' => 'gms_selection',
- 'type' => 'inlinefeaturette',
- 'featurettename' => 'gms_selection'
- ),
- array(
- 'name' => 'gms_info',
- 'type' => 'inlinefeaturette',
- 'featurettename' => 'gms_info'
- ),
- array(
- 'name' => 'gms_commands',
- 'type' => 'inlinefeaturette',
- 'featurettename' => 'gms_commands'
- ),
-);
-
-
-?>
View
130 modules/gms/gms.css
@@ -1,130 +0,0 @@
-.filemanager{
- float:left;
- font-family:helvetica,arial,sans-serif;
- position:relative;
- left: -175px;
- margin:0 -175px 0 0;
- height:504px;
- width:175px;
-}
-
-.filebrowser{
- height:480px;
- overflow:auto;
-}
-
-.recepticle{
- width:700px;
- height:504px;
- margin:0;
- padding-left:10px;
- padding-top:14px;
- list-style:none;
- overflow:auto;
- background: #f8f8f8 url( "images/navbg.gif" ) repeat-y;
-}
-
-
-.filelisting{
- list-style:none;
- margin:0;
- padding:0;
-}
-
-.filelisting h4{
- width:105px;
- overflow:hidden;
- white-space:nowrap;
- float:left;
-}
-
-.recepticle h4,
-.filelisting h4{
- color:#666;
- margin:0;
- padding:0;
- font-size:10px;
- font-weight:normal;
-}
-
-.filelisting .deletelink{
- position:relative;
- margin-bottom: -16px;
- top:100px;
- left:100px;
-}
-
-.filelisting img.icon{
- display:block;
- float:left;
- margin:4px 10px 0 0;
-}
-
-.recepticle img.icon{
- float:left;
-}
-
-/*
-.uploadform{
- border:2px #f00 solid;
- z-index:250;
- position:absolute;
- top:153px;
- left:270px;
-}
-.uploadformdiv{
- z-index:250;
- position:absolute;
- top:153px;
- left:270px;
- width:320px;
- padding:10px;
- background:#fff;
- font-family: helvetica, arial, sans-serif;
- border: 3px #000 solid;
-}
-
-.uploadelements{
- margin:10px;
- padding:20px;
- height: 150px;
- border:1px dotted #000;
- background: url( "../images/90percent.png" );
- border:10px #f00 solid;
-}
-
-.uploadelements input{
- border:1px #f00 solid;
- margin:0 0 10px 0;
-}
-
-.uploadelements h4{
- border: 2px #f00 solid;
- margin:0 0 15px 0;
- font-family: helvetica, arial, sans-serif;
-}*/
-
-.recepticle li.thumbnail{
- float:left;
- margin:0 10px 10px 0;
- padding:0;
- width:160px;
- height:170px;
- overflow:hidden;
-}
-
-.filelisting li{
- clear:both;
- margin:0;
- padding:0 0 0 10px;
- height:25px;
- line-height:25px;
- border-bottom:1px #cecece solid;
- background-image: url( "../images/navbg.gif" );
- color:#333;
-}
-
-.filelisting li .title{
- white-space:nowrap;
- margin:0 0 2px 0;
-}
View
225 modules/gms/gms.js
@@ -1,225 +0,0 @@
-MOP.GMS = new Object();
-MOP.GMS.Module = Class.extend({
- initialize: function( anElement, gallery, galleryid, modulename, instance, options ){
- this.element = $(anElement);
- this.gallery = gallery;
- this.galleryid = galleryid;
- this.modulename = modulename;
- this.instance = instance;
- this.options = Object.extend({
- queryTemplates: {
- init: new Template( 'module=#{modulename}&instance=#{instance}&action=initgms&galleryid=#{galleryid}' ),
- rename: new Template( 'module=#{modulename}&instance=#{instance}&action=savefield&galleryid=#{galleryid}&field=title&value=${value}' ),
- addImage: new Template( 'module=#{modulename}&instance=#{instance}&action=addimage&galleryid=#{galleryid}&newimage=#{image}' ),
- removeImage: new Template( 'module=#{modulename}&instance=#{instance}&action=delete&galleryid=#{galleryid}&imageid=#{imageid}' ),
- saveSortOrder: new Template( 'module=#{modulename}&instance=#{instance}&action=saveSortOrder&galleryid=#{galleryid}&sortorder=#{serialization}' ),
- inPlaceEdit: new Template( 'module=#{modulename}&instance=#{instance}&action=saveimagefield&imageid=#{imageid}&field=${fieldname}&value=${value}' )
- },
- onRename: function( form, value ){
- var templateFilter = { modulename: this.modulename, instance: this.instance, galleryid: this.galleryid, value: value };
- var queryString = this.options.queryTemplates.rename.evaluate( templateFilter );
- return queryString;
- },
- }, options || {} );
-
- this.loadImages();
- },
-
- toString: function(){
- return "[ Object, MOP.GMS.Module ]";
- },
-
- loadImages: function(){
- var templateFilter = { modulename: this.modulename, instance: this.instance, galleryid: this.galleryid };
- var queryString = this.options.queryTemplates.init.evaluate( templateFilter);
- var cb = this.onGMSLoaded.bind( this );
- var myAjax = new Ajax.JSONRequest( 'ajaxsrv.php', {
- method: 'post',
- parameters: queryString,
- onSuccess: cb
- });
- },
-
- onGMSLoaded: function( gallerydata ){
- this.gms = new MOP.GMS.Gallery( this.element, this, this.galleryid, gallerydata, this.modulename );
- this.options.controls.donesortingbutton.onclick = this.gms.saveOrder.bindAsEventListener( this.gms );
- },
-
- onRename: function( form, value ){
- this.options.onRename.bind( this, form, value );
- },
-
- addImage: function( img ){
- this.gms.addImage( img );
- }
-});
-
-MOP.GMS.Gallery = Class.extend({
- initialize: function( element, module, gid, gallerydata, modulename ){
- this.galleryid = gid;
- this.module = module;
- this.instance = module.instance;
- this.element = $( element );
- this.modulename = modulename;
- this.gallerydata = gallerydata;
- this.element.innerHTML = gallerydata.html;
- var imagecount = this.gallerydata.data.length;
- for( var i = 0; i < imagecount; i++ ){
- new MOP.GMS.Image( this, this.gallerydata.data[ i ] );
- };
- this.makeSortable();
- if( $('gallerytitle'+this.galleryid) != undefined ) this.makeFieldEditable( 'gallerytitle'+ this.galleryid, 'title', 1, 40 );
- },
-
- toString: function(){
- return "[ Object, MOP.GMS.Gallery ]";
- },
-
- makeFieldsEditable: function( element, aFieldName, rows, size ){
- var cb = this.options.onRename.bind( this, aFieldName);
- rows = (rows)? rows : 1;
- size = (size)? size : 30;
- new MOP.Ajax.InPlaceEditor( element, 'ajaxsrv.php', {
- rows: rows,
- size: size,
- callback: cb
- });
- },
-
- makeSortable: function(){
- Position.includeScrollOffsets = true;
- if( this.element.id == "" ){
- var now = new Date();
- var newid = 'sortable_' + now.getYear() + now.getMonth() + now.getHours() + now.getMinutes() + now.getSeconds() + now.getMilliseconds();
- this.element.id = newid;
- }
- Sortable.destroy( this.element );
- Sortable.create( this.element, { constraint: false, overlap: "horizontal" } );
- },
-
- onSort: function(){
- if( this.options.controls.donesortingbutton.getStyle("display") == 'none' ) new Effect.BlindRight( this.options.controls.donesortingbutton, { duration: .5 } );
- },
-
- addImage: function( image ){
- var placeholder = this.getPlaceholder();
- var cb = this.insertImage.bind( this, placeholder );
- this.element.insertBefore( placeholder, this.element.firstDescendant() );
- var queryString = 'module='+this.modulename+'&instance='+this.instance+'&action=addimage&galleryid='+this.galleryid+'&newimage='+image;
- var myAjax = new Ajax.JSONRequest( 'ajaxsrv.php', {
- method: 'post',
- parameters: queryString,
- onSuccess: cb,
- });
- return false;
- },
-
- getPlaceholder: function(){
- var element = $( document.createElement( "LI" ));
- element.addClassName("thumbnail");
- var icon = document.createElement("IMG");
- icon.src = "images/spinner.gif";
- icon.width = icon.height = 16;
- icon.alt = "Adding image...";
- var h = $( document.createElement("H4") );
- h.addClassName("ineditable");
- h.addClassName("title");
- var span = $(document.createElement("SPAN"));
- span.update("Adding image...");
- h.appendChild( icon );
- h.appendChild( span );
- element.appendChild( h );
- return element;
- },
-
- insertImage: function(){
- var placeholder = $A(arguments)[0];
- var img = $A( arguments )[1];
- var newnode = this.element.insertTop( img.html );
- // hmmm this is a little weird, instead of telling the element, the image uses the id in the json object to 'bless' the element...
- new MOP.GMS.Image( this, img.data );
- placeholder.remove();
- this.makeSortable();
- },
-
- removeImage : function( imgInstance ){
- var imgid = imgInstance.data.imageid;
- var cb = function(){
- imgInstance.element.remove();
- delete imgInstance;
- };
- cb.bind( this );
- var myAjax = new Ajax.Request( 'ajaxsrv.php', {
- method: 'post',
- parameters: 'module='+this.modulename+'&instance='+this.instance+'&action=delete&galleryid='+ this.galleryid + '&imageid=' + imgid,
- onComplete: cb
- });
- },
-
- saveOrder: function( e ){
- var button = Event.element( e );
- button.update("Saving sort order...");
- var serialization = this.serialize();
- var queryString = 'module='+this.modulename+'&instance='+this.instance+'&action=saveSortOrder&galleryid=' + this.galleryid + '&sortorder=' + serialization;
- var cb = this.module.gallery.doneEditing.bind( this.module.gallery );
- this.module.gallery.showVeil();
- var myajax = new Ajax.Request( 'ajaxsrv.php', {
- method: 'post',
- parameters : queryString,
- onComplete: cb
- });
- return false;
- },
-
- serialize: function(){
- var serialArray = new Array();
- var children = this.element.getElementsByClassName('thumbnail');
- var childcount = children.length;
- for( var i=0; i < childcount; i++ ){
- serialArray.push( children[i].id.split("_")[1] );
- };
- return serialArray.join(',');
- }
-});
-
-MOP.GMS.Image = Class.extend({
- initialize: function( gms, data ){
- this.data = data;
- this.gms = gms;
- this.element = $( 'thumb_'+data.imageid );
- this.title = this.element.getElementsByClassName( 'title' )[0];
- this.makeTitleEditable( this.title, this.data.imageid, 'title', 1, 10 );
- this.deletelink = this.element.getElementsByClassName( 'deletelink' )[0];
- this.deletelink.onclick = this.destroy.bind( this );
- this.deletelink.onmouseover = this.indicateDeleteLink.bind( this );
- this.deletelink.onmouseout = this.deIndicateDeleteLink.bind( this );
- },
-
- indicateDeleteLink: function(){
- this.deletelink.firstDescendant().src = "../modules/gms/images/icon_delete_hover.gif";
- },
-
- deIndicateDeleteLink: function(){
- this.deletelink.firstDescendant().src = "../modules/gms/images/icon_delete.gif";
- },
-
- makeTitleEditable: function( element, imgid, fieldname, rows, cols ){
- var modulename = this.gms.modulename;
- var cb = function( form, value ){
- var returnvalue = "module="+ modulename +'&instance='+this.instance+"&action=saveimagefield&imageid=" + imgid + "&field=" + fieldname + "&value=" + escape( value );
- return returnvalue;
- };
- new MOP.Ajax.InPlaceEditor( element, 'ajaxsrv.php', { rows: rows, size: cols, callback: cb } );
- },
-
- toString: function(){
- return "[ Image, " + this.data.imageid + " ]";
- },
-
- destroy: function(){
- this.deletelink.onmouseover = this.deletelink.onmouseout = null;
- this.deletelink.firstDescendant().src = "images/icon_spinner.gif";
- this.gms.removeImage( this );
- return false;
- }
-});
View
9 modules/gms/gms_filebrowser.contents.php
@@ -1,9 +0,0 @@
-<?
- $content = array(
- array(
- 'name' => 'xfileupload',
- 'type' => 'inlinefeaturette',
- 'featurettename' => 'xfileupload'
- )
- );
-?>
View
146 modules/gms/gms_filebrowser.js
@@ -1,146 +0,0 @@
-
-MOP.FileBrowser = Class.extend({
-
- initialize: function( galleryController, anElement, aDirectory ){
- this.gallery = galleryController;
- this.element = $( anElement );
- this.directories = this.element.getElementsByClassName( 'directory' );
- this.files = this.element.getElementsByClassName( 'file' );
- this.uploadForm = this.element.getElementsByClassName('uploadform')[0];
- this.currentdirectory = this.uploadForm.firstDescendant().getInputs('hidden','directory')[0];
- this.uploadFileInput = this.uploadForm.firstDescendant().getInputs('file')[0];
- this.uploadSubmitButton = this.uploadForm.firstDescendant().getInputs('button')[0];
-
- this.uploadSpinner = this.uploadForm.getElementsByClassName('spinner')[0];
-
- this.uploadLink = this.element.getElementsByClassName('uploadlink' )[0];
- this.uploadLink.onclick = this.showUploadForm.bind( this );
- this.uploadSubmitButton.onclick = this.uploadFile.bind(this);
-
- var directorycount = this.directories.length;
- for( var i=0; i < directorycount; i++ ){
- new MOP.FileBrowserDirectory( this.directories[i], this );
- };
- var filecount = this.files.length;
- for( var i=0; i < filecount; i++ ){
- new MOP.FileBrowserFile( this.files[i], this );
- };
- },
-
- reload: function(){
- this.gallery.loadFileBrowser( this.getCurrentDirectory() );
- },
-
- showUploadForm: function(){
- new Effect.Appear( this.uploadForm );
- return false;
- },
-
- hideUploadForm: function(){
- new Effect.Fade( this.uploadForm );
- },
-
- onUploadComplete: function(){
- hideUploadForm();
- this.uploadSpinner.hide();
- },
-
- toString: function(){
- return "[ Object, MOP.FileBrowser ]";
- },
-
- getCurrentDirectory: function(){
- return this.currentdirectory.value;
- },
-
- uploadFile: function(){
- var filename = this.uploadFileInput.value;
- var ext = filename.substr( filename.length - 3 , filename.length );
- if( ext.toLowerCase() != 'jpg'){
- alert("In order to upload an image, said image must be in JPG format.");
- return false;
- }
- this.uploadForm.firstDescendant().submit();
- this.uploadSpinner.show();
- return false;
- }
-
-});
-
-MOP.FileBrowserDirectory = Class.extend({
- initialize: function( anElement, filebrowser ){
- this.element = $( anElement );
- this.filebrowser = filebrowser;
- this.dir = this.element.id;
- this.link = this.element.getElementsByTagName('A')[0];
- this.link.onclick = this.getDirectory.bind( this );
- },
-
- getDirectory: function(){
- this.filebrowser.gallery.loadFileBrowser( this.filebrowser.getCurrentDirectory() + this.dir + "/" );
- return false;
- }
-});
-
-MOP.FileBrowserFile = Class.extend({
- initialize: function( anElement, filebrowser ){
- this.element = $( anElement );
- this.filebrowser = filebrowser;
- var addlink = this.element.getElementsByClassName("addbutton")[0];
-// var previewlink = this.element.getElementsByClassName("previewbutton")[0];
- addlink.onclick = this.addImageToGallery.bind( this );
-// previewlink.onclick = this.showPreview.bind( this );
- },
-
- addImageToGallery: function(){
- var src = this.filebrowser.getCurrentDirectory() + this.element.getElementsByClassName('filename')[0].innerHTML;
-// console.log( src + " : " + this.filebrowser.gallery.addImage );
- this.filebrowser.gallery.addImage( src );
- return false;
- },
-
- showPreview: function(e){
- // var mx = Event.pointerX(e);
- // var my = Event.pointerY(e);
- // var acallback = function(){ showPreview( this.getThumbSrc(), mx, my, this.data.thumbheight/2) };
- // showPreviewTimeout = setTimeout( acallback.bind(this), 600 );
- }
-});
-//
-// MOP.GMS.ImagePreview = Class.extend({
-//
-// initialize: function(){
-// this.element = document.createElement('div');
-// this.element.setStyle({display:'none'});
-// this.element.addClassName("gmspreview");
-// this.previewimage;
-// document.body.appendChild(this.element);
-// },
-//
-// show: function( imgsrc, x, y, yoffset ){
-// if(this.previewimage) this.element.removeChild( this.previewimage );
-// if(this.pointer) this.element.removeChild( this.pointer );
-//
-// this.previewimage = document.createElement( 'img' );
-// this.previewimage.addClassName('previewimage');
-// this.previewimage.src = imgsrc;
-//
-// this.pointer = document.createElement( 'img' );
-// this.pointer.src = 'images/icon_pointer.png';
-// this.pointer.width = this.pointer.height = 16;
-// this.pointer.alt = "pointer";
-//
-// this.pointer.setStyle({
-// position:"relative", top: -(yoffset+20)+"px"
-// });
-//
-// this.element.appendChild( this.pointer );
-// this.element.appendChild(this.previewimage);
-// this.element.setStyle({ left: (x+40)+"px", top: (y-yoffset)+"px" } );
-// new Effect.Appear(this.element, {duration:.3});
-// },
-//
-// hide: function(){
-// new Effect.Fade(this.element,{duration:.3});
-// }
-// });
View
BIN  modules/gms/images/icon_delete.gif
Deleted file not rendered
View
BIN  modules/gms/images/icon_delete_hover.gif
Deleted file not rendered
View
BIN  modules/gms/images/img_bg.gif
Deleted file not rendered
View
20 modules/gms/settings/working.settings.php
@@ -1,20 +0,0 @@
-<?
- $settings = array (
- array(
- 'tag' => '',
- 'height'=>250,
- 'prefix'=>'',
- 'forceheight'=>true,
- ),
- /*
- array(
- 'tag' => 'thumb',
- 'width'=> 90,
- 'height'=>40,
- 'prefix'=>'userthumb_',
- 'forcewidth'=> true,
- ),
- */
-
- );
-?>
View
35 modules/gms/views/gms.php
@@ -1,35 +0,0 @@
-<div id="fileupload" style="display:none;">
- <?=$fileupload;?>
-</div>
-<form id="gmsform" name="form" method="POST" enctype="multipart/form-data" action="<?=$_SERVER['PHP_SELF'];?>?module=gms">
-
-<?if(!$_REQUEST['hidegallerylisting']):?>
- <div id="gallerylisting">
- <select onchange="gidval = this.value;">
- <option>- Select a gallery -</option>
- <? foreach($galleries as $gallery):?>
- <option value="<?=$gallery['galleryid'];?>" >
- <?=$gallery['title'];?>
- </option>
- <? endforeach; ?>
- </select>
- <input type="button" onclick="window.location.href='site.php?module=gms&amp;galleryid='+gidval;" value="edit" />
- <input type="button" onclick="window.location.href='site.php?module=gms&amp;action=add';" value="add new gallery" />
- <input type="hidden" name="galleryid" value="<?=$galleryid;?>" />
- <input type="hidden" name="action" value="save" />
- </div>
-<?endif;?>
-
-<? if($_REQUEST['galleryid']):?>
-
- <?if(!$_REQUEST['hidegallerylisting']):?>
- <h2 class="pagetitle">
- <span id="gallerytitle<?=$_REQUEST['galleryid'];?>" class="editable"><?=$title;?></span>
- <a href="#" id="deletelink_<?=$_REQUEST['galleryid'];?>"><img src="../modules/cms/images/icon_delete.gif" class="icon" width="16" height="16" alt="delete this page" onclick="deleteItem( '<?=$pageid;?>', this );" />
- <div class="clearboth"></div>
- </h2>
- <?endif;?>
-
-<?endif;?>
-
-</form>
View
58 modules/gms/views/gms_filebrowser.php
@@ -1,58 +0,0 @@
- <ul class="filelisting">
-
- <li class="currentdir" id="<?=$currentdirectory;?>" >
- <img class="icon" src="images/icon_folderopen.gif" width="16" height="16" alt="<?=$currentdirectory;?>" / >
- <h4 class="title"><?if($currentdirectory == ""):?>./<?else:?><?=$currentdirectory;?><?endif;?></h4>
- </li>
-
- <li class="directory" id="..">
- <h4 class="filename">
- <a href="#"><img class="icon" src="images/icon_updir.gif" width="16" height="16" alt="../" / >../</a>
- </h4>
- </li>
-
- <?foreach($directories as $directory):?>
- <li class="directory" id="<?=$directory['name'];?>">
- <h4 class="filename">
- <a href="#"><img class="icon" src="images/icon_folder.gif" width="16" height="16" alt="<?=$directory['name'];?>" / ><?=$directory['name'];?></a>
- </h4>
- </li>
- <?endforeach;?>
-
- <?foreach($files as $index => $file):?>
- <li class="file" id="file_<?=$index;?>">
- <h4 class="title">
- <img class="icon" alt="icon" src="images/icon_image.gif" height="16" width="16">
- <span class="filename"><?=$file['filename'];?></span>
- </h4>
- <a title="add this image to gallery" class="addbutton" href="#"><img alt="add this image to gallery" src="images/icon_addimage.gif" height="16" width="16" /></a>
- </li>
- <?endforeach;?>
- </ul>
-
- <a title="upload file to current directory" class="uploadlink button" href="#">
- <img class="icon" src="images/icon_uploaddocument.gif" width="16" height="16" alt="upload icon" />upload image
- </a>
-
- <iframe name="hiddenframe" id="hiddenframe" style="display:none;"></iframe>
- <div class="uploadform" style="display:none">
- <form name="fileform" action="ajaxsrv.php?module=gms_filebrowser" method="post" target="hiddenframe" enctype="multipart/form-data">
- <div class="elements">
- <h4>Add file to current directory!</h4>
- <div class="formgroup">
- <input type="hidden" name="action" value="upload" />
- <!-- <input type="hidden" name="pageid" value="<?=$pageid;?>"> -->
- <input type="hidden" name="uniqueid" id="input_fileuniqueid" value="" />
- <input type="hidden" name="directory" value="<?=$currentdirectory;?>" />
- <input id="documentfile" type="file" name="attachfile" />
- </div>
- <div class="formgroup">
- <img src="images/spinner.gif" width="16" height="16" alt="uploading file, please wait..." class="spinner" style="display:none" />
- </div>
- <div class="formgroup">
- <input type="button" class="submit" value="start upload"/>
- </div>
- </div>
- </form>
- <div class="clearboth"></div>
- </div>
View
13 modules/gms/views/gms_image.php
@@ -1,13 +0,0 @@
-<?
-if( strlen( $image['title'] ) > 14 ){
- $title = substr( $image['title'], 0, 13 )."&hellip;"."jpg";
-} else {
- $title = $image['title'];
-};
-?>
-
-<li class="thumbnail" id="thumb_<?=$image['imageid'];?>">
- <a href="#" class="deletelink"><img src="../modules/gms/images/icon_delete.gif" alt="delete this image" /></a>
- <h4 class="title editable"><?=$title;?></h4>
- <img class="thumb" src= "../media/galleryimage_thumb_<?=$image['imageid'];?>.jpg" width="<?=$image['width']?>" height="<?=$image['height'];?>" alt="<?=$image['title'];?>" />
-</li>
View
12 modules/listmodule/config/listmodule.php
@@ -1,12 +0,0 @@
-<?
-
-
-$config['uiresize'] = array(
- 'width'=>138,
- 'height'=>75,
- 'prefix' => 'uithumb',
- 'forceheight'=>false,
-);
-
-
-$config['sortdirection'] = 'ASC';
View
24 modules/listmodule/config/listmodule_example.php
@@ -1,24 +0,0 @@
-<?
-
-/*
- $config['resources']['js'] = array(
- );
- */
-
- $config['fields'] = array(
- 'name'=>'text',
- );
-
- $config['labels'] = array(
- 'name'=>'Name',
- );
-
- $config['dbmap'] = array(
- 'name'=>'field1',
- );
-
- $config['files']['file'] = array(
- 'extensions' => array("jpg","gif","png")
- );
-
-
View
51 modules/listmodule/models/list.php
@@ -1,51 +0,0 @@
-<?
-
-Class List_Model extends ORM {
-
- private $fileFields = array('file', 'file2');
-
- private $dbmap = null;
-
- public function __constructor($id = null){
- parent::__constructor($id);
- }
-
- public function find_by_page_id($page_id, $instance){
- $this->where('page_id', $page_id)
- ->where('instance', $instance)
- ->where('activity', 'NULL')
- ->orderBy('sortorder')
- ->find_all();
- }
-
- /* for any GET we should know the instance beforehand
- * and then can use this to dbmap
- *
- * for SET it's a little trickier, because the instance
- * might not have been SET yet
- */
-
- public function __get($column){
- if(in_array($column, $this->fileFields) && !is_object(parent::__get($column)) ){
- $file = ORM::Factory('file', parent::__get($column));
- if($file->loaded){
- parent::__set($column,ORM::Factory('file', parent::__get($column)));
- } else {
- parent::__set($column, ORM::Factory('file') );
- }
- } else if($this->loaded) {
- //attempt to dbmap
- if(!$this->dbmap){
- $instance = parent::__get('instance');
- $this->dbmap = Kohana::config($instance.'.dbmap');
- }
- if(isset($this->dbmap[$column])){
- $column = $this->dbmap[$column];
- }
-
- }
- return parent::__get($column);
-
- }
-
-}
View
397 modules/listmodule/views/listmodule.js
@@ -1,397 +0,0 @@
-
-mop.modules.ListModule = new Class({
-
- /* TODO write unit tests for List*/
-
- Extends: mop.modules.Module,
-
- // listing properties and members, helps with maintenance and destruction.... standard practice from now on
- sortable: null,
- sortDirection: null,
- instanceName: null,
- addItemDialogue: null,
- items: null,
- controls: null,
- sortableList: null,
- scroller: null,
- submitDelay: null,
- oldSort: null,
-
-
- initialize: function( anElement, aMarshal, options ){
-
- this.parent( anElement, aMarshal, options );
-
- delete this.items;
- this.items = null;
- this.items = [];
-
- this.sortable = ( this.getValueFromClassName( "sortable" ) == "false" ) ? false : true;
- console.log("!!!!!!!!");
- this.sortDirection = ( this.getValueFromClassName( "sortDirection" );
-
- if( this.sortable ) this.makeSortable();
- },
-
- toString: function(){
- return "[ object, mop.modules.ListModule ]";
- },
-
- build: function(){
- this.parent();
- this.initControls();
- this.addItemDialogue = null;
-// console.log( "build", this.toString() );
- this.initList();
- },
-
- initList: function(){
- delete this.items;
- this.items = null;
- this.items = [];
- this.listing = this.element.getElement( ".listing" );
- var children = this.listing.getChildren("li");
- children.each( function( element ){
- this.items.push( new mop.modules.ListItem( element, this, this.addItemDialogue ) );
- }, this );
- },
-
- toggleSortable: function(){
- if( this.sortable ){ this.killSortable(); }else{ this.makeSortable(); }
- },
-
- initControls: function(){
- // console.log( this.element.getElement( "#" + this.instanceName+"AddItemModal" ).retrieve("Class") );
- this.controls = this.element.getChildren( ".controls" );
- var addItemButton = this.controls.getElement( ".addItem" ).addEvent("click", this.addItem.bindWithEvent( this ) );//this.showModal.bindWithEvent( this, $( this.instanceName+"AddItemModal" ) ) );
- if( this.sortable ){
- var saveSort = this.controls.getElement( ".saveSort" ).addEvent("click", this.saveSort.bindWithEvent( this ) );
- saveSort = null;
- }
- addItemButton = null;
- },
-
- makeSortable: function(){
- if( this.sortable && !this.sortableList ){
- this.sortableList = new mop.ui.Sortable( this.listing, this, {
- scrollElement: window,
- clone: true,
- snap: 12,
- revert: true,
- velocity: .97,
- area: 24,
- constrain: true,
- onComplete: function( el ){
- if(!this.moved) return;
- this.moved = false;
- this.scroller.stop();
- this.marshal.onOrderChanged();
- },
- onStart: function(){
- this.moved = true;
- this.scroller.start();
- }
- });
- }else if( this.sortable ){
- this.sortableList.attach();
- }
- this.oldSort = this.serialize();
- },
-
- resumeSort: function(){
- if( this.sortable && this.sortableList ) this.sortableList.attach();
- },
-
- suspendSort: function(){
- if( this.sortable && this.sortableList ) this.sortableList.detach();
- },
-
- killSortable: function(){
- this.sortableList.detach();
- delete this.sortableList;
- this.sortableList = null;
- },
-
- onOrderChanged: function(){
- var newOrder = this.serialize();
- clearInterval( this.submitDelay );
- this.submitDelay = this.submitSortOrder.periodical( 3000, this, newOrder.join(",") );
- newOrder = null;
- },
-
- submitSortOrder: function( newOrder ){
- if( this.sortable && this.oldSort != newOrder ){
- clearInterval( this.submitDelay );
- this.submitDelay = null;
- this.JSONSend( "saveSortOrder", { sortorder: newOrder } );
- this.oldSort = newOrder;
- }
- },
-
- addItem: function( e ){
- if( e && e.preventDefault ){
- e.preventDefault();
- }else{
- e.returnValue = false;
- }
-
- if( this.addItemDialogue ) this.removeModal( this.addItemDialogue );
- this.addItemDialogue = new mop.ui.EnhancedAddItemDialogue( null, this );
- this.addItemDialogue.showLoading( e.target.get("text") );
-
- this.JSONSend( "addItem", null, {
- onComplete: function( json ){
- this.onItemAdded( json );
- }.bind( this )
- });
- },
-
- onItemAdded: function( json ){
- var element = this.addItemDialogue.setContent( json.response, this.controls.getElement( ".addItem" ).get( "text" ) );
- var listItem = new mop.modules.ListItem( element, this, this.addItemDialogue, { scrollContext: 'modal' } );
- listItem.uiElements.each( function( uiInstance ){
- uiInstance.scrollContext = "modal";
- });
- listItem.filesToTop();
- this.items.push( listItem );
- this.addItemDialogue.show();
- listItem = null;
- },
-
- removeModal: function( aModal ){
- if( !this.addItemDialogue ) return;
- this.addItemDialogue = null;
- },
-
- insertItem: function( anElement ){
- var where = ( this.sortDirection == "DESC" )? "top" : "bottom";
- this.listing.grab( anElement, where );
- if( this.sortable && this.sortableList ) this.sortableList.addItems( anElement );
-
- // reset scrollContexts
- var listItemInstance = anElement.retrieve("Class");
- listItemInstance.scrollContext = 'window';
- listItemInstance.resetFileDepth();
- listItemInstance.uiElements.each( function( uiInstance ){
- uiInstance.scrollContext = "window";
- });
- anElement.tween( "opacity", 1 );
- anElement.getElement(".itemControls" ).getElement(".delete").removeClass("hidden");
-
- if( this.sortable != null ) this.onOrderChanged();
- listItemInstance = where = null;
- },
-
- serialize:function(){
- console.log( this.toString(), "serialize", this.listing, this.listing.getChildren() )
- var sortArray = [];
-
- //get all the items to serialize
- var children = this.listing.getChildren("li");
- children.each( function ( aListing ){
-
- var listItemId = aListing.get("id");
- var listItemIdSplit = listItemId.split( "_" );
- listItemId = listItemIdSplit[ listItemIdSplit.length - 1 ];
- sortArray.push( listItemId );
- });
- try{
- return sortArray;
- }finally{
- sortArray = null;
- }
- },
-
- onItemDeleted: function( anItem ){
- this.items.erase( anItem );
- anItem.destroy();
- delete anItem;
- anItem = null;
- mop.util.EventManager.broadcastEvent( "resize" );
- //again we should be removing from this.items
- //this is a potential memory leak, since adding and removing many times will leave
- //baggage around since it's not removed from this.items, now we have a class with all vars and methods deleted
- },
-
- destroy: function(){
-
- //We only want to killSortable if the list is currently sortable
- //It might now be, if an IPE is open and the user hits the trash can
- if(this.sortableList){
- this.killSortable();
- }
-
- if( this.items ){
-
- while( this.items.length > 0 ){
- var aChild = this.items.pop();
- aChild.destroy();
- delete aChild;
- aChild = null;
- };
-
- };
-
- clearInterval( this.submitDelay );
-
- this.removeModal();
-
- delete this.modal;
- delete this.addItemDialogue;
- delete this.controls;
- delete this.instanceName;
- delete this.items;
- delete this.listing;
- delete this.oldSort;
- delete this.scroller;
- delete this.sortable;
- delete this.sortDirection;
- delete this.submitDelay;
-
- this.addItemDialogue = null;
- this.controls = null;
- this.instanceName = null;
- this.items = null;
- this.listing = null;
- this.oldSort = null;
- this.scroller = null;
- this.sortable = null;
- this.sortDirection = null;
- this.submitDelay = null;
-
- mop.util.EventManager.broadcastEvent( 'resize' );
- this.parent();
- }
-
-});
-
-mop.modules.ListItem = new Class({
-
- Extends: mop.modules.Module,
-
- Implements: [ Events, Options ],
-
- addItemDialogue: null,
- objectId: null,
- scrollContext: null,
- controls: null,
- fadeOut: null,
-
- //trash: false, // set to true when an item is destroyed
-
- initialize: function( anElement, aMarshal, addItemDialogue, options ){
- this.element = $( anElement);
- this.element.store( "Class", this );
- this.marshal = aMarshal;
- this.instanceName = this.element.get( "id" );
- this.addItemDialogue = addItemDialogue;
- this.objectId = this.element.get("id").split("_")[1];
- if( options && options.scrollContext ) this.scrollContext = options.scrollContext;
- this.build();
- },
-
- getObjectId: function(){ return this.objectId; },
-
- toString: function(){ return "[ object, mop.modules.ListItem ]"; },
-
- build: function(){
- this.parent();
- this.initControls();
- },
-
- initControls: function(){
-
- this.controls = this.element.getElement(".itemControls");
- if( this.controls.getElement(".delete") ) this.controls.getElement(".delete").addEvent( "click", this.deleteItem.bindWithEvent( this ) );
-
-
- // if( this.controls.getElement(".submit") )
- // this.controls.getElement(".submit").addEvent( "click", this.addItemDialogue.submit.bindWithEvent( this.addItemDialogue ) );
- //
- // if( this.controls.getElement(".cancel") )
- // this.controls.getElement(".cancel").addEvent( "click", this.addItemDialogue.cancel.bindWithEvent( this.addItemDialogue ) );
-
- },
-
- filesToTop: function(){
- this.uiElements.each( function( uiElementInstance, indexA ){
- if( uiElementInstance.type == "file" || uiElementInstance.type == "imageFile" ){
- uiElementInstance.scrollContext = 'modal';
- uiElementInstance.reposition( 'modal' );
- }
- }, this );
- },
-
- resetFileDepth: function(){
- this.uiElements.each( function( anElement ){
- if( anElement.type == "file" || anElement.type == "imageFile" ){
- anElement.reposition( 'window' );
- }
- });
- },
-
- getSubmissionController: function(){ return this.marshal.instanceName; },
-
- deleteItem: function( e ){
- if( e ){
- if( e.preventDefault ){
- e.preventDefault();
- }else{
- e.returnVal = false;
- }
- e.target.removeClass("delete");
- e.target.addClass("spinner");
- }
- this.JSONSend( "deleteItem" );
- if( this.marshal.sortable != null ) this.marshal.onOrderChanged();
- this.fadeOut = new Fx.Morph( this.element, { duration: 300, onComplete: this.marshal.onItemDeleted.bind( this.marshal, this ) } );
- this.fadeOut.start( { opacity: 0 } );
- },
-
-
- resumeSort: function(){
- if( this.marshal.sortable ) this.marshal.resumeSort();
- },
-
- suspendSort: function(){
- if( this.marshal.sortable ) this.marshal.suspendSort();
- },
-
- destroy: function(){
-
- /*
- * this.trash is a hack to identify items that have already been deleted
- * but have not been removed from the this.marshal.items array
- */
- //This is now fixed by erasing the item in onItemDeleted
- /*
- if(this.trash == true){
- return;
- }
- */
-
- //Destroy this.element if it still exists
- //This.element is the html element for the object
- //if(this.element != null){ this.element.destroy(); }
- //This is now fixed by erasing the item in onItemDeleted
- //also this apprears to be redundant now with mopUI.js
-
- this.element.destroy();
-
-// the item is not being removed from this.listing
-// which is causing some memory bloat and seems to be a problem in IE specifically
-
- this.parent(); //call the superclass's 'destroy()'
-
- this.addItemDialogue = null;
- this.controls = null;
- this.fadeOut = null;
- this.scrollContext = null;
- this.objectId = null;
-
-
- //this.trash = true;
-
- }
-
-});
View
17 modules/listmodule/views/listmodule.php
@@ -1,17 +0,0 @@
-<div id="<?=$instance;?>" class="module <?=$class;?> classPath-mop_modules_ListModule sortable-true">
-
- <?if(isset($label) && $label):?>
- <label><?=$label;?></label>
- <?endif;?>
-
- <ul class="listing">
- <?=$items;?>
- </ul>
-
- <div class="controls">
- <a href="#" class="addItem button grid_2">Add Item</a>
- </div>
-
-</div>
-
-
View
24 modules/listmodule/views/listmodule_item.php
@@ -1,24 +0,0 @@
-<li id="item_<?=$data['id'];?>" class="listItem">
-
- <?foreach($fields as $field=>$type):?>
- <?=mopui::IPE( $field, "rows-1", "p", $data[$field], $labels[$field] );?>
- <?endforeach;?>
-
- <?if(is_array($files) && isset($files['file']) ):?>
- <?=mopui::buildUIElement( array(
- 'type'=>'file',
- 'field'=>"file",
- 'extensions'=>$files['file']['extensions'],
- 'maxlength'=>$files['file']['maxlength'], "class"=>null ),
- $files['file']['id'] );?>
- <?elseif(is_array($images) && isset($images['file']) ):?>
- <?=mopui::buildUIElement( array('type'=>'image', 'field'=>"file", 'extensions'=>$images['file']['extensions'], 'maxlength'=>$images['file']['maxlength'], "class"=>null ), $images['file']['id'] );?>
- <?endif;?>
-
- <div class="itemControls">
- <a href="#" title="delete this list item" class="icon delete"><span>delete</span></a>
- <a href="#" title="submit" class="button submit hidden">submit</a>
- <a href="#" title="cancel" class="button cancel hidden">cancel</a>
- </div>
-
-</li>
View
15 modules/mopmvc/config/adminpage.php
@@ -1,15 +0,0 @@
- <?
- $config['resources']['css'] = array(
- 'modules/mop/thirdparty/960Grid/reset.css',
- 'modules/mop/thirdparty/960Grid/960.css'
- );
- $config['resources']['js'] = array(
- 'modules/mop/thirdparty/mootools/mootool.js',
- 'modules/mop/thirdparty/mootools/mootools-more.js',
- 'modules/mop/thirdparty/digitarald/fancyupload/Swiff.Uploader.js',
- 'modules/mop/thirdparty/monkeyphysics/datepicker.js',
- 'modules/mop/MoPCore.js',
- 'modules/mop/MoPUI.js',
- 'modules/mop/MoPModules.js'
- );
-?>
View
29 modules/mopmvc/config/data.dtd
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-
-<!--
- MoPCMS Data Configuration File DTD
- Revision: 0.1
- Date: 2010/09/18
--->
-
-<!ELEMENT data (item*) >
-
-<!ELEMENT item (item|field|list|object)* >
-<!ATTLIST item
- templateName CDATA #REQUIRED
->
-
-<!ELEMENT field ANY >
-<!ATTLIST field
- name CDATA #REQUIRED
->
-
-<!ELEMENT list (item*) >
-<!ATTLIST list
- family CDATA #REQUIRED
->
-
-<!ELEMENT object (field*) >
-<!ATTLIST object
- name CDATA #REQUIRED
->
View
32 modules/mopmvc/config/frontend.dtd
@@ -1,32 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-
-<!--
- MoPCMS Frontend Data File DTD
- Revision: 0.1
- Date: 2010/09/30
--->
-
-<!ELEMENT configuration (view*) >
-
-<!ELEMENT view (includeData|subView)* >
-<!ATTLIST view
- name CDATA #REQUIRED
- loadPage (true|false) "true"
->
-
-<!ELEMENT includeData ANY >
-<!ATTLIST includeData
- from CDATA "parent"
- label CDATA #REQUIRED
- templateFilter CDATA "all"
- where CDATA #IMPLIED
- tagged CDATA #IMPLIED
- slug CDATA #IMPLIED
->
-
-<!ELEMENT subView EMPTY >
-<!ATTLIST subView
- view CDATA #IMPLIED
- slug CDATA #IMPLIED
- label CDATA #REQUIRED
->
View
51 modules/mopmvc/config/homepagesample.txt
@@ -1,51 +0,0 @@
-<h1>Page Title</h1>
-
-<!-- fieldNames are ids when its page content (unique), classes when in a list (repeating, not unique)
-<!--- Feature Blurb -->
-<p id="featureBlurb">...</p>
-
-<h2>Feature Image</h2>
-<img id="featureImage" src="..." width="..." height="..." alt="" />
-
-<h2>Feature Links</h2>
-<ul id="featureList">
- <li class="featureListItem">
- <p class="label">...</p>
- <p class="url">...</p>
- </li>
-</ul>
-
-<!-- About Header -->
-<h3 id="aboutHeader">...</h3>
-
-<h2>About Blurb</h2>
-<p id="aboutBlurb">...</p>
-
-<h2>Announcement List</h2>
-<ul id="announcements">
- <li class="announcement">
- <p class="anouncement">...</p>
- <ul class="announcementLinks">
- <li>
- <p class="label">...</p>
- </li>
- <li>
- <p class="url">...</p>
- </li>
- </ul>
- </li>
-</ul>
-
-
-<!-- INCLUDEOBJECT -->
-
-<h2>books</h2>
-<ul id="books">
- <li class="book">
- <p class="title">Book Title</p>
- <img class="fieldName" src="..." width="..." height="..." alt="" />
- <p class="description">...</p>
- </li>
-</ul>
-
-
View
10 modules/mopmvc/config/mop.php
@@ -1,10 +0,0 @@
-<?
-
-$config['mediapath'] = 'application/media/';
-$config['stagingmediapath'] = 'staging/application/media/';
-
-$config['staging_enabled'] = true;
-$config['slugs_enabled'] = true;
-$config['loginTimeOut'] = 1800000;
-
-$config['siteTitle'] = "MoPCMS - It's Made of People";
View
163 modules/mopmvc/config/objects.dtd
@@ -1,163 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-
-<!--
- MoPCMS Backend Configuration File DTD
- Revision: 0.1
- Date: 2010/08/26
--->
-
-<!ENTITY % uiattrs
- "field CDATA #REQUIRED
- label CDATA #IMPLIED
- className CDATA #IMPLIED"
->
-
-<!ELEMENT configuration (templates) >
-
-<!ELEMENT templates (template*) >
-
-<!ELEMENT template ( elements?,addableObject*,components* ) >
-<!ATTLIST template
- name CDATA #REQUIRED
- nodeType CDATA "object"
- contentType CDATA "document"
- allowDelete (true|false) "true"
- allowTogglePublish (true|false) "true"
- allowChildSort (true|false) "true"
- sortDirection (ASC|DESC) "ASC"
- allowTitleEdit CDATA "true"
->
-
-<!ELEMENT elements (text|list|image|file|radioGroup|multiSelect|date|time|dateRange|checkbox|time|associator|link|extendedImage|extendedFile)* >
-
-<!ELEMENT components (component*) >
-
-<!ELEMENT addableObject EMPTY >
-<!ATTLIST addableObject
- templateName CDATA #REQUIRED
- addText CDATA #IMPLIED
->
-
-<!ELEMENT component ANY>
-<!ATTLIST component
- templateName CDATA #REQUIRED
- label CDATA #REQUIRED
->
-
-<!ELEMENT list (addableObject*) >
-<!ATTLIST list
- family CDATA #REQUIRED
- label CDATA #REQUIRED
- display (inline|component) "inline"
- allowChildSort (true|false) "true"
- sortDirection (ASC|DESC) "ASC"
- allowTogglePublish (true|false) "true"
- contentType CDATA "document"
->
-<!-- last two attributes currently not supported -->
-
-
-<!ELEMENT associator (filter*)>
-<!ATTLIST associator
- field CDATA #REQUIRED
- label CDATA #IMPLIED
- parent CDATA #IMPLIED
- templateName CDATA #IMPLIED
->
-
-<!ELEMENT filter EMPTY >
-<!ATTLIST filter
- from CDATA #IMPLIED
- templateName CDATA #IMPLIED
- tagged CDATA #IMPLIED
->
-
-<!ELEMENT text EMPTY >
-<!ATTLIST text
- %uiattrs;
- tag CDATA "p"
- rows CDATA "2"
->
-
-<!ELEMENT image (resize|ext)* >
-<!ATTLIST image
- %uiattrs;
- maxLength CDATA #IMPLIED
->
-
-<!ELEMENT file (ext)* >
-<!ATTLIST file
- %uiattrs;
- maxLength CDATA #IMPLIED
->
-
-<!ELEMENT radioGroup (radio*) >
-<!ATTLIST radioGroup
- %uiattrs;
- groupLabel CDATA #REQUIRED
->
-
-<!ELEMENT radio EMPTY >
-<!ATTLIST radio
- label CDATA #REQUIRED
- value CDATA #REQUIRED
->
-
-<!ELEMENT multiSelect EMPTY >
-<!ATTLIST multiSelect
- %uiattrs;
->
-
-
-<!ELEMENT date EMPTY>
-<!ATTLIST date
- %uiattrs;
->
-
-<!ELEMENT time EMPTY>
-<!ATTLIST time
- %uiattrs;
->
-
-
-<!ELEMENT checkbox EMPTY>
-<!ATTLIST checkbox
- %uiattrs;
->
-
-<!ELEMENT link EMPTY>
-<!ATTLIST link
- %uiattrs;
->
-
-<!ELEMENT extendedImage EMPTY>
-<!ATTLIST extendedImage
- %uiattrs;
->
-
-<!ELEMENT extendedFile EMPTY>
-<!ATTLIST extendedFile
- %uiattrs;
->
-
-<!ELEMENT resize EMPTY >
-<!ATTLIST resize
- name CDATA #REQUIRED
- width CDATA #REQUIRED
- height CDATA #REQUIRED
- forceDimension (width|height) #IMPLIED
- crop (true|false) "false"
->
-
-<!ELEMENT ext (#PCDATA) >
-
-<!ELEMENT data (item*) >
-
-<!ELEMENT item ANY >
-<!ATTLIST item
- templateName CDATA #REQUIRED
->
-
-<!ELEMENT content ANY >
-
-<!ELEMENT title (CDATA) >
View
17 modules/mopmvc/controllers/accessdenied.php
@@ -1,17 +0,0 @@
-<?
-/*
- * Class: AccessDenied_Controller
- * Basic view for when use tries to view a page they don't have access to
- */
-Class AccessDenied_Controller extends Controller {
-
- /*
- * Function: index()
- * Renders the webpage for accessdenied view
- */
- public function index(){
- //the default access denied view can be overridden in each application
- $this->view = new View('accessdenied');
- $this->toWebPage();
- }
-}
View
7 modules/mopmvc/controllers/adminheader.php
@@ -1,7 +0,0 @@
-<?
-
-Class AdminHeader_Controller extends Controller {
- public $modules = array(
- 'mop_auth',
- );
-}
View
208 modules/mopmvc/controllers/display.php
@@ -1,208 +0,0 @@
-<?
-
-/*
- * Class: Display_Controller
- * Base class for complete webpage assembly in mop system
- */
-class Display_Controller{
-
- /*
- * Variable: modules
- * The other modules to build and supply to the webpage layout template
- */
- protected $modules