diff --git a/content_modeller/.buildpath b/content_modeller/.buildpath deleted file mode 100644 index 606f236d..00000000 --- a/content_modeller/.buildpath +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/content_modeller/.project b/content_modeller/.project deleted file mode 100644 index ddc88b18..00000000 --- a/content_modeller/.project +++ /dev/null @@ -1,28 +0,0 @@ - - - Islandora Content Modeler - - - - - - org.eclipse.wst.jsdt.core.javascriptValidator - - - - - org.eclipse.wst.validation.validationbuilder - - - - - org.eclipse.dltk.core.scriptbuilder - - - - - - org.eclipse.php.core.PHPNature - org.eclipse.wst.jsdt.core.jsNature - - diff --git a/content_modeller/.settings/.jsdtscope b/content_modeller/.settings/.jsdtscope deleted file mode 100644 index 3c58e917..00000000 --- a/content_modeller/.settings/.jsdtscope +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - diff --git a/content_modeller/.settings/org.eclipse.php.core.prefs b/content_modeller/.settings/org.eclipse.php.core.prefs deleted file mode 100644 index 6ebb55f7..00000000 --- a/content_modeller/.settings/org.eclipse.php.core.prefs +++ /dev/null @@ -1,3 +0,0 @@ -#Mon May 17 18:04:49 CDT 2010 -eclipse.preferences.version=1 -include_path=0;/islandora_content_modeler diff --git a/content_modeller/.settings/org.eclipse.wst.jsdt.ui.superType.container b/content_modeller/.settings/org.eclipse.wst.jsdt.ui.superType.container deleted file mode 100644 index 3bd5d0a4..00000000 --- a/content_modeller/.settings/org.eclipse.wst.jsdt.ui.superType.container +++ /dev/null @@ -1 +0,0 @@ -org.eclipse.wst.jsdt.launching.baseBrowserLibrary \ No newline at end of file diff --git a/content_modeller/.settings/org.eclipse.wst.jsdt.ui.superType.name b/content_modeller/.settings/org.eclipse.wst.jsdt.ui.superType.name deleted file mode 100644 index 05bd71b6..00000000 --- a/content_modeller/.settings/org.eclipse.wst.jsdt.ui.superType.name +++ /dev/null @@ -1 +0,0 @@ -Window \ No newline at end of file diff --git a/content_modeller/css/content_modeller.css b/content_modeller/css/content_modeller.css deleted file mode 100644 index e4834b83..00000000 --- a/content_modeller/css/content_modeller.css +++ /dev/null @@ -1,33 +0,0 @@ -.contentModeller .collection -{ - width: 400px; - float: left; -} - -.contentModeller .model -{ - width: 475px; - float: right; -} - -.contentModeller img -{ - width: 16px; - padding: 0px; - vertical-align: middle; - cursor: hand; -} - -.contentModeller .ajaxForm -{ - margin-top: 25px; - padding: 10px; - width:300px; - border: 1px dashed black; - display: none; -} - -.contentModeller #ajaxBusy -{ - display: none; -} diff --git a/content_modeller/css/jquery.jnotify.css b/content_modeller/css/jquery.jnotify.css deleted file mode 100644 index e3ab53aa..00000000 --- a/content_modeller/css/jquery.jnotify.css +++ /dev/null @@ -1,16 +0,0 @@ -.jnotify-item -{ - height: auto; - padding: 4px 4px 4px 4px; - margin: 0 0 5px 0; - display: block; - position: relative; -} - -.jnotify-item-close -{ - float: right; - margin-left: 2px; -} - - diff --git a/content_modeller/css/jquery.treeview.css b/content_modeller/css/jquery.treeview.css deleted file mode 100644 index 94de11f8..00000000 --- a/content_modeller/css/jquery.treeview.css +++ /dev/null @@ -1,68 +0,0 @@ -.treeview, .treeview ul { - padding: 0; - margin: 0; - list-style: none; -} - -.treeview ul { - - margin-top: 4px; -} - -.treeview .hitarea { - background: url(../images/treeview-default.gif) -64px -25px no-repeat; - height: 16px; - width: 16px; - margin-left: -16px; - float: left; - cursor: pointer; -} -/* fix for IE6 */ -* html .hitarea { - display: inline; - float:none; -} - -.treeview li { - margin: 0; - padding: 3px 0pt 3px 16px; -} - -.treeview a.selected { - background-color: #eee; -} - -#treecontrol { margin: 1em 0; display: none; } - -.treeview .hover { color: red; cursor: pointer; } - -.treeview li { background: url(../images/treeview-default-line.gif) 0 0 no-repeat; } -.treeview li.collapsable, .treeview li.expandable { background-position: 0 -176px; } - -.treeview .expandable-hitarea { background-position: -80px -3px; } - -.treeview li.last { background-position: 0 -1766px } -.treeview li.lastCollapsable, .treeview li.lastExpandable { background-image: url(../images/treeview-default.gif); } -.treeview li.lastCollapsable { background-position: 0 -111px } -.treeview li.lastExpandable { background-position: -32px -67px } - -.treeview div.lastCollapsable-hitarea, .treeview div.lastExpandable-hitarea { background-position: 0; } - -.treeview-red li { background-image: url(../images/treeview-red-line.gif); } -.treeview-red .hitarea, .treeview-red li.lastCollapsable, .treeview-red li.lastExpandable { background-image: url(../images/treeview-red.gif); } - -.treeview-black li { background-image: url(../images/treeview-black-line.gif); } -.treeview-black .hitarea, .treeview-black li.lastCollapsable, .treeview-black li.lastExpandable { background-image: url(../images/treeview-black.gif); } - -.treeview-gray li { background-image: url(../images/treeview-gray-line.gif); } -.treeview-gray .hitarea, .treeview-gray li.lastCollapsable, .treeview-gray li.lastExpandable { background-image: url(../images/treeview-gray.gif); } - -.treeview-famfamfam li { background-image: url(../images/treeview-famfamfam-line.gif); } -.treeview-famfamfam .hitarea, .treeview-famfamfam li.lastCollapsable, .treeview-famfamfam li.lastExpandable { background-image: url(../images/treeview-famfamfam.gif); } - - -.filetree li { padding: 3px 0 2px 16px; } -.filetree span.folder, .filetree span.file { padding: 1px 0 1px 20px; } -.filetree span.folder { background: url(../images/folder.gif) 0 0 no-repeat; } -.filetree li.expandable span.folder { background: url(../images/folder-closed.gif) 0 0 no-repeat; } -.filetree span.file { background: url(../images/file.gif) 0 0 no-repeat; } diff --git a/content_modeller/css/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png b/content_modeller/css/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png deleted file mode 100644 index 5b5dab2a..00000000 Binary files a/content_modeller/css/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png and /dev/null differ diff --git a/content_modeller/css/smoothness/images/ui-bg_flat_75_ffffff_40x100.png b/content_modeller/css/smoothness/images/ui-bg_flat_75_ffffff_40x100.png deleted file mode 100644 index ac8b229a..00000000 Binary files a/content_modeller/css/smoothness/images/ui-bg_flat_75_ffffff_40x100.png and /dev/null differ diff --git a/content_modeller/css/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png b/content_modeller/css/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png deleted file mode 100644 index ad3d6346..00000000 Binary files a/content_modeller/css/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png and /dev/null differ diff --git a/content_modeller/css/smoothness/images/ui-bg_glass_65_ffffff_1x400.png b/content_modeller/css/smoothness/images/ui-bg_glass_65_ffffff_1x400.png deleted file mode 100644 index 42ccba26..00000000 Binary files a/content_modeller/css/smoothness/images/ui-bg_glass_65_ffffff_1x400.png and /dev/null differ diff --git a/content_modeller/css/smoothness/images/ui-bg_glass_75_dadada_1x400.png b/content_modeller/css/smoothness/images/ui-bg_glass_75_dadada_1x400.png deleted file mode 100644 index 5a46b47c..00000000 Binary files a/content_modeller/css/smoothness/images/ui-bg_glass_75_dadada_1x400.png and /dev/null differ diff --git a/content_modeller/css/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png b/content_modeller/css/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png deleted file mode 100644 index 86c2baa6..00000000 Binary files a/content_modeller/css/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png and /dev/null differ diff --git a/content_modeller/css/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png b/content_modeller/css/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png deleted file mode 100644 index 4443fdc1..00000000 Binary files a/content_modeller/css/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png and /dev/null differ diff --git a/content_modeller/css/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png b/content_modeller/css/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png deleted file mode 100644 index 7c9fa6c6..00000000 Binary files a/content_modeller/css/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png and /dev/null differ diff --git a/content_modeller/css/smoothness/images/ui-icons_222222_256x240.png b/content_modeller/css/smoothness/images/ui-icons_222222_256x240.png deleted file mode 100644 index b273ff11..00000000 Binary files a/content_modeller/css/smoothness/images/ui-icons_222222_256x240.png and /dev/null differ diff --git a/content_modeller/css/smoothness/images/ui-icons_2e83ff_256x240.png b/content_modeller/css/smoothness/images/ui-icons_2e83ff_256x240.png deleted file mode 100644 index 09d1cdc8..00000000 Binary files a/content_modeller/css/smoothness/images/ui-icons_2e83ff_256x240.png and /dev/null differ diff --git a/content_modeller/css/smoothness/images/ui-icons_454545_256x240.png b/content_modeller/css/smoothness/images/ui-icons_454545_256x240.png deleted file mode 100644 index 59bd45b9..00000000 Binary files a/content_modeller/css/smoothness/images/ui-icons_454545_256x240.png and /dev/null differ diff --git a/content_modeller/css/smoothness/images/ui-icons_888888_256x240.png b/content_modeller/css/smoothness/images/ui-icons_888888_256x240.png deleted file mode 100644 index 6d02426c..00000000 Binary files a/content_modeller/css/smoothness/images/ui-icons_888888_256x240.png and /dev/null differ diff --git a/content_modeller/css/smoothness/images/ui-icons_cd0a0a_256x240.png b/content_modeller/css/smoothness/images/ui-icons_cd0a0a_256x240.png deleted file mode 100644 index 2ab019b7..00000000 Binary files a/content_modeller/css/smoothness/images/ui-icons_cd0a0a_256x240.png and /dev/null differ diff --git a/content_modeller/css/smoothness/jquery-ui-1.8.1.custom.css b/content_modeller/css/smoothness/jquery-ui-1.8.1.custom.css deleted file mode 100644 index 33d73634..00000000 --- a/content_modeller/css/smoothness/jquery-ui-1.8.1.custom.css +++ /dev/null @@ -1,486 +0,0 @@ -/* -* jQuery UI CSS Framework -* Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about) -* Dual licensed under the MIT (MIT-LICENSE.txt) and GPL (GPL-LICENSE.txt) licenses. -*/ - -/* Layout helpers -----------------------------------*/ -.ui-helper-hidden { display: none; } -.ui-helper-hidden-accessible { position: absolute; left: -99999999px; } -.ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; } -.ui-helper-clearfix:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; } -.ui-helper-clearfix { display: inline-block; } -/* required comment for clearfix to work in Opera \*/ -* html .ui-helper-clearfix { height:1%; } -.ui-helper-clearfix { display:block; } -/* end clearfix */ -.ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); } - - -/* Interaction Cues -----------------------------------*/ -.ui-state-disabled { cursor: default !important; } - - -/* Icons -----------------------------------*/ - -/* states and images */ -.ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; } - - -/* Misc visuals -----------------------------------*/ - -/* Overlays */ -.ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; } - - -/* -* jQuery UI CSS Framework -* Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about) -* Dual licensed under the MIT (MIT-LICENSE.txt) and GPL (GPL-LICENSE.txt) licenses. -* To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Verdana,Arial,sans-serif&fwDefault=normal&fsDefault=1.1em&cornerRadius=4px&bgColorHeader=cccccc&bgTextureHeader=03_highlight_soft.png&bgImgOpacityHeader=75&borderColorHeader=aaaaaa&fcHeader=222222&iconColorHeader=222222&bgColorContent=ffffff&bgTextureContent=01_flat.png&bgImgOpacityContent=75&borderColorContent=aaaaaa&fcContent=222222&iconColorContent=222222&bgColorDefault=e6e6e6&bgTextureDefault=02_glass.png&bgImgOpacityDefault=75&borderColorDefault=d3d3d3&fcDefault=555555&iconColorDefault=888888&bgColorHover=dadada&bgTextureHover=02_glass.png&bgImgOpacityHover=75&borderColorHover=999999&fcHover=212121&iconColorHover=454545&bgColorActive=ffffff&bgTextureActive=02_glass.png&bgImgOpacityActive=65&borderColorActive=aaaaaa&fcActive=212121&iconColorActive=454545&bgColorHighlight=fbf9ee&bgTextureHighlight=02_glass.png&bgImgOpacityHighlight=55&borderColorHighlight=fcefa1&fcHighlight=363636&iconColorHighlight=2e83ff&bgColorError=fef1ec&bgTextureError=02_glass.png&bgImgOpacityError=95&borderColorError=cd0a0a&fcError=cd0a0a&iconColorError=cd0a0a&bgColorOverlay=aaaaaa&bgTextureOverlay=01_flat.png&bgImgOpacityOverlay=0&opacityOverlay=30&bgColorShadow=aaaaaa&bgTextureShadow=01_flat.png&bgImgOpacityShadow=0&opacityShadow=30&thicknessShadow=8px&offsetTopShadow=-8px&offsetLeftShadow=-8px&cornerRadiusShadow=8px -*/ - - -/* Component containers -----------------------------------*/ -.ui-widget { font-family: Verdana,Arial,sans-serif; font-size: 1.1em; } -.ui-widget .ui-widget { font-size: 1em; } -.ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: Verdana,Arial,sans-serif; font-size: 1em; } -.ui-widget-content { border: 1px solid #aaaaaa; background: #ffffff url(images/ui-bg_flat_75_ffffff_40x100.png) 50% 50% repeat-x; color: #222222; } -.ui-widget-content a { color: #222222; } -.ui-widget-header { border: 1px solid #aaaaaa; background: #cccccc url(images/ui-bg_highlight-soft_75_cccccc_1x100.png) 50% 50% repeat-x; color: #222222; font-weight: bold; } -.ui-widget-header a { color: #222222; } - -/* Interaction states -----------------------------------*/ -.ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { border: 1px solid #d3d3d3; background: #e6e6e6 url(images/ui-bg_glass_75_e6e6e6_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #555555; } -.ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #555555; text-decoration: none; } -.ui-state-hover, .ui-widget-content .ui-state-hover, .ui-widget-header .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus, .ui-widget-header .ui-state-focus { border: 1px solid #999999; background: #dadada url(images/ui-bg_glass_75_dadada_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #212121; } -.ui-state-hover a, .ui-state-hover a:hover { color: #212121; text-decoration: none; } -.ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active { border: 1px solid #aaaaaa; background: #ffffff url(images/ui-bg_glass_65_ffffff_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #212121; } -.ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { color: #212121; text-decoration: none; } -.ui-widget :active { outline: none; } - -/* Interaction Cues -----------------------------------*/ -.ui-state-highlight, .ui-widget-content .ui-state-highlight, .ui-widget-header .ui-state-highlight {border: 1px solid #fcefa1; background: #fbf9ee url(images/ui-bg_glass_55_fbf9ee_1x400.png) 50% 50% repeat-x; color: #363636; } -.ui-state-highlight a, .ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a { color: #363636; } -.ui-state-error, .ui-widget-content .ui-state-error, .ui-widget-header .ui-state-error {border: 1px solid #cd0a0a; background: #fef1ec url(images/ui-bg_glass_95_fef1ec_1x400.png) 50% 50% repeat-x; color: #cd0a0a; } -.ui-state-error a, .ui-widget-content .ui-state-error a, .ui-widget-header .ui-state-error a { color: #cd0a0a; } -.ui-state-error-text, .ui-widget-content .ui-state-error-text, .ui-widget-header .ui-state-error-text { color: #cd0a0a; } -.ui-priority-primary, .ui-widget-content .ui-priority-primary, .ui-widget-header .ui-priority-primary { font-weight: bold; } -.ui-priority-secondary, .ui-widget-content .ui-priority-secondary, .ui-widget-header .ui-priority-secondary { opacity: .7; filter:Alpha(Opacity=70); font-weight: normal; } -.ui-state-disabled, .ui-widget-content .ui-state-disabled, .ui-widget-header .ui-state-disabled { opacity: .35; filter:Alpha(Opacity=35); background-image: none; } - -/* Icons -----------------------------------*/ - -/* states and images */ -.ui-icon { width: 16px; height: 16px; background-image: url(images/ui-icons_222222_256x240.png); } -.ui-widget-content .ui-icon {background-image: url(images/ui-icons_222222_256x240.png); } -.ui-widget-header .ui-icon {background-image: url(images/ui-icons_222222_256x240.png); } -.ui-state-default .ui-icon { background-image: url(images/ui-icons_888888_256x240.png); } -.ui-state-hover .ui-icon, .ui-state-focus .ui-icon {background-image: url(images/ui-icons_454545_256x240.png); } -.ui-state-active .ui-icon {background-image: url(images/ui-icons_454545_256x240.png); } -.ui-state-highlight .ui-icon {background-image: url(images/ui-icons_2e83ff_256x240.png); } -.ui-state-error .ui-icon, .ui-state-error-text .ui-icon {background-image: url(images/ui-icons_cd0a0a_256x240.png); } - -/* positioning */ -.ui-icon-carat-1-n { background-position: 0 0; } -.ui-icon-carat-1-ne { background-position: -16px 0; } -.ui-icon-carat-1-e { background-position: -32px 0; } -.ui-icon-carat-1-se { background-position: -48px 0; } -.ui-icon-carat-1-s { background-position: -64px 0; } -.ui-icon-carat-1-sw { background-position: -80px 0; } -.ui-icon-carat-1-w { background-position: -96px 0; } -.ui-icon-carat-1-nw { background-position: -112px 0; } -.ui-icon-carat-2-n-s { background-position: -128px 0; } -.ui-icon-carat-2-e-w { background-position: -144px 0; } -.ui-icon-triangle-1-n { background-position: 0 -16px; } -.ui-icon-triangle-1-ne { background-position: -16px -16px; } -.ui-icon-triangle-1-e { background-position: -32px -16px; } -.ui-icon-triangle-1-se { background-position: -48px -16px; } -.ui-icon-triangle-1-s { background-position: -64px -16px; } -.ui-icon-triangle-1-sw { background-position: -80px -16px; } -.ui-icon-triangle-1-w { background-position: -96px -16px; } -.ui-icon-triangle-1-nw { background-position: -112px -16px; } -.ui-icon-triangle-2-n-s { background-position: -128px -16px; } -.ui-icon-triangle-2-e-w { background-position: -144px -16px; } -.ui-icon-arrow-1-n { background-position: 0 -32px; } -.ui-icon-arrow-1-ne { background-position: -16px -32px; } -.ui-icon-arrow-1-e { background-position: -32px -32px; } -.ui-icon-arrow-1-se { background-position: -48px -32px; } -.ui-icon-arrow-1-s { background-position: -64px -32px; } -.ui-icon-arrow-1-sw { background-position: -80px -32px; } -.ui-icon-arrow-1-w { background-position: -96px -32px; } -.ui-icon-arrow-1-nw { background-position: -112px -32px; } -.ui-icon-arrow-2-n-s { background-position: -128px -32px; } -.ui-icon-arrow-2-ne-sw { background-position: -144px -32px; } -.ui-icon-arrow-2-e-w { background-position: -160px -32px; } -.ui-icon-arrow-2-se-nw { background-position: -176px -32px; } -.ui-icon-arrowstop-1-n { background-position: -192px -32px; } -.ui-icon-arrowstop-1-e { background-position: -208px -32px; } -.ui-icon-arrowstop-1-s { background-position: -224px -32px; } -.ui-icon-arrowstop-1-w { background-position: -240px -32px; } -.ui-icon-arrowthick-1-n { background-position: 0 -48px; } -.ui-icon-arrowthick-1-ne { background-position: -16px -48px; } -.ui-icon-arrowthick-1-e { background-position: -32px -48px; } -.ui-icon-arrowthick-1-se { background-position: -48px -48px; } -.ui-icon-arrowthick-1-s { background-position: -64px -48px; } -.ui-icon-arrowthick-1-sw { background-position: -80px -48px; } -.ui-icon-arrowthick-1-w { background-position: -96px -48px; } -.ui-icon-arrowthick-1-nw { background-position: -112px -48px; } -.ui-icon-arrowthick-2-n-s { background-position: -128px -48px; } -.ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; } -.ui-icon-arrowthick-2-e-w { background-position: -160px -48px; } -.ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; } -.ui-icon-arrowthickstop-1-n { background-position: -192px -48px; } -.ui-icon-arrowthickstop-1-e { background-position: -208px -48px; } -.ui-icon-arrowthickstop-1-s { background-position: -224px -48px; } -.ui-icon-arrowthickstop-1-w { background-position: -240px -48px; } -.ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; } -.ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; } -.ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; } -.ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; } -.ui-icon-arrowreturn-1-w { background-position: -64px -64px; } -.ui-icon-arrowreturn-1-n { background-position: -80px -64px; } -.ui-icon-arrowreturn-1-e { background-position: -96px -64px; } -.ui-icon-arrowreturn-1-s { background-position: -112px -64px; } -.ui-icon-arrowrefresh-1-w { background-position: -128px -64px; } -.ui-icon-arrowrefresh-1-n { background-position: -144px -64px; } -.ui-icon-arrowrefresh-1-e { background-position: -160px -64px; } -.ui-icon-arrowrefresh-1-s { background-position: -176px -64px; } -.ui-icon-arrow-4 { background-position: 0 -80px; } -.ui-icon-arrow-4-diag { background-position: -16px -80px; } -.ui-icon-extlink { background-position: -32px -80px; } -.ui-icon-newwin { background-position: -48px -80px; } -.ui-icon-refresh { background-position: -64px -80px; } -.ui-icon-shuffle { background-position: -80px -80px; } -.ui-icon-transfer-e-w { background-position: -96px -80px; } -.ui-icon-transferthick-e-w { background-position: -112px -80px; } -.ui-icon-folder-collapsed { background-position: 0 -96px; } -.ui-icon-folder-open { background-position: -16px -96px; } -.ui-icon-document { background-position: -32px -96px; } -.ui-icon-document-b { background-position: -48px -96px; } -.ui-icon-note { background-position: -64px -96px; } -.ui-icon-mail-closed { background-position: -80px -96px; } -.ui-icon-mail-open { background-position: -96px -96px; } -.ui-icon-suitcase { background-position: -112px -96px; } -.ui-icon-comment { background-position: -128px -96px; } -.ui-icon-person { background-position: -144px -96px; } -.ui-icon-print { background-position: -160px -96px; } -.ui-icon-trash { background-position: -176px -96px; } -.ui-icon-locked { background-position: -192px -96px; } -.ui-icon-unlocked { background-position: -208px -96px; } -.ui-icon-bookmark { background-position: -224px -96px; } -.ui-icon-tag { background-position: -240px -96px; } -.ui-icon-home { background-position: 0 -112px; } -.ui-icon-flag { background-position: -16px -112px; } -.ui-icon-calendar { background-position: -32px -112px; } -.ui-icon-cart { background-position: -48px -112px; } -.ui-icon-pencil { background-position: -64px -112px; } -.ui-icon-clock { background-position: -80px -112px; } -.ui-icon-disk { background-position: -96px -112px; } -.ui-icon-calculator { background-position: -112px -112px; } -.ui-icon-zoomin { background-position: -128px -112px; } -.ui-icon-zoomout { background-position: -144px -112px; } -.ui-icon-search { background-position: -160px -112px; } -.ui-icon-wrench { background-position: -176px -112px; } -.ui-icon-gear { background-position: -192px -112px; } -.ui-icon-heart { background-position: -208px -112px; } -.ui-icon-star { background-position: -224px -112px; } -.ui-icon-link { background-position: -240px -112px; } -.ui-icon-cancel { background-position: 0 -128px; } -.ui-icon-plus { background-position: -16px -128px; } -.ui-icon-plusthick { background-position: -32px -128px; } -.ui-icon-minus { background-position: -48px -128px; } -.ui-icon-minusthick { background-position: -64px -128px; } -.ui-icon-close { background-position: -80px -128px; } -.ui-icon-closethick { background-position: -96px -128px; } -.ui-icon-key { background-position: -112px -128px; } -.ui-icon-lightbulb { background-position: -128px -128px; } -.ui-icon-scissors { background-position: -144px -128px; } -.ui-icon-clipboard { background-position: -160px -128px; } -.ui-icon-copy { background-position: -176px -128px; } -.ui-icon-contact { background-position: -192px -128px; } -.ui-icon-image { background-position: -208px -128px; } -.ui-icon-video { background-position: -224px -128px; } -.ui-icon-script { background-position: -240px -128px; } -.ui-icon-alert { background-position: 0 -144px; } -.ui-icon-info { background-position: -16px -144px; } -.ui-icon-notice { background-position: -32px -144px; } -.ui-icon-help { background-position: -48px -144px; } -.ui-icon-check { background-position: -64px -144px; } -.ui-icon-bullet { background-position: -80px -144px; } -.ui-icon-radio-off { background-position: -96px -144px; } -.ui-icon-radio-on { background-position: -112px -144px; } -.ui-icon-pin-w { background-position: -128px -144px; } -.ui-icon-pin-s { background-position: -144px -144px; } -.ui-icon-play { background-position: 0 -160px; } -.ui-icon-pause { background-position: -16px -160px; } -.ui-icon-seek-next { background-position: -32px -160px; } -.ui-icon-seek-prev { background-position: -48px -160px; } -.ui-icon-seek-end { background-position: -64px -160px; } -.ui-icon-seek-start { background-position: -80px -160px; } -/* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */ -.ui-icon-seek-first { background-position: -80px -160px; } -.ui-icon-stop { background-position: -96px -160px; } -.ui-icon-eject { background-position: -112px -160px; } -.ui-icon-volume-off { background-position: -128px -160px; } -.ui-icon-volume-on { background-position: -144px -160px; } -.ui-icon-power { background-position: 0 -176px; } -.ui-icon-signal-diag { background-position: -16px -176px; } -.ui-icon-signal { background-position: -32px -176px; } -.ui-icon-battery-0 { background-position: -48px -176px; } -.ui-icon-battery-1 { background-position: -64px -176px; } -.ui-icon-battery-2 { background-position: -80px -176px; } -.ui-icon-battery-3 { background-position: -96px -176px; } -.ui-icon-circle-plus { background-position: 0 -192px; } -.ui-icon-circle-minus { background-position: -16px -192px; } -.ui-icon-circle-close { background-position: -32px -192px; } -.ui-icon-circle-triangle-e { background-position: -48px -192px; } -.ui-icon-circle-triangle-s { background-position: -64px -192px; } -.ui-icon-circle-triangle-w { background-position: -80px -192px; } -.ui-icon-circle-triangle-n { background-position: -96px -192px; } -.ui-icon-circle-arrow-e { background-position: -112px -192px; } -.ui-icon-circle-arrow-s { background-position: -128px -192px; } -.ui-icon-circle-arrow-w { background-position: -144px -192px; } -.ui-icon-circle-arrow-n { background-position: -160px -192px; } -.ui-icon-circle-zoomin { background-position: -176px -192px; } -.ui-icon-circle-zoomout { background-position: -192px -192px; } -.ui-icon-circle-check { background-position: -208px -192px; } -.ui-icon-circlesmall-plus { background-position: 0 -208px; } -.ui-icon-circlesmall-minus { background-position: -16px -208px; } -.ui-icon-circlesmall-close { background-position: -32px -208px; } -.ui-icon-squaresmall-plus { background-position: -48px -208px; } -.ui-icon-squaresmall-minus { background-position: -64px -208px; } -.ui-icon-squaresmall-close { background-position: -80px -208px; } -.ui-icon-grip-dotted-vertical { background-position: 0 -224px; } -.ui-icon-grip-dotted-horizontal { background-position: -16px -224px; } -.ui-icon-grip-solid-vertical { background-position: -32px -224px; } -.ui-icon-grip-solid-horizontal { background-position: -48px -224px; } -.ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; } -.ui-icon-grip-diagonal-se { background-position: -80px -224px; } - - -/* Misc visuals -----------------------------------*/ - -/* Corner radius */ -.ui-corner-tl { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; border-top-left-radius: 4px; } -.ui-corner-tr { -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; border-top-right-radius: 4px; } -.ui-corner-bl { -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; border-bottom-left-radius: 4px; } -.ui-corner-br { -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; border-bottom-right-radius: 4px; } -.ui-corner-top { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; border-top-left-radius: 4px; -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; border-top-right-radius: 4px; } -.ui-corner-bottom { -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; border-bottom-left-radius: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; border-bottom-right-radius: 4px; } -.ui-corner-right { -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; border-top-right-radius: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; border-bottom-right-radius: 4px; } -.ui-corner-left { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; border-top-left-radius: 4px; -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; border-bottom-left-radius: 4px; } -.ui-corner-all { -moz-border-radius: 4px; -webkit-border-radius: 4px; border-radius: 4px; } - -/* Overlays */ -.ui-widget-overlay { background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); } -.ui-widget-shadow { margin: -8px 0 0 -8px; padding: 8px; background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); -moz-border-radius: 8px; -webkit-border-radius: 8px; border-radius: 8px; }/* Resizable -----------------------------------*/ -.ui-resizable { position: relative;} -.ui-resizable-handle { position: absolute;font-size: 0.1px;z-index: 99999; display: block;} -.ui-resizable-disabled .ui-resizable-handle, .ui-resizable-autohide .ui-resizable-handle { display: none; } -.ui-resizable-n { cursor: n-resize; height: 7px; width: 100%; top: -5px; left: 0; } -.ui-resizable-s { cursor: s-resize; height: 7px; width: 100%; bottom: -5px; left: 0; } -.ui-resizable-e { cursor: e-resize; width: 7px; right: -5px; top: 0; height: 100%; } -.ui-resizable-w { cursor: w-resize; width: 7px; left: -5px; top: 0; height: 100%; } -.ui-resizable-se { cursor: se-resize; width: 12px; height: 12px; right: 1px; bottom: 1px; } -.ui-resizable-sw { cursor: sw-resize; width: 9px; height: 9px; left: -5px; bottom: -5px; } -.ui-resizable-nw { cursor: nw-resize; width: 9px; height: 9px; left: -5px; top: -5px; } -.ui-resizable-ne { cursor: ne-resize; width: 9px; height: 9px; right: -5px; top: -5px;}/* Accordion -----------------------------------*/ -.ui-accordion .ui-accordion-header { cursor: pointer; position: relative; margin-top: 1px; zoom: 1; } -.ui-accordion .ui-accordion-li-fix { display: inline; } -.ui-accordion .ui-accordion-header-active { border-bottom: 0 !important; } -.ui-accordion .ui-accordion-header a { display: block; font-size: 1em; padding: .5em .5em .5em .7em; } -/* IE7-/Win - Fix extra vertical space in lists */ -.ui-accordion a { zoom: 1; } -.ui-accordion-icons .ui-accordion-header a { padding-left: 2.2em; } -.ui-accordion .ui-accordion-header .ui-icon { position: absolute; left: .5em; top: 50%; margin-top: -8px; } -.ui-accordion .ui-accordion-content { padding: 1em 2.2em; border-top: 0; margin-top: -2px; position: relative; top: 1px; margin-bottom: 2px; overflow: auto; display: none; zoom: 1; } -.ui-accordion .ui-accordion-content-active { display: block; }/* Autocomplete -----------------------------------*/ -.ui-autocomplete { position: absolute; cursor: default; } -.ui-autocomplete-loading { background: white url('images/ui-anim_basic_16x16.gif') right center no-repeat; } - -/* workarounds */ -* html .ui-autocomplete { width:1px; } /* without this, the menu expands to 100% in IE6 */ - -/* Menu -----------------------------------*/ -.ui-menu { - list-style:none; - padding: 2px; - margin: 0; - display:block; -} -.ui-menu .ui-menu { - margin-top: -3px; -} -.ui-menu .ui-menu-item { - margin:0; - padding: 0; - zoom: 1; - float: left; - clear: left; - width: 100%; -} -.ui-menu .ui-menu-item a { - text-decoration:none; - display:block; - padding:.2em .4em; - line-height:1.5; - zoom:1; -} -.ui-menu .ui-menu-item a.ui-state-hover, -.ui-menu .ui-menu-item a.ui-state-active { - font-weight: normal; - margin: -1px; -} -/* Button -----------------------------------*/ - -.ui-button { display: inline-block; position: relative; padding: 0; margin-right: .1em; text-decoration: none !important; cursor: pointer; text-align: center; zoom: 1; overflow: visible; } /* the overflow property removes extra width in IE */ -.ui-button-icon-only { width: 2.2em; } /* to make room for the icon, a width needs to be set here */ -button.ui-button-icon-only { width: 2.4em; } /* button elements seem to need a little more width */ -.ui-button-icons-only { width: 3.4em; } -button.ui-button-icons-only { width: 3.7em; } - -/*button text element */ -.ui-button .ui-button-text { display: block; line-height: 1.4; } -.ui-button-text-only .ui-button-text { padding: .4em 1em; } -.ui-button-icon-only .ui-button-text, .ui-button-icons-only .ui-button-text { padding: .4em; text-indent: -9999999px; } -.ui-button-text-icon .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 1em .4em 2.1em; } -.ui-button-text-icons .ui-button-text { padding-left: 2.1em; padding-right: 2.1em; } -/* no icon support for input elements, provide padding by default */ -input.ui-button { padding: .4em 1em; } - -/*button icon element(s) */ -.ui-button-icon-only .ui-icon, .ui-button-text-icon .ui-icon, .ui-button-text-icons .ui-icon, .ui-button-icons-only .ui-icon { position: absolute; top: 50%; margin-top: -8px; } -.ui-button-icon-only .ui-icon { left: 50%; margin-left: -8px; } -.ui-button-text-icon .ui-button-icon-primary, .ui-button-text-icons .ui-button-icon-primary, .ui-button-icons-only .ui-button-icon-primary { left: .5em; } -.ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; } - -/*button sets*/ -.ui-buttonset { margin-right: 7px; } -.ui-buttonset .ui-button { margin-left: 0; margin-right: -.3em; } - -/* workarounds */ -button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra padding in Firefox */ - - - - - -/* Dialog -----------------------------------*/ -.ui-dialog { position: absolute; padding: .2em; width: 300px; overflow: hidden; } -.ui-dialog .ui-dialog-titlebar { padding: .5em 1em .3em; position: relative; } -.ui-dialog .ui-dialog-title { float: left; margin: .1em 16px .2em 0; } -.ui-dialog .ui-dialog-titlebar-close { position: absolute; right: .3em; top: 50%; width: 19px; margin: -10px 0 0 0; padding: 1px; height: 18px; } -.ui-dialog .ui-dialog-titlebar-close span { display: block; margin: 1px; } -.ui-dialog .ui-dialog-titlebar-close:hover, .ui-dialog .ui-dialog-titlebar-close:focus { padding: 0; } -.ui-dialog .ui-dialog-content { border: 0; padding: .5em 1em; background: none; overflow: auto; zoom: 1; } -.ui-dialog .ui-dialog-buttonpane { text-align: left; border-width: 1px 0 0 0; background-image: none; margin: .5em 0 0 0; padding: .3em 1em .5em .4em; } -.ui-dialog .ui-dialog-buttonpane button { float: right; margin: .5em .4em .5em 0; cursor: pointer; padding: .2em .6em .3em .6em; line-height: 1.4em; width:auto; overflow:visible; } -.ui-dialog .ui-resizable-se { width: 14px; height: 14px; right: 3px; bottom: 3px; } -.ui-draggable .ui-dialog-titlebar { cursor: move; } -/* Slider -----------------------------------*/ -.ui-slider { position: relative; text-align: left; } -.ui-slider .ui-slider-handle { position: absolute; z-index: 2; width: 1.2em; height: 1.2em; cursor: default; } -.ui-slider .ui-slider-range { position: absolute; z-index: 1; font-size: .7em; display: block; border: 0; background-position: 0 0; } - -.ui-slider-horizontal { height: .8em; } -.ui-slider-horizontal .ui-slider-handle { top: -.3em; margin-left: -.6em; } -.ui-slider-horizontal .ui-slider-range { top: 0; height: 100%; } -.ui-slider-horizontal .ui-slider-range-min { left: 0; } -.ui-slider-horizontal .ui-slider-range-max { right: 0; } - -.ui-slider-vertical { width: .8em; height: 100px; } -.ui-slider-vertical .ui-slider-handle { left: -.3em; margin-left: 0; margin-bottom: -.6em; } -.ui-slider-vertical .ui-slider-range { left: 0; width: 100%; } -.ui-slider-vertical .ui-slider-range-min { bottom: 0; } -.ui-slider-vertical .ui-slider-range-max { top: 0; }/* Tabs -----------------------------------*/ -.ui-tabs { position: relative; padding: .2em; zoom: 1; } /* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */ -.ui-tabs .ui-tabs-nav { margin: 0; padding: .2em .2em 0; } -.ui-tabs .ui-tabs-nav li { list-style: none; float: left; position: relative; top: 1px; margin: 0 .2em 1px 0; border-bottom: 0 !important; padding: 0; white-space: nowrap; } -.ui-tabs .ui-tabs-nav li a { float: left; padding: .5em 1em; text-decoration: none; } -.ui-tabs .ui-tabs-nav li.ui-tabs-selected { margin-bottom: 0; padding-bottom: 1px; } -.ui-tabs .ui-tabs-nav li.ui-tabs-selected a, .ui-tabs .ui-tabs-nav li.ui-state-disabled a, .ui-tabs .ui-tabs-nav li.ui-state-processing a { cursor: text; } -.ui-tabs .ui-tabs-nav li a, .ui-tabs.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-selected a { cursor: pointer; } /* first selector in group seems obsolete, but required to overcome bug in Opera applying cursor: text overall if defined elsewhere... */ -.ui-tabs .ui-tabs-panel { display: block; border-width: 0; padding: 1em 1.4em; background: none; } -.ui-tabs .ui-tabs-hide { display: none !important; } -/* Datepicker -----------------------------------*/ -.ui-datepicker { width: 17em; padding: .2em .2em 0; } -.ui-datepicker .ui-datepicker-header { position:relative; padding:.2em 0; } -.ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next { position:absolute; top: 2px; width: 1.8em; height: 1.8em; } -.ui-datepicker .ui-datepicker-prev-hover, .ui-datepicker .ui-datepicker-next-hover { top: 1px; } -.ui-datepicker .ui-datepicker-prev { left:2px; } -.ui-datepicker .ui-datepicker-next { right:2px; } -.ui-datepicker .ui-datepicker-prev-hover { left:1px; } -.ui-datepicker .ui-datepicker-next-hover { right:1px; } -.ui-datepicker .ui-datepicker-prev span, .ui-datepicker .ui-datepicker-next span { display: block; position: absolute; left: 50%; margin-left: -8px; top: 50%; margin-top: -8px; } -.ui-datepicker .ui-datepicker-title { margin: 0 2.3em; line-height: 1.8em; text-align: center; } -.ui-datepicker .ui-datepicker-title select { font-size:1em; margin:1px 0; } -.ui-datepicker select.ui-datepicker-month-year {width: 100%;} -.ui-datepicker select.ui-datepicker-month, -.ui-datepicker select.ui-datepicker-year { width: 49%;} -.ui-datepicker table {width: 100%; font-size: .9em; border-collapse: collapse; margin:0 0 .4em; } -.ui-datepicker th { padding: .7em .3em; text-align: center; font-weight: bold; border: 0; } -.ui-datepicker td { border: 0; padding: 1px; } -.ui-datepicker td span, .ui-datepicker td a { display: block; padding: .2em; text-align: right; text-decoration: none; } -.ui-datepicker .ui-datepicker-buttonpane { background-image: none; margin: .7em 0 0 0; padding:0 .2em; border-left: 0; border-right: 0; border-bottom: 0; } -.ui-datepicker .ui-datepicker-buttonpane button { float: right; margin: .5em .2em .4em; cursor: pointer; padding: .2em .6em .3em .6em; width:auto; overflow:visible; } -.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { float:left; } - -/* with multiple calendars */ -.ui-datepicker.ui-datepicker-multi { width:auto; } -.ui-datepicker-multi .ui-datepicker-group { float:left; } -.ui-datepicker-multi .ui-datepicker-group table { width:95%; margin:0 auto .4em; } -.ui-datepicker-multi-2 .ui-datepicker-group { width:50%; } -.ui-datepicker-multi-3 .ui-datepicker-group { width:33.3%; } -.ui-datepicker-multi-4 .ui-datepicker-group { width:25%; } -.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header { border-left-width:0; } -.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { border-left-width:0; } -.ui-datepicker-multi .ui-datepicker-buttonpane { clear:left; } -.ui-datepicker-row-break { clear:both; width:100%; } - -/* RTL support */ -.ui-datepicker-rtl { direction: rtl; } -.ui-datepicker-rtl .ui-datepicker-prev { right: 2px; left: auto; } -.ui-datepicker-rtl .ui-datepicker-next { left: 2px; right: auto; } -.ui-datepicker-rtl .ui-datepicker-prev:hover { right: 1px; left: auto; } -.ui-datepicker-rtl .ui-datepicker-next:hover { left: 1px; right: auto; } -.ui-datepicker-rtl .ui-datepicker-buttonpane { clear:right; } -.ui-datepicker-rtl .ui-datepicker-buttonpane button { float: left; } -.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current { float:right; } -.ui-datepicker-rtl .ui-datepicker-group { float:right; } -.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header { border-right-width:0; border-left-width:1px; } -.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { border-right-width:0; border-left-width:1px; } - -/* IE6 IFRAME FIX (taken from datepicker 1.5.3 */ -.ui-datepicker-cover { - display: none; /*sorry for IE5*/ - display/**/: block; /*sorry for IE5*/ - position: absolute; /*must have*/ - z-index: -1; /*must have*/ - filter: mask(); /*must have*/ - top: -4px; /*must have*/ - left: -4px; /*must have*/ - width: 200px; /*must have*/ - height: 200px; /*must have*/ -}/* Progressbar -----------------------------------*/ -.ui-progressbar { height:2em; text-align: left; } -.ui-progressbar .ui-progressbar-value {margin: -1px; height:100%; } \ No newline at end of file diff --git a/content_modeller/images/add.png b/content_modeller/images/add.png deleted file mode 100644 index 306d3d89..00000000 Binary files a/content_modeller/images/add.png and /dev/null differ diff --git a/content_modeller/images/ajax-loader.gif b/content_modeller/images/ajax-loader.gif deleted file mode 100644 index c4ab0a24..00000000 Binary files a/content_modeller/images/ajax-loader.gif and /dev/null differ diff --git a/content_modeller/images/blue_down.png b/content_modeller/images/blue_down.png deleted file mode 100644 index b81602e6..00000000 Binary files a/content_modeller/images/blue_down.png and /dev/null differ diff --git a/content_modeller/images/blue_up.png b/content_modeller/images/blue_up.png deleted file mode 100644 index 0d80c322..00000000 Binary files a/content_modeller/images/blue_up.png and /dev/null differ diff --git a/content_modeller/images/edit.gif b/content_modeller/images/edit.gif deleted file mode 100644 index 0222e1dc..00000000 Binary files a/content_modeller/images/edit.gif and /dev/null differ diff --git a/content_modeller/images/file.gif b/content_modeller/images/file.gif deleted file mode 100644 index 7e621679..00000000 Binary files a/content_modeller/images/file.gif and /dev/null differ diff --git a/content_modeller/images/folder-closed.gif b/content_modeller/images/folder-closed.gif deleted file mode 100644 index 54110788..00000000 Binary files a/content_modeller/images/folder-closed.gif and /dev/null differ diff --git a/content_modeller/images/folder.gif b/content_modeller/images/folder.gif deleted file mode 100644 index 2b31631c..00000000 Binary files a/content_modeller/images/folder.gif and /dev/null differ diff --git a/content_modeller/images/minus.gif b/content_modeller/images/minus.gif deleted file mode 100644 index 47fb7b76..00000000 Binary files a/content_modeller/images/minus.gif and /dev/null differ diff --git a/content_modeller/images/plus.gif b/content_modeller/images/plus.gif deleted file mode 100644 index 69066216..00000000 Binary files a/content_modeller/images/plus.gif and /dev/null differ diff --git a/content_modeller/images/purge.gif b/content_modeller/images/purge.gif deleted file mode 100644 index b3037e09..00000000 Binary files a/content_modeller/images/purge.gif and /dev/null differ diff --git a/content_modeller/images/red_info.png b/content_modeller/images/red_info.png deleted file mode 100644 index 017b5945..00000000 Binary files a/content_modeller/images/red_info.png and /dev/null differ diff --git a/content_modeller/images/remove.png b/content_modeller/images/remove.png deleted file mode 100644 index 282e4478..00000000 Binary files a/content_modeller/images/remove.png and /dev/null differ diff --git a/content_modeller/images/treeview-black-line.gif b/content_modeller/images/treeview-black-line.gif deleted file mode 100644 index e5496877..00000000 Binary files a/content_modeller/images/treeview-black-line.gif and /dev/null differ diff --git a/content_modeller/images/treeview-black.gif b/content_modeller/images/treeview-black.gif deleted file mode 100644 index d549b9fc..00000000 Binary files a/content_modeller/images/treeview-black.gif and /dev/null differ diff --git a/content_modeller/images/treeview-default-line.gif b/content_modeller/images/treeview-default-line.gif deleted file mode 100644 index 37114d30..00000000 Binary files a/content_modeller/images/treeview-default-line.gif and /dev/null differ diff --git a/content_modeller/images/treeview-default.gif b/content_modeller/images/treeview-default.gif deleted file mode 100644 index a12ac52f..00000000 Binary files a/content_modeller/images/treeview-default.gif and /dev/null differ diff --git a/content_modeller/images/treeview-famfamfam-line.gif b/content_modeller/images/treeview-famfamfam-line.gif deleted file mode 100644 index 6e289cec..00000000 Binary files a/content_modeller/images/treeview-famfamfam-line.gif and /dev/null differ diff --git a/content_modeller/images/treeview-famfamfam.gif b/content_modeller/images/treeview-famfamfam.gif deleted file mode 100644 index 0cb178e8..00000000 Binary files a/content_modeller/images/treeview-famfamfam.gif and /dev/null differ diff --git a/content_modeller/images/treeview-gray-line.gif b/content_modeller/images/treeview-gray-line.gif deleted file mode 100644 index 37600447..00000000 Binary files a/content_modeller/images/treeview-gray-line.gif and /dev/null differ diff --git a/content_modeller/images/treeview-gray.gif b/content_modeller/images/treeview-gray.gif deleted file mode 100644 index cfb8a2f0..00000000 Binary files a/content_modeller/images/treeview-gray.gif and /dev/null differ diff --git a/content_modeller/images/treeview-red-line.gif b/content_modeller/images/treeview-red-line.gif deleted file mode 100644 index df9e749a..00000000 Binary files a/content_modeller/images/treeview-red-line.gif and /dev/null differ diff --git a/content_modeller/images/treeview-red.gif b/content_modeller/images/treeview-red.gif deleted file mode 100644 index 3bbb3a15..00000000 Binary files a/content_modeller/images/treeview-red.gif and /dev/null differ diff --git a/content_modeller/images/view.gif b/content_modeller/images/view.gif deleted file mode 100644 index eee58178..00000000 Binary files a/content_modeller/images/view.gif and /dev/null differ diff --git a/content_modeller/islandora_content_modeller.info b/content_modeller/islandora_content_modeller.info deleted file mode 100644 index 1df4ff16..00000000 --- a/content_modeller/islandora_content_modeller.info +++ /dev/null @@ -1,7 +0,0 @@ -; $Id$ -name = Islandora Content Modeller -dependencies[] = fedora_repository -description = Allows you to manage and build content models for Islandora/Fedora. -package = Fedora Repository -version = 6.1dev -core = 6.x diff --git a/content_modeller/islandora_content_modeller.module b/content_modeller/islandora_content_modeller.module deleted file mode 100644 index a76390c4..00000000 --- a/content_modeller/islandora_content_modeller.module +++ /dev/null @@ -1,4378 +0,0 @@ - 'Islandora Content Modeller', - 'description' => 'Manage Islandora/Fedora Content Models', - 'page callback' => 'islandora_content_modeller_main', - 'access arguments' => array('administer site configuration'), - 'type' => MENU_NORMAL_ITEM - ); - - $items['admin/content/modeller/ajax/listModels'] = array( - 'page callback' => 'icm_ajax_model_list', - 'access arguments' => array('administer site configuration'), - 'type' => MENU_CALLBACK - ); - - $items['admin/content/modeller/ajax/getFiles'] = array( - 'page callback' => 'icm_ajax_pluginFiles', - 'access arguments' => array('administer site configuration'), - 'type' => MENU_CALLBACK - ); - - $items['admin/content/modeller/ajax/getClasses'] = array( - 'page callback' => 'icm_ajax_getClasses', - 'access arguments' => array('administer site configuration'), - 'type' => MENU_CALLBACK - ); - - $items['admin/content/modeller/ajax/getMethods'] = array( - 'page callback' => 'icm_ajax_getMethods', - 'access arguments' => array('administer site configuration'), - 'type' => MENU_CALLBACK - ); - - $items['admin/content/modeller/ajax/button'] = array( - 'page callback' => 'icm_ajax_button', - 'access arguments' => array('administer site configuration'), - 'type' => MENU_CALLBACK - ); - - $items['admin/content/modeller/ajax/processForm/%'] = array( - 'page callback' => 'icm_ajax_processForm', - 'page arguments' => array(5), - 'access arguments' => array('administer site configuration'), - 'type' => MENU_CALLBACK - ); - - $items['admin/content/modeller/ajax/model'] = array( - 'page callback' => 'icm_ajax_model_tree', - 'access arguments' => array('administer site configuration'), - 'type' => MENU_CALLBACK - ); - - $items['admin/content/modeller/ajax/collection'] = array( - 'page callback' => 'icm_ajax_collection_tree', - 'access arguments' => array('administer site configuration'), - 'type' => MENU_CALLBACK - ); - - return $items; -} - -function icm_get_modules() -{ - $files = module_rebuild_cache(); - - $options=array(''); - foreach ($files as $key=>$val) - { - if ($val->info['package'] == 'Fedora Repository') //only list islandora modules - { - $options[$key]=$key; - } - } - return $options; - -} - -function icm_ajax_pluginFiles() -{ - - echo ''; - $plugin_path = drupal_get_path('module',$_GET['module']); - - if (!$plugin_path) - { - exit(); - } - - $plugin_path.='/plugins'; - - $files = array(''); - - if ( is_dir($plugin_path) && ($dir = opendir($plugin_path)) !== false) - { - while (($file = readdir($dir)) !== false) - { - if (preg_match('/\.inc$/',$file)) - { - echo ''; - } - } - } - exit(); -} - -function icm_ajax_getClasses() -{ - echo ''; - $file = drupal_get_path('module',$_GET['module']); - if (!$file) - { - exit(); - } - - $file.= '/'. $_GET['file']; - - if (file_exists($file)) - { - // hack.. we should really enforce the class name being the same as the file name. - // either that or consider replacing with a plugin register call in each included plugin. - $before_classes = get_declared_classes(); - require_once $file; - $after_classes = get_declared_classes(); - - foreach ($after_classes as $class) - { - if (!in_array($class,$before_classes)) - { - echo ''; - } - } - - } - exit(); -} - -function icm_ajax_getMethods() -{ - echo ''; - $file = drupal_get_path('module',$_GET['module']); - if (!$file) - { - exit(); - } - - $file.= '/'. $_GET['file']; - $class = $_GET['className']; - - if (file_exists($file)) - { - require_once $file; - if (class_exists($class)) - { - $methods = get_class_methods($class); - - foreach ($methods as $method) - { - echo ''; - } - } - - } - exit(); -} - -function icm_ajax_model_list() -{ - global $base_url; - $moduleRoot=drupal_get_path('module','islandora_content_modeller'); - require_once($moduleRoot.'/treeview.inc'); - - $moduleRoot = $base_url.'/'.$moduleRoot; - - module_load_include('inc', 'fedora_repository', 'ContentModel'); - module_load_include('inc', 'fedora_repository', 'CollectionClass'); - - $modelTree = new treeview('Installed Content Models','folder',' ','models'); - - $collectionHelper = new CollectionClass(); - $items = new SimpleXMLElement( $collectionHelper->getRelatedItems(variable_get('fedora_content_model_collection_pid','islandora:ContentModelCollection') ,null,null)); - $modelCount = 0; - if (count($items->results->result) > 0) - { - - foreach ($items->results->result as $res) - { - $child_pid=substr($res->object['uri'],strpos($res->object['uri'],'/')+1); - - if (($cm = ContentModel::loadFromModel($child_pid))!==false) - { - $modelTree->addChild(''.$child_pid.'','file',' '); - $modelCount++; - } - } - } - if ($modelCount == 0) - { - $modelTree->addChild(t('No installed content models found.')); - } - - echo $modelTree->buildTree('filetree'); -} - -function icm_ajax_model_tree() -{ - global $base_url; - $ret =false; - $moduleRoot=drupal_get_path('module','islandora_content_modeller'); - require_once($moduleRoot.'/treeview.inc'); - $moduleRoot=$base_url.'/'.$moduleRoot; - - module_load_include('inc', 'fedora_repository', 'ContentModel'); - - if (isset($_GET['model_pid'])) - { - $cm = ContentModel::loadFromModel(trim($_GET['model_pid'])); - } else - $cm = ContentModel::loadFromObject(variable_get('fedora_repository_pid', 'islandora:top')); - - if ($cm !== false) - { - $cmValid = $cm->validate(); - - $modelTree = new treeview($cm->pid. ($cmValid?'':'!'),'folder',' ','models'); - - if (!$cmValid) - { - // echo '
'.htmlentities($cm->dumpXml()).'
'; - $errorsEl = $modelTree->addChild('XML Errors','folder'); - - foreach (ContentModel::$errors as $err) - { - $errorsEl->addChild(''.$err.''); - } - - } else - { - $mimeTypesEl = $modelTree->addChild('Mimetypes','folder',' '); - $mimetypes=$cm->getMimeTypes(); - foreach ($mimetypes as $type) - { - $mimeTypesEl->addChild($type,'file', ' '); - } - - $datastreams = $cm->listDatastreams(); - $dstreamsEl = $modelTree->addChild('Datastreams','folder', ' '); - - if (count($datastreams) > 0) - { - foreach ($datastreams as $ds) - { - $dsEl = $dstreamsEl->addChild($ds . ($cm->displayInFieldSet($ds)? '(Display in Fieldset) ':''),'file', - ' '. - ' '); - - $dispMethods = $cm->getDisplayMethods($ds); - $dispMethEl = $dsEl->addChild('Display Methods','folder',' '); - if ($dispMethods !== false && count($dispMethods) > 0) - { - foreach ($dispMethods as $meth) - { - $dispMethEl->addChild(($meth['default']==true?'':'').$meth['file'].'
'.$meth['class'].'->'.$meth['method'],'file', - ' '. - ' '. - ($meth['default']==true?'
':'')); - } - } - - $addMethods = $cm->getAddDsMethod($ds); - $addMethodEl = $dsEl->addChild('Add Datastream Method', 'file',' '); - - - } - } - - $ingestRulesEl = $modelTree->addChild('Ingest Rules','folder', ' '); - $rules = $cm->getIngestRules(); - foreach ($rules as $id=>$rule) - { - $ruleEl = $ingestRulesEl->addChild('Rule '.$id,'folder', ' '); - $applToEl = $ruleEl->addChild('Applies To','folder', ' '); - foreach ($rule['applies_to'] as $type) - { - $applToEl->addChild($type,'file', ' '); - } - - $methodsEl=$ruleEl->addChild('Ingest Methods','folder', ' '); - foreach ($rule['ingest_methods'] as $method) - { - $methodEl = $methodsEl->addChild($method['file'].'
'.$method['class'].'->'.$method['method'],'file',' '); - $paramEl = $methodEl->addChild('Parameters','folder',''); - if (count($method['parameters']) > 0) - { - foreach ($method['parameters'] as $key=>$val) - { - $paramEl->addChild($key.' = '.$val,'file', ' '); - } - } - } - - } - - $attr = $cm->getIngestFormAttributes(); - $ingestFormEl = $modelTree->addChild('Ingest Form
(dsid: '.$attr['dsid'].' page: '.$attr['page'].' file_chooser: '.($attr['hide_file_chooser']?'hidden':'visible').' )','folder', - ' '); - - $builderMethod = $cm->getIngestFormBuilderMethod(); - $ingestFormEl->addChild($builderMethod['file'].'
Builder: '.$builderMethod['class'].'->'.$builderMethod['method'].'
Handler: '.$builderMethod['class'].'->'.$builderMethod['handler'],'file'); - - $elementsEl = $ingestFormEl->addChild('Form Elements','folder',' '); - - if (($elements = $cm->getIngestFormElements())!==false) - { - $j=0; - foreach ($elements as $element) - { - - $icons = ' '; - - if ($j > 0) - { - $icons.=' '; - } - - if ($j < count($elements) - 1) - { - $icons.=' '; - } - - $icons .= ' '; - - $elementEl = $elementsEl->addChild(''.$element['label'] .' ' . $element['name'].' ('.$element['type'].')','file',$icons); - $params = $cm->getIngestFormElementParams($element['name']); - $paramEl = $elementEl->addChild('Parameters','folder',''); - if (count($params) > 0) - { - foreach ($params as $key=>$val) - { - $paramEl->addChild($key.' = '.$val,'file', ' '); - } - } - - - if ($element['type'] == 'select' || $element['type'] == 'radio' || $element['type'] == 'other_select') - { - $authListEl = $elementEl->addChild(t('Authoritative List'),'folder',' '); - $i=0; - foreach ($element['authoritative_list'] as $value=>$label) - { - $icons = ' '; - if ($i > 0) - { - $icons .= ' '; - } - - if ($i < count($element['authoritative_list']) - 1) - { - $icons .= ' '; - } - $authListEl->addChild(''.$label.' '.$value,'file',$icons); - $i++; - } - } - - $j++; - } - } - - $addIcon = ''; - $metadataMethod = $cm->getEditMetadataMethod(); - if ($metadataMethod == false) - { - $addIcon = ' '; - } - $metaDataEl = $modelTree->addChild('Edit Metadata Method','folder',$addIcon); - - if ($metadataMethod !== false) - { - $icons = ' '; - $icons .= ' '; - $metaDataEl->addChild('DSID: '.$metadataMethod['dsid'].'
'.$metadataMethod['file'].'
Builder: '.$metadataMethod['class'].'->'.$metadataMethod['method'].'
Handler: '.$metadataMethod['class'].'->'.$metadataMethod['handler'],'file',$icons); - } - - - $modelTree->addChild('Services','folder',' '); - - } - - - $ret = $modelTree->buildTree('filetree'); - } - - if ($ret !== false) - { - echo $ret; - } else - echo t('Error: Unable to load content model'); - - exit(); -} - -function icm_ajax_collection_tree() -{ - global $base_url; - $ret =false; - $moduleRoot=drupal_get_path('module','islandora_content_modeller'); - require_once($moduleRoot.'/treeview.inc'); - $moduleRoot=$base_url.'/'.$moduleRoot; - - module_load_include('inc', 'fedora_repository', 'ContentModel'); - module_load_include('inc', 'fedora_repository', 'CollectionPolicy'); - module_load_include('inc', 'fedora_repository', 'CollectionClass'); - - $collectionHelper = new CollectionClass(); - - $pid=(!isset($_GET['collection_pid']) || strtolower($_GET['collection_pid']) == 'false')?variable_get('fedora_repository_pid', 'islandora:top'):trim($_GET['collection_pid']); - $cm=ContentModel::loadFromObject($pid); - $cp=CollectionPolicy::loadFromCollection($pid); - - $cssPid = $pid;//str_replace(':','_',$pid); - - if ($cm !== false && $cp !== false) - { - $cmValid = $cm->validate(); - $cpValid = $cp->validate(); - - $collectionTree = new treeview($pid .($cpValid?'':'!').' ('.$cm->pid. ($cmValid?'':'!').')','folder',' ','collections'); - - if (!$cmValid || !$cpValid) - { - // echo '
'.htmlentities($cm->dumpXml()).'
'; - $errorsEl = $collectionTree->addChild('XML Errors','folder'); - - foreach (ContentModel::$errors as $err) - { - $errorsEl->addChild(''.$err.''); - } - foreach (CollectionPolicy::$errors as $err) - { - $errorsEl->addChild(''.$err.''); - } - } else - { - - $childrenAllowed = false; - $contentModels = $cp->getContentModels(); - $cm_tree = $collectionTree->addChild('Allowed Content Models','folder',' ',$cssPid.'-cmodels'); - foreach ($contentModels as $ccm) - { - if ($ccm->pid == variable_get('fedora_collection_model_pid','islandora:collectionCModel') ) - { - $childrenAllowed = true; - } - - $cm_tree->addChild($ccm->name.' ('.$ccm->pid.')', 'file', ' '); - } - - $dstreams=$cm->listDatastreams(); - if (count($dstreams) > 0) - { - $ds_tree = $collectionTree->addChild('Datastreams','folder',null,$cssPid.'-dstreams'); - foreach ($dstreams as $ds) - $ds_tree->addChild($ds); - } - - $terms=$cp->getSearchTerms(true); - $search_tree = $collectionTree->addChild('Search Terms','folder',' ', $cssPid.'-terms'); - if (count($terms) > 0) - { - foreach ($terms as $term) - { - $search_tree->addChild(($term['default']?'':'').$term['value'].' ('.$term['field'].')'.($term['default']?'':''), 'file', ' Remove Set as Default '); - } - } - - if ($childrenAllowed) - { - $items = new SimpleXMLElement( $collectionHelper->getRelatedItems($pid,null,null)); - $child_tree= new TreeView('Child Collections','folder',' ',$cssPid.'-children'); - - if (count($items->results->result) > 0) - { - foreach ($items->results->result as $res) - { - $child_pid=substr($res->object['uri'],strpos($res->object['uri'],'/')+1); - $model_pid=substr($res->content['uri'] ,strpos($res->content['uri'],'/')+1); - - $child_cp=CollectionPolicy::loadFromCollection($child_pid); - if ($child_cp !== false) - { - $child_tree->addChild(''.$child_pid.' ('.$model_pid.')','file',' '); - } - } - } - $collectionTree->addChild($child_tree); - } - } - $ret = $collectionTree->buildTree('filetree'); - } - - if ($ret !== false) - { - echo $ret; - } else - echo t('Error: Missing content model and/or collection policy datastream(s) for '. $pid); - - exit(); -} - - -function islandora_content_modeller_main() -{ - global $base_url; - $moduleRoot=drupal_get_path('module','islandora_content_modeller'); - drupal_add_css($moduleRoot.'/css/jquery.treeview.css'); - drupal_add_css($moduleRoot.'/css/content_modeller.css'); - drupal_add_css($moduleRoot.'/css/jquery.jnotify.css'); - drupal_add_css($moduleRoot.'/css/smoothness/jquery-ui-1.8.1.custom.css'); - - drupal_add_js($moduleRoot.'/js/jquery.cookie.js'); - drupal_add_js($moduleRoot.'/js/jquery.treeview.min.js'); - drupal_add_js($moduleRoot.'/js/content_modeller.js'); - drupal_add_js($moduleRoot.'/js/jquery.jnotify.js'); - - $moduleRoot = $base_url.'/'.$moduleRoot; - - $content = '
'; - $content .= 'Refresh Loading
'; - $content .= '

'.t('Collections').'

'; - $content .= '
'; - $content .= '
'; - $content .= '

'.t('Models').'

'; - $content .= 'List Installed Models'; - $content .= '
'; - $content .= '
'; - $content .= '
'; - $content .= '
'; - $content .= '
'; - - return $content; -} - -function icm_ajax_formExists($formName) -{ - $validForms = array('icm_collection_new','icm_collection_edit','icm_collection_purge','icm_model_new','icm_model_purge','icm_model_edit_ingestForm','icm_model_add_mime','icm_collection_add_term','icm_collection_add_cmodel','icm_model_add_ingestMethodParam','icm_model_add_ingestMethod','icm_model_add_ingestRule','icm_model_add_appliesTo', - 'icm_model_add_ds','icm_model_add_dispmeth','icm_model_add_ingestFormElement','icm_model_edit_ingestFormElement','icm_model_add_authListItem','icm_model_update_editMetadataMethod','icm_model_rollback','icm_collection_rollback','icm_display_rawXml','icm_model_add_ingestElementParam', - 'icm_model_edit_adddsmeth','icm_model_service_add'); - return in_array($formName,$validForms); -} - -function icm_ajax_processForm($formName) -{ - $params=null; - if (isset($_GET['formReq'])) - { - $params=preg_split('/\s+/',trim($_GET['formReq'])); - } - - // require_once(drupal_get_path('module','islandora_content_modeller').'/ajaxForms.inc'); - if (icm_ajax_formExists($formName)) - { - - $formContent = drupal_get_form($formName,$params); - echo theme_status_messages('error'); - echo $formContent; - } -} - -function icm_ajax_button() -{ - - module_load_include('inc', 'fedora_repository', 'CollectionPolicy'); - module_load_include('inc', 'fedora_repository', 'ContentModel'); - - $params=null; - if (isset($_GET['formReq'])) - { - $params=preg_split('/\s+/',trim($_GET['formReq'])); - } - - switch (strtolower($params[0])) - { - case 'icm_model_remove_editmetadatamethod': - if (count($params) == 2) - { - $model_pid = $params[1]; - - if (($cm=ContentModel::loadFromModel($model_pid))!==FALSE) - { - if (!$cm->removeEditMetadataMethod() || !$cm->saveToFedora()) - { - echo t('Error: Unable to remove edit metadata method from model %cm_pid.',array('%cm_pid'=>$cm->pid)); - } else - { - echo 'success:'. t('Successfully removed edit metadata method from model %cm_pid.',array('%cm_pid'=>$cm->pid)); - exit(); - } - } else - { - echo t('Error: Unknown content model. Please try again.'); - } - } else - { - echo t('Error: Missing parameters to remove edit metadata method. Please try again.'); - } - break; - - case 'icm_model_remove_authlistitem': - if (count($params) == 4) - { - $model_pid = $params[1]; - $elementName = $params[2]; - $authValue = $params[3]; - - if (($cm=ContentModel::loadFromModel($model_pid))!==FALSE) - { - if (!$cm->removeAuthListItem($elementName,$authValue) || !$cm->saveToFedora()) - { - echo t('Error: Unable to remove authoritative list item %value in model %m_pid.',array('%value'=>$authValue,'%m_pid'=>$cm->pid)); - } else - { - echo 'success:'. t('Successfully removed authoritative list item %value in model %m_pid.',array('%value'=>$authValue,'%m_pid'=>$cm->pid)); - exit(); - } - } else - { - echo t('Error: Unknown content model. Please try again.'); - } - } else - { - echo t('Error: Missing parameters to remove authoritative list item. Please try again.'); - } - break; - - case 'icm_model_inc_authlistitem': - if (count($params) == 4) - { - $model_pid = $params[1]; - $elementName = $params[2]; - $authValue = $params[3]; - - if (($cm=ContentModel::loadFromModel($model_pid))!==FALSE) - { - if (!$cm->incAuthListItem($elementName,$authValue) || !$cm->saveToFedora()) - { - echo t('Error: Unable to increment authoritative list item %value in model %m_pid.',array('%value'=>$authValue,'%m_pid'=>$cm->pid)); - } else - { - echo 'success:'. t('Successfully incremented authoritative list item %value in model %m_pid.',array('%value'=>$authValue,'%m_pid'=>$cm->pid)); - exit(); - } - } else - { - echo t('Error: Unknown content model. Please try again.'); - } - } else - { - echo t('Error: Missing parameters to increment authoritative list item. Please try again.'); - } - break; - - case 'icm_model_dec_authlistitem': - if (count($params) == 4) - { - $model_pid = $params[1]; - $elementName = $params[2]; - $authValue = $params[3]; - - if (($cm=ContentModel::loadFromModel($model_pid))!==FALSE) - { - if (!$cm->decAuthListItem($elementName,$authValue) || !$cm->saveToFedora()) - { - echo t('Error: Unable to decrement authoritative list item %value in model %m_pid.',array('%value'=>$authValue,'%m_pid'=>$cm->pid)); - } else - { - echo 'success:'. t('Successfully decremented authoritative list item %value in model %m_pid.',array('%value'=>$authValue,'%m_pid'=>$cm->pid)); - exit(); - } - } else - { - echo t('Error: Unknown content model. Please try again.'); - } - } else - { - echo t('Error: Missing parameters to decrement authoritative list item. Please try again.'); - } - break; - - case 'icm_model_remove_ingestformelement': - if (count($params) == 3) - { - $model_pid = $params[1]; - $name = $params[2]; - - if (($cm=ContentModel::loadFromModel($model_pid))!==FALSE) - { - if (!$cm->removeIngestFormElement($name) || !$cm->saveToFedora()) - { - echo t('Error: Unable to remove ingest form element %name from model %m_pid.',array('%name'=>$name,'%m_pid'=>$cm->pid)); - } else - { - echo 'success:'. t('Successfully removed ingest form element %name from model %m_pid.',array('%name'=>$name,'%m_pid'=>$cm->pid)); - exit(); - } - } else - { - echo t('Error: Unknown content model. Please try again.'); - } - - } else - { - echo t('Error: Missing parameters to remove ingest form element. Please try again.'); - } - break; - - case 'icm_model_inc_ingestformelement': - if (count($params) == 3) - { - $model_pid = $params[1]; - $name = $params[2]; - - if (($cm=ContentModel::loadFromModel($model_pid))!==FALSE) - { - if (!$cm->incIngestFormElement($name) || !$cm->saveToFedora()) - { - echo t('Error: Unable to increment ingest form element %name from model %m_pid.',array('%name'=>$name,'%m_pid'=>$cm->pid)); - } else - { - echo 'success:'. t('Successfully incremented ingest form element %name from model %m_pid.',array('%name'=>$name,'%m_pid'=>$cm->pid)); - exit(); - } - } else - { - echo t('Error: Unknown content model. Please try again.'); - } - - } else - { - echo t('Error: Missing parameters to increment ingest form element. Please try again.'); - } - break; - - case 'icm_model_dec_ingestformelement': - if (count($params) == 3) - { - $model_pid = $params[1]; - $name = $params[2]; - - if (($cm=ContentModel::loadFromModel($model_pid))!==FALSE) - { - if (!$cm->decIngestFormElement($name) || !$cm->saveToFedora()) - { - echo t('Error: Unable to decrement ingest form element %name from model %m_pid.',array('%name'=>$name,'%m_pid'=>$cm->pid)); - } else - { - echo 'success:'. t('Successfully decremented ingest form element %name from model %m_pid.',array('%name'=>$name,'%m_pid'=>$cm->pid)); - exit(); - } - } else - { - echo t('Error: Unknown content model. Please try again.'); - } - - } else - { - echo t('Error: Missing parameters to decrement ingest form element. Please try again.'); - } - break; - - - case 'icm_model_remove_dispmeth': - if (count($params) == 7) - { - $model_pid = $params[1]; - $dsid = $params[2]; - $module = $params[3]; - $file = $params[4]; - $class = $params[5]; - $method = $params[6]; - - if (($cm=ContentModel::loadFromModel($model_pid))!==FALSE) - { - if (!$cm->removeDispMeth($dsid, $module, $file,$class,$method) || !$cm->saveToFedora()) - { - echo t('Error: Unable to remove display method for datastream %dsid of model %m_pid.',array('%dsid'=>$dsid,'%m_pid'=>$cm->pid)); - } else - { - echo 'success:'. t('Successfully remove display method for datastream %dsid of model %m_pid.',array('%dsid'=>$dsid, '%m_pid'=>$cm->pid)); - exit(); - } - } else - { - echo t('Error: Unknown content model. Please try again.'); - } - - } else - { - echo t('Error: Missing parameters to remove display method of datastream.'); - } - break; - - case 'icm_model_default_dispmeth': - if (count($params) == 7) - { - $model_pid = $params[1]; - $dsid = $params[2]; - $module = $params[3]; - $file = $params[4]; - $class = $params[5]; - $method = $params[6]; - - if (($cm=ContentModel::loadFromModel($model_pid))!==FALSE) - { - if (!$cm->setDefaultDispMeth($dsid,$module,$file,$class,$method) || !$cm->saveToFedora()) - { - echo t('Error: Unable to set default display method for datastream %dsid of model %m_pid.',array('%dsid'=>$dsid,'%m_pid'=>$cm->pid)); - } else - { - echo 'success:'. t('Successfully set default display method for datastream %dsid of model %m_pid.',array('%dsid'=>$dsid, '%m_pid'=>$cm->pid)); - exit(); - } - } else - { - echo t('Error: Unknown content model. Please try again.'); - } - - } else - { - echo t('Error: Missing parameters to set default display method of datastream.'); - } - break; - - case 'icm_model_remove_ds': - if (count($params) == 3) - { - - $model_pid = $params[1]; - - if (($cm=ContentModel::loadFromModel($model_pid))!==FALSE) - { - if (!$cm->removeDs($params[2]) || !$cm->saveToFedora()) - { - echo t('Error: Unable to remove datastream from model %m_pid.',array('%m_pid'=>$cm->pid)); - } else - { - echo 'success:'. t('Successfully removed datastream model %m_pid.',array('%m_pid'=>$cm->pid)); - exit(); - } - } else - { - echo t('Error: Unknown content model. Please try again.'); - } - - } else - { - echo t('Error: Missing parameters for removal of application mimetype.'); - } - break; - case 'icm_model_remove_appliesto': - if (count($params) == 4) - { - - $model_pid = $params[1]; - $rule_id = $params[2]; - - if (($cm=ContentModel::loadFromModel($model_pid))!==FALSE) - { - if (!$cm->removeAppliesTo($rule_id,$params[3] ) || !$cm->saveToFedora()) - { - echo t('Error: Unable to remove application mimetype from Rule %rule_id in model %m_pid.',array('%rule_id'=>$rule_id,'%m_pid'=>$cm->pid)); - } else - { - echo 'success:'. t('Successfully removed application mimetype from Rule %rule_id in model %m_pid.',array('%rule_id'=>$rule_id,'%m_pid'=>$cm->pid)); - exit(); - } - } else - { - echo t('Error: Unknown content model. Please try again.'); - } - - } else - { - echo t('Error: Missing parameters for removal of application mimetype.'); - } - break; - - - case 'icm_model_remove_ingestrule': - - if (count($params) == 3) - { - - $model_pid = $params[1]; - $rule_id = $params[2]; - - if (($cm=ContentModel::loadFromModel($model_pid))!==FALSE) - { - if (!$cm->removeIngestRule($rule_id ) || !$cm->saveToFedora()) - { - echo t('Error: Unable to remove ingest Rule %rule_id in model %m_pid.',array('%rule_id'=>$rule_id,'%m_pid'=>$cm->pid)); - } else - { - echo 'success:'. t('Successfully removed ingest Rule %rule_id in model %m_pid.',array('%rule_id'=>$rule_id,'%m_pid'=>$cm->pid)); - exit(); - } - } else - { - echo t('Error: Unknown content model. Please try again.'); - } - - } else - { - echo t('Error: Missing parameters for removal of ingest rule.'); - } - break; - - case 'icm_model_remove_ingestmethod': - if (count($params) == 7) - { - - $model_pid = $params[1]; - $rule_id = $params[2]; - $module = $params[3]; - $file = $params[4]; - $class = $params[5]; - $method = $params[6]; - - if (($cm=ContentModel::loadFromModel($model_pid))!==FALSE) - { - if (!$cm->removeIngestMethod($rule_id, $module, $file, $class, $method) || !$cm->saveToFedora()) - { - echo t('Error: Unable to remove ingest method of Rule %rule_id in model %m_pid.',array('%rule_id'=>$rule_id,'%m_pid'=>$cm->pid)); - } else - { - echo 'success:'. t('Successfully removed ingest method of Rule %rule_id in model %m_pid.',array('%rule_id'=>$rule_id,'%m_pid'=>$cm->pid)); - exit(); - } - } else - { - echo t('Error: Unknown content model. Please try again.'); - } - - } else - { - echo t('Error: Missing parameters for removal of ingest method.'); - } - break; - - case 'icm_model_remove_ingestmethodparam': - - if (count($params) == 8) - { - - $model_pid = $params[1]; - $rule_id = $params[2]; - $module = $params[3]; - $file = $params[4]; - $class = $params[5]; - $method = $params[6]; - $name = $params[7]; - - - if (($cm=ContentModel::loadFromModel($model_pid))!==FALSE) - { - if (!$cm->removeIngestMethodParam($rule_id, $module, $file, $class, $method, $name) || !$cm->saveToFedora()) - { - echo t('Error: Unable to remove parameter of Rule %rule_id in model %m_pid.',array('%rule_id'=>$rule_id,'%m_pid'=>$cm->pid)); - } else - { - echo 'success:'. t('Successfully removed parameter of Rule %rule_id in model %m_pid.',array('%rule_id'=>$rule_id,'%m_pid'=>$cm->pid)); - exit(); - } - } else - { - echo t('Error: Unknown content model. Please try again.'); - } - - } else - { - echo t('Error: Missing parameters for removal of ingest method parameter.'); - } - - break; - - case 'icm_model_remove_ingestelementparam': - - if (count($params) == 4) - { - - $model_pid = $params[1]; - $element_name = $params[2]; - $name = $params[3]; - - if (($cm=ContentModel::loadFromModel($model_pid))!==FALSE) - { - if (!$cm->setIngestFormElementParam($element_name, $name, FALSE) || !$cm->saveToFedora()) - { - echo t('Error: Unable to remove parameter of element %element in model %m_pid.',array('%element'=>$element_name,'%m_pid'=>$cm->pid)); - } else - { - echo 'success:'. t('Successfully removed parameter of element %element in model %m_pid.',array('%element'=>$element_name,'%m_pid'=>$cm->pid)); - exit(); - } - } else - { - echo t('Error: Unknown content model. Please try again.'); - } - - } else - { - echo t('Error: Missing parameters for removal of form element parameter.'); - } - - break; - - case 'icm_model_toggle_dsdisplay': - if (isset($params[1]) && isset($params[2])) - { - if (($cm=ContentModel::loadFromModel($params[1]))!==FALSE) - { - $dsid = trim($params[2]); - if ($dsid == '') - { - echo t('Error: Datastream missing or not specified. Please try again.'); - } else if (!$cm->setDisplayInFieldset($dsid, !$cm->displayInFieldset($dsid)) || !$cm->saveToFedora()) - { - echo t('Error: Unable to update datastream %dsid in model %m_pid.',array('%dsid'=>$dsid,'%m_pid'=>$cm->pid)); - } else - { - echo 'success:'.t('Successfully updated datastream %dsid in model %m_pid',array('%dsid'=>$dsid,'%m_pid'=>$cm->pid)); - exit(); - } - } else - { - echo t('Error: Unknown content model. Please try again.'); - } - } else - { - echo t('Error: Missing parameters for toggle datastream display in fieldset.'); - } - break; - - case 'icm_collection_remove_cmodel': - - if (isset($params[1]) && isset($params[2])) - { - $cp = CollectionPolicy::loadFromCollection($params[1]); - $cm = ContentModel::loadFromModel($params[2]); - if ($cm !== false && $cp !== false) - { - if (!$cp->removeModel($cm) || !$cp->saveToFedora()) - { - echo t('Error: Unable to remove content model %m_pid from collection policy of %c_pid.',array('%m_pid'=>$cm->pid,'%c_pid'=>$cp->pid)); - } else - { - echo 'success:'.t('Successfully removed content model %m_pid from collection policy of %c_pid.',array('%m_pid'=>$cm->pid,'%c_pid'=>$cp->pid)); - exit(); - } - } else - echo t('Error: Unknown collection policy or content model. Please try again.'); - } else - echo t('Error: Unknown collection policy or content model. Please try again.'); - break; - - case 'icm_collection_default_term': - $c_pid=$params[1]; - if (($cp = CollectionPolicy::loadFromCollection(trim($c_pid)))!== FALSE) - { - $field=isset($params[2])?$params[2]:''; - if (trim($field) != '') - { - if (!$cp->setDefaultTerm(htmlentities($field)) || !$cp->saveToFedora()) - { - echo t('Error: Unable to set default search term to %field in collection policy %cp_id.',array('%field'=>htmlentities($field),'%pc_pid'=>$cp->pid)); - } else - { - echo 'success:'.t('Successfully set default search term %field in collection policy %cp_id.',array('%field'=>htmlentities($field),'%cp_pid'=>$cp->pid)); - exit(); - } - } else - { - echo t('Error: Unknown search term %field selected. Please try again.',array('%field'=>htmlentities($field))); - } - } else - { - echo t('Error: Unknown collection policy. Please try again.'); - } - break; - - - case 'icm_collection_remove_term': - $c_pid=$params[1]; - if (($cp = CollectionPolicy::loadFromCollection(trim($c_pid)))!== FALSE) - { - $field=isset($params[2])?$params[2]:''; - if (trim($field) != '') - { - if (!$cp->removeTerm(htmlentities($field)) || !$cp->saveToFedora()) - { - echo t('Error: Unable to remove search term %field from collection policy %cp_id.',array('%field'=>htmlentities($field),'%c_pid'=>$cp->pid)); - } else - { - echo 'success:'.t('Successfully removed search term %field from collection policy %cp_id.',array('%field'=>htmlentities($field),'%c_pid'=>$cp->pid)); - exit(); - } - } else - { - echo t('Error: Unknown search term %field selected for removal. Please try again.',array('%field'=>htmlentities($field))); - } - } else - { - echo t('Error: Unknown collection policy. Please try again.'); - } - break; - - case 'icm_model_remove_mime': - $m_pid =$params[1]; - if (($cm = ContentModel::loadFromModel(trim($m_pid))) !== FALSE) - { - $type = isset($params[2])?trim($params[2]):''; - if ($type == '') - { - echo t('Error: You must specify a mimetype to remove. Please try again.'); - } else - { - if ($cm->removeMimetype($type) && $cm->saveToFedora()) - { - echo 'success:'.t('Successfully removed mime type %type from content model %m_pid.',array('%type'=>htmlentities($type),'%m_pid'=>htmlentities($m_pid))); - exit(); - } else - { - echo t('Error: Unable to remove mime type %type from content model %m_pid. Please make sure that it isnt the only term left in the content model.',array('%type'=>htmlentities($type),'%m_pid'=>htmlentities($m_pid))); - } - } - } else - { - echo t('Error: Unknown content model. Please try again.'); - } - break; - - default: - echo t('Error: Unknown action %action Please try again',array('%action'=>$params[0])); - } - -} - - - -function icm_model_add_mime_validate($form,&$form_state) -{ - //only proceed if no errors have been found. - if (form_get_errors() !== NULL) - return; - - module_load_include('inc', 'fedora_repository', 'ContentModel'); - if (trim($form_state['values']['addMime']['model_pid'])=='' || ($cm = ContentModel::loadFromModel(trim($form_state['values']['addMime']['model_pid']))) === FALSE) - { - form_set_error('',t('Error: Specified model could not be found.')); - } else if ($cm->addMimetype(trim($form_state['values']['addMime']['type'])) === FALSE || $cm->saveToFedora() === FALSE) - { - form_set_error('',t('Error: Unable to add mimetype to specified model. Please make sure that the mimetype is not already listed in the model.')); - } else - { - echo 'success:'.t('Successfully added mimetype %mimetype to model %model_name',array('%model_name'=>$cm->name,'%mimetype'=>trim($form_state['values']['addMime']['type']))); - exit(); - } -} - -function icm_model_add_mime(&$form_state,$params=null) -{ - - if (is_array($params) && isset($params[0])) - { - $model_pid = $params[0]; - } else if (isset($form_state['post']['addMime']['model_pid'])) - { - $model_pid = $form_state['post']['addMime']['model_pid']; - } - - - $form['addMime'] = array( - '#type'=>'fieldset', - '#title'=> t('Add Mimetype to Model %model_pid', array('%model_pid'=>$model_pid)), - '#tree'=>TRUE - ); - - $form['addMime']['type'] = array( - '#type' => 'textfield', - '#title' => t('Mimetype'), - '#size' => 30, - '#required' => TRUE, - '#description' => t('A content mimetype that can be ingested using this model.'), - ); - - $form['addMime']['model_pid'] = array('#type' => 'hidden', '#value'=> $model_pid); - $form['addMime']['submit'] = array('#type' => 'submit', '#value' => t('Save')); - $form['addMime']['cancel'] = array('#type' => 'button', '#value' => t('Cancel'), '#id'=>'cancel'); - - return $form; - -} - -function icm_collection_add_cmodel_validate($form,&$form_state) -{ - //only proceed if no errors have been found. - if (form_get_errors() !== NULL) - return; - - module_load_include('inc','fedora_repository','CollectionPolicy'); - module_load_include('inc','fedora_repository','ContentModel'); - - if (!ContentModel::validPid($form_state['values']['form']['namespace'])) - { - form_set_error('form][namespace',t('Error: Invalid namespace format.')); - } else - { - $c_pid = $form_state['values']['form']['collection_pid']; - $m_pid = $form_state['values']['form']['model_pid']; - - - if (($cm = ContentModel::loadFromModel($m_pid))!== FALSE && - ($cp = CollectionPolicy::loadFromCollection($c_pid)) !== FALSE) - { - if ($cp->addModel($cm,trim($form_state['values']['form']['namespace'])) && $cp->saveToFedora()) - { - echo 'success:'.t('Successfully added content model %cm_pid% to collection policy of %cp_pid%.',array('%cm_pid%'=>$cm->pid,'%cp_pid%'=>$cp->pid)); - exit(); - - } else - { - form_set_error('form][model_pid',t('Error: Unable to add content model %cm_pid% to collection policy of %cp_pid%. Please make sure that the model is not already listed in the collection policy.',array('%cm_pid%'=>$cm->pid,'%cp_pid%'=>$cp->pid))); - } - - } else - { - form_set_error('',t('Error: Unable to load specified content model or collection policy. Please try again.')); - } - } -} - -function icm_collection_add_cmodel(&$form_state,$params=null) -{ - - if (is_array($params) && isset($params[0])) - { - $collection_pid = $params[0]; - } else if (isset($form_state['post']['form']['collection_pid'])) - { - $collection_pid = $form_state['post']['form']['collection_pid']; - } - - module_load_include('inc','fedora_repository','CollectionClass'); - module_load_include('inc','fedora_repository','ContentModel'); - $collectionHelper = new CollectionClass(); - - $options=array(); - $items = new SimpleXMLElement( $collectionHelper->getRelatedItems(variable_get('fedora_content_model_collection_pid','islandora:ContentModelCollection') ,null,null)); - for ($i = 0; $i < count($items->results->result); $i++) - { - list(,$pid)=preg_split('/\//',$items->results->result[$i]->object['uri']); - - $cm = ContentModel::loadFromModel($pid); - if ($cm !== false) - { - $options[$pid] = $items->results->result[$i]->title .' ('.$pid.')'; - } - } - - $form['form'] = array( - '#type'=>'fieldset', - '#title'=> t('Add content model to collection %collection_pid', array('%collection_pid'=>$collection_pid)), - '#tree'=>TRUE - ); - - $form['form']['model_pid'] = array( - '#type' => 'select', - '#title' => t('Content Model'), - '#required' => TRUE, - '#options' => $options, - '#description' => t('A descriptive label for the field displayed on the search form.'), - ); - - $form['form']['namespace'] = array( - '#type'=> 'textfield', - '#title'=> t('Namespace'), - '#description' => t('The base namespace for objects of this type injested into the collection. eg islandora:collection '), - '#size' => 30, - '#maxSize' => 60, - '#required' => TRUE - ); - - $form['form']['collection_pid'] = array('#type' => 'hidden', '#value'=> $collection_pid); - $form['form']['submit'] = array('#type' => 'submit', '#value' => t('Save')); - $form['form']['cancel'] = array('#type' => 'button', '#value' => t('Cancel'), '#id'=>'cancel'); - - return $form; - -} - -function icm_collection_add_term_validate($form,&$form_state) -{ - //only proceed if no errors have been found. - if (form_get_errors() !== NULL) - return; - - module_load_include('inc', 'fedora_repository', 'CollectionPolicy'); - if (trim($form_state['values']['form']['collection_pid'])=='' || ($cp = CollectionPolicy::loadFromCollection(trim($form_state['values']['form']['collection_pid']))) === FALSE) - { - form_set_error('',t('Error: Specified collection policy could not be found.')); - } else if ($cp->addTerm(trim($form_state['values']['form']['field']),trim($form_state['values']['form']['value'])) === FALSE || $cp->saveToFedora() === FALSE) - { - form_set_error('',t('Error: Unable to add search term to specified collection policy. Please make sure that the field is not already listed in the search terms.')); - } else - { - echo 'success:'.t('Successfully added term %field to collection policy %cp_pid',array('%cp_pid'=>$cp->pid,'%field'=>trim($form_state['values']['form']['field']))); - exit(); - } -} - -function icm_collection_add_term(&$form_state,$params=null) -{ - - if (is_array($params) && isset($params[0])) - { - $collection_pid = $params[0]; - } else if (isset($form_state['post']['collection_pid'])) - { - $collection_pid = $form_state['post']['collection_pid']; - } - - - $form['form'] = array( - '#type'=>'fieldset', - '#title'=> t('Add search term to collection %collection_pid', array('%collection_pid'=>$collection_pid)), - '#tree'=>TRUE - ); - - $form['form']['field'] = array( - '#type' => 'textfield', - '#title' => t('Field'), - '#size' => 30, - '#required' => TRUE, - '#description' => t('The name of the field in the DC to search.'), - ); - - $form['form']['value'] = array( - '#type' => 'textfield', - '#title' => t('Label'), - '#size' => 30, - '#required' => TRUE, - '#description' => t('A descriptive label for the field displayed on the search form.'), - ); - - $form['form']['collection_pid'] = array('#type' => 'hidden', '#value'=> $collection_pid); - $form['form']['submit'] = array('#type' => 'submit', '#value' => t('Save')); - $form['form']['cancel'] = array('#type' => 'button', '#value' => t('Cancel'), '#id'=>'cancel'); - - return $form; - -} - - -function icm_collection_rollback_validate($form,&$form_state) -{ - //only proceed if no errors have been found. - if (form_get_errors() !== NULL) - return; - - module_load_include('inc', 'fedora_repository', 'CollectionPolicy'); - - if (($cp = CollectionPolicy::loadFromCollection($form_state['values']['form']['c_pid']))!==FALSE) - { - - $history = $cp->getHistory(); - $found = false; - foreach ($history as $key=>$ver) - { - if ($ver['versionID'] == $form_state['values']['form']['version']) - { - $found = $key; - break; - } - } - - if ($found === false) - { - form_set_error('',t('Error: Selected version was not found. Please try again.')); - } else if ($found == 0 && $form_state['values']['form']['removeOlder'] == 0) - { - form_set_error('',t('Error: Selected version is the current version. Nothing changed.')); - } else - { - $success=true; - if ($found > 0) - { - $startDate = $history[$found-1]['createDate']; - $success = $cp->purgeVersions($history[$found-1]['createDate'],null); - } - - if ($form_state['values']['form']['removeOlder'] == 1 && isset($history[$found+1])) - { - $endDate = $history[$found+1]['createDate']; - $success = $success && $cp->purgeVersions(null,$endDate); - } - - if ($success) - { - echo 'success:'.t('Successfully rolled back version of collection policy %c_pid.',array('%c_pid'=>$cp->pid)); - exit(); - - } else - { - form_set_error('',t('Error: Unable to roll back version. Check watchdog logs.')); - } - } - - } else - { - form_set_error('',t('Error: Unable to load collection policy %c_pid.',array('%cm_pid'=>htmlentities($form_state['values']['form']['c_pid'])))); - - } -} - -function icm_collection_rollback(&$form_state,$params=null) -{ - - if (is_array($params)) - { - $c_pid = $params[0]; - } else - { - $c_pid = $form_state['post']['form']['model_pid']; - } - - $form['form'] = array( - '#type' => 'fieldset', - '#title' => t('Rollback Collection Policy %$c_pid',array('%$c_pid'=>$c_pid)), - '#tree' => TRUE, - ); - - module_load_include('inc', 'fedora_repository', 'CollectionPolicy'); - - if (($cp = CollectionPolicy::loadFromCollection($c_pid))!==false) - { - - $history = $cp->getHistory(); - - $options = array(); - foreach ($history as $ver) - { - $options[$ver['versionID']] = date(DATE_RFC822,strtotime($ver['createDate'])); - } - - if ($history !== false && count($history) > 0) - { - - - $form['form']['warning'] = array('#value' => 'Warning: Rolling back a datastream will purge all versions up-to the selected datastream.'); - - - $form['form']['cur'] = array( - '#type'=> 'item', - '#title'=> t('Current Version:'), - '#value'=> date(DATE_RFC822,strtotime($history[0]['createDate'])) - ); - - $form['form']['version'] = array( - '#type' => 'select', - '#title' => t('Version'), - '#options' => $options - ); - - $form['form']['removeOlder'] = array( - '#type' => 'checkbox', - '#title' => 'Purge Older Versions', - '#description' => 'If enabled, also purges versions of the datastream that are OLDER than the selected, effectively leaving only the selected version.' - ); - - $form['form']['submit'] = array('#type' => 'submit', '#value' => t('Save')); - - } else - { - $form['form']['version'] = array( - '#type'=> 'item', - '#title'=> t('Rollback to Version:'), - '#value'=> t('only one version available.') - ); - } - - - - } else - { - form_set_error('',t('Error: Unable to load collection policy %c_pid.',array('%c_pid'=>$c_pid))); - } - - $form['form']['c_pid'] = array('#type' => 'hidden', '#value'=> $c_pid); - $form['form']['cancel'] = array('#type' => 'button', '#value' => t('Cancel'), '#id'=>'cancel'); - return $form; -} - -function icm_model_add_ingestMethodParam_validate($form,&$form_state) -{ - //only proceed if no errors have been found. - if (form_get_errors() !== NULL) - return; - - module_load_include('inc', 'fedora_repository', 'ContentModel'); - - if (($cm = ContentModel::loadFromModel($form_state['values']['form']['model_pid']))!==FALSE) - { - if ($cm->addIngestMethodParam($form_state['values']['form']['rule_id'], - $form_state['values']['form']['module'], - $form_state['values']['form']['file'], - $form_state['values']['form']['class'], - $form_state['values']['form']['method'], - $form_state['values']['form']['name'], - $form_state['values']['form']['value']) && $cm->saveToFedora()) - { - echo 'success:'.t('Successfully added parameter to ingest method of Rule %rule_id for model %model_pid.',array('%rule_id'=>htmlentities($form_state['values']['form']['rule_id']),'%model_pid'=>$cm->pid)); - exit(); - } else - { - form_set_error('form][name',t('Error: Unable to add parameter to ingest method of Rule %rule_id for model %model_pid. Please make sure that the parameter is not already listed.',array('%rule_id'=>htmlentities($form_state['values']['form']['rule_id']),'%model_pid'=>$cm->pid))); - } - } else - { - form_set_error('',t('Error: Unable to load content model %cm_pid.',array('%cm_pid'=>htmlentities($form_state['values']['form']['model_pid'])))); - } - -} - - -function icm_model_add_ingestMethodParam(&$form_state,$params=null) -{ - - if (is_array($params)) - { - $model_pid = $params[0]; - $rule_id = $params[1]; - $module = $params[2]; - $file = $params[3]; - $class = $params[4]; - $method = $params[5]; - } else - { - $model_pid = $form_state['post']['model_id']; - $rule_id = $form_state['post']['rule_id']; - $module = $form_state['post']['module']; - $file = $form_state['post']['file']; - $class = $form_state['post']['class']; - $method = $form_state['post']['method']; - } - - $form['form'] = array( - '#type' => 'fieldset', - '#title' => t('Add Ingest Method Parameter to ingest Rule %rule_id of model %model_pid.',array('%rule_id'=>$rule_id,'%model_pid'=>$model_pid)), - '#tree' => TRUE, - ); - - $form['form']['module_label'] = array( - '#type'=> 'item', - '#title'=> t('Module'), - '#value' => $module - ); - - $form['form']['file_label'] = array( - '#type'=> 'item', - '#title'=> t('Filename'), - '#value' => $file - ); - - $form['form']['class_label'] = array( - '#type'=> 'item', - '#title'=> t('Class'), - '#value' => $class - ); - - $form['form']['method_label'] = array( - '#type'=> 'item', - '#title'=> t('Method'), - '#value' => $method - ); - - $form['form']['name'] = array( - '#type' => 'textfield', - '#title' => t('Name'), - '#size' => 30, - '#required' => TRUE, - '#description' => t('The name of the parameter to pass along to the ingest method above.'), - ); - - $form['form']['value'] = array( - '#type' => 'textfield', - '#title' => t('Value'), - '#size' => 30, - '#required' => TRUE, - '#description' => t('The value of the parameter to pass along to the ingest method above'), - ); - - $form['form']['model_pid'] = array('#type' => 'hidden', '#value'=> $model_pid); - $form['form']['rule_id'] = array('#type' => 'hidden', '#value'=> $rule_id); - $form['form']['module'] = array('#type' => 'hidden', '#value'=> $module); - $form['form']['file'] = array('#type' => 'hidden', '#value'=> $file); - $form['form']['class'] = array('#type' => 'hidden', '#value' => $class); - $form['form']['method'] = array('#type' => 'hidden', '#value'=> $method); - - $form['form']['submit'] = array('#type' => 'submit', '#value' => t('Save')); - $form['form']['cancel'] = array('#type' => 'button', '#value' => t('Cancel'), '#id'=>'cancel'); - - - return $form; -} - - -function icm_model_add_ingestElementParam_validate($form,&$form_state) -{ - //only proceed if no errors have been found. - if (form_get_errors() !== NULL) - return; - - module_load_include('inc', 'fedora_repository', 'ContentModel'); - - if (($cm = ContentModel::loadFromModel($form_state['values']['form']['model_pid']))!==FALSE) - { - if ($cm->setIngestFormElementParam($form_state['values']['form']['element_name'], - $form_state['values']['form']['name'], - $form_state['values']['form']['value']) && $cm->saveToFedora()) - { - echo 'success:'.t('Successfully added parameter to form element %element_name for model %model_pid.',array('%element_name'=>htmlentities($form_state['values']['form']['element_name']),'%model_pid'=>$cm->pid)); - exit(); - } else - { - form_set_error('form][name',t('Error: Unable to add parameter to form element %element_name for model %model_pid. Please make sure that the parameter is not already listed.',array('%element_name'=>htmlentities($form_state['values']['form']['element_name']),'%model_pid'=>$cm->pid))); - } - } else - { - form_set_error('',t('Error: Unable to load content model %cm_pid.',array('%cm_pid'=>htmlentities($form_state['values']['form']['model_pid'])))); - } - -} - - -function icm_model_add_ingestElementParam(&$form_state,$params=null) -{ - if (is_array($params)) - { - $model_pid = $params[0]; - $element_name = $params[1]; - } else - { - $model_pid = $form_state['post']['model_id']; - $element_name = $form_state['post']['element_name']; - } - - $form['form'] = array( - '#type' => 'fieldset', - '#title' => t('Add Ingest Form Element Parameter to element %element_name of model %model_pid.',array('%element_name'=>$element_name,'%model_pid'=>$model_pid)), - '#tree' => TRUE, - ); - - $form['form']['name'] = array( - '#type' => 'textfield', - '#title' => t('Name'), - '#size' => 30, - '#required' => TRUE, - '#description' => t('The name of the parameter to pass along to the form element above.'), - ); - - $form['form']['value'] = array( - '#type' => 'textarea', - '#title' => t('Value'), - '#size' => 30, - '#required' => TRUE, - '#description' => t('The value of the parameter to pass along to the form element above'), - ); - - $form['form']['model_pid'] = array('#type' => 'hidden', '#value'=> $model_pid); - $form['form']['element_name'] = array('#type' => 'hidden', '#value'=> $element_name); - - $form['form']['submit'] = array('#type' => 'submit', '#value' => t('Save')); - $form['form']['cancel'] = array('#type' => 'button', '#value' => t('Cancel'), '#id'=>'cancel'); - - - return $form; -} - -function icm_model_add_ingestMethod_validate($form,&$form_state) -{ - //only proceed if no errors have been found. - if (form_get_errors() !== NULL) - return; - - module_load_include('inc', 'fedora_repository', 'ContentModel'); - - - $module = $form_state['values']['form']['module']; - $file = $form_state['values']['form']['filename']; - $class= $form_state['values']['form']['class']; - $method=$form_state['values']['form']['method']; - - $path = drupal_get_path('module',$module); - - if (empty($path) || !file_exists($path.'/'.$file)) - { - form_set_error('form][filename',t('Error: Selected plugin file not found. Please try again.')); - } else - { - require_once ($path.'/'.$file); - if (!class_exists($class)) - { - form_set_error('form][class',t('Error: Specified class does not exist in the plugin. Please try again.')); - } else - { - $obj = new $class; - if (!method_exists($obj,$method)) - { - form_set_error('form][method',t('Error: Specified method does not exist in the specified class/plugin. Please try again.')); - } - } - } - - if (!ContentModel::validDsid($form_state['values']['form']['dsid'])) - { - form_set_error('form][dsid',t('Error: Invalid datastream identifier. Please try again.')); - } - - //only proceed if no errors have been found. - if (form_get_errors() !== NULL) - return; - - module_load_include('inc', 'fedora_repository', 'ContentModel'); - - if (($cm = ContentModel::loadFromModel($form_state['values']['form']['model_pid']))!==FALSE) - { - if ($cm->addIngestMethod($form_state['values']['form']['rule_id'],$module,$module,$file,$class,$method,$form_state['values']['form']['dsid'],$form_state['values']['form']['modified_files_ext']) && $cm->saveToFedora()) - { - echo 'success:'.t('Successfully added ingest method to Rule %rule_id for model %model_pid.',array('%rule_id'=>htmlentities($form_state['values']['form']['rule_id']),'%model_pid'=>$cm->pid)); - exit(); - } else - { - form_set_error('form][name',t('Error: Unable to add ingest method to Rule %rule_id for model %model_pid.',array('%rule_id'=>htmlentities($form_state['values']['form']['rule_id']),'%model_pid'=>$cm->pid))); - } - } else - { - form_set_error('',t('Error: Unable to load content model %cm_pid.',array('%cm_pid'=>htmlentities($form_state['values']['form']['model_pid'])))); - } - -} - -function icm_model_add_ingestMethod(&$form_state,$params=null) -{ - - if (is_array($params)) - { - $model_pid = $params[0]; - $rule_id = $params[1]; - } else - { - $model_pid = $form_state['post']['form']['model_pid']; - $rule_id = $form_state['post']['form']['rule_id']; - } - - $form['form'] = array( - '#type' => 'fieldset', - '#title' => t('Add Ingest Method to ingest Rule %rule_id of model %model_pid',array('%rule_id'=>$rule_id,'%model_pid'=>$model_pid)), - '#tree' => TRUE, - ); - - $form['form']['module'] = array( - '#type' => 'select', - '#title' => t('Module'), - '#element_validate' => array('icm_module_validate'), - '#options'=>icm_get_modules(), - '#required' => TRUE, - '#description' => t('The name of the module containing the plugin file.'), - ); - - $form['form']['filename'] = array( - '#type' => 'textfield', - '#title' => t('File'), - '#element_validate' => array('icm_filename_validate'), - '#required' => TRUE, - '#description' => t('The relative path of the file containing the ingest method class/method.'), - ); - $form['form']['class'] = array( - '#type' => 'textfield', - '#title' => t('Class'), - '#element_validate' => array('icm_class_validate'), - '#required' => TRUE, - '#size'=>30, - '#description' => t('The name of the ingest method class.'), - ); - $form['form']['method'] = array( - '#type' => 'textfield', - '#title' => t('Method'), - '#element_validate' => array('icm_method_validate'), - '#size'=>30, - '#required' => TRUE, - '#description' => t('The name of the class method to call when ingesting a file.'), - ); - - $form['form']['dsid'] = array( - '#type' => 'textfield', - '#title' => t('Datastream Identifier'), - '#size' => 30, - '#maxlength' => 64, - '#required' => TRUE, - '#description' => t('The datastream ID that will store the output from this method.'), - ); - - $form['form']['modified_files_ext'] = array( - '#type' => 'textfield', - '#title' => t('Modified Files Extension'), - '#size' => 30, - '#required' => TRUE, - '#description' => t('The file extension that will be appended to the modified file.'), - ); - - - - $form['form']['model_pid'] = array('#type' => 'hidden', '#value'=> $model_pid); - $form['form']['rule_id'] = array('#type' => 'hidden', '#value'=> $rule_id); - $form['form']['submit'] = array('#type' => 'submit', '#value' => t('Save')); - $form['form']['cancel'] = array('#type' => 'button', '#value' => t('Cancel'), '#id'=>'cancel'); - return $form; -} - -function icm_model_add_appliesTo_validate($form,&$form_state) -{ - //only proceed if no errors have been found. - if (form_get_errors() !== NULL) - return; - - module_load_include('inc', 'fedora_repository', 'ContentModel'); - - if (($cm = ContentModel::loadFromModel($form_state['values']['form']['model_pid']))!==FALSE) - { - if ($cm->addAppliesTo($form_state['values']['form']['rule_id'],$form_state['values']['form']['appliesTo']) && $cm->saveToFedora()) - { - echo 'success:'.t('Successfully added application mimetype to Rule %rule_id for model %model_pid.',array('%rule_id'=>htmlentities($form_state['values']['form']['rule_id']),'%model_pid'=>$cm->pid)); - exit(); - } else - { - form_set_error('form][name',t('Error: Unable to add application mimetype to Rule %rule_id for model %model_pid.',array('%rule_id'=>htmlentities($form_state['values']['form']['rule_id']),'%model_pid'=>$cm->pid))); - } - } else - { - form_set_error('',t('Error: Unable to load content model %cm_pid.',array('%cm_pid'=>htmlentities($form_state['values']['form']['model_pid'])))); - } -} - -function icm_model_add_appliesTo(&$form_state,$params=null) -{ - - if (is_array($params)) - { - $model_pid = $params[0]; - $rule_id = $params[1]; - } else - { - $model_pid = $form_state['post']['form']['model_pid']; - $rule_id = $form_state['post']['form']['rule_id']; - } - - $form['form'] = array( - '#type' => 'fieldset', - '#title' => t('Add application mimetype to ingest Rule %rule_id of model %model_pid',array('%rule_id'=>$rule_id,'%model_pid'=>$model_pid)), - '#tree' => TRUE, - ); - - $form['form']['appliesTo'] = array( - '#type' => 'textfield', - '#title' => t('Applies To'), - '#size' => 30, - '#required' => TRUE, - '#description' => t('A content mimetype that this ingest rule will be applied to.'), - ); - - - $form['form']['model_pid'] = array('#type' => 'hidden', '#value'=> $model_pid); - $form['form']['rule_id'] = array('#type' => 'hidden', '#value'=> $rule_id); - $form['form']['submit'] = array('#type' => 'submit', '#value' => t('Save')); - $form['form']['cancel'] = array('#type' => 'button', '#value' => t('Cancel'), '#id'=>'cancel'); - return $form; -} - - -function icm_model_add_ingestRule_validate($form,&$form_state) -{ - //only proceed if no errors have been found. - if (form_get_errors() !== NULL) - return; - - module_load_include('inc', 'fedora_repository', 'ContentModel'); - - $module = $form_state['values']['form']['module']; - $file = $form_state['values']['form']['filename']; - $class= $form_state['values']['form']['class']; - $method=$form_state['values']['form']['method']; - $path = drupal_get_path('module',$module); - - if (empty($path) || !file_exists($path.'/'.$file)) - { - form_set_error('form][filename',t('Error: Selected plugin file not found. Please try again.')); - } else - { - require_once ($path.'/'.$file); - if (!class_exists($class)) - { - form_set_error('form][class',t('Error: Specified class does not exist in the plugin. Please try again.')); - } else - { - $obj = new $class; - if (!method_exists($obj,$method)) - { - form_set_error('form][method',t('Error: Specified method does not exist in the specified class/plugin. Please try again.')); - } - } - } - - if (!ContentModel::validDsid($form_state['values']['form']['dsid'])) - { - form_set_error('form][dsid',t('Error: Invalid datastream identifier. Please try again.')); - } - - //only proceed if no errors have been found. - if (form_get_errors() !== NULL) - return; - - module_load_include('inc', 'fedora_repository', 'ContentModel'); - - if (($cm = ContentModel::loadFromModel($form_state['values']['form']['model_pid']))!==FALSE) - { - if ($cm->addIngestRule($form_state['values']['form']['appliesTo'],$module,$file,$class,$method,$form_state['values']['form']['dsid'],$form_state['values']['form']['modified_files_ext']) && $cm->saveToFedora()) - { - echo 'success:'.t('Successfully added ingest method to Rule %rule_id for model %model_pid.',array('%rule_id'=>htmlentities($form_state['values']['form']['rule_id']),'%model_pid'=>$cm->pid)); - exit(); - } else - { - form_set_error('form][name',t('Error: Unable to add ingest rule for model %model_pid.',array('%model_pid'=>$cm->pid))); - } - } else - { - form_set_error('',t('Error: Unable to load content model %cm_pid.',array('%cm_pid'=>htmlentities($form_state['values']['form']['model_pid'])))); - } - -} - - - -function icm_model_add_ingestRule(&$form_state,$params=null) -{ - - if (is_array($params)) - { - $model_pid = $params[0]; - } else - { - $model_pid = $form_state['post']['form']['model_pid']; - } - - $form['form'] = array( - '#type' => 'fieldset', - '#title' => t('Add Ingest Rule to model %model_pid',array('%model_pid'=>$model_pid)), - '#tree' => TRUE, - ); - - $form['form']['appliesTo'] = array( - '#type' => 'textfield', - '#title' => t('Applies To'), - '#size' => 30, - '#required' => TRUE, - '#description' => t('A content mimetype that this ingest rule will be applied to.'), - ); - - $form['form']['module'] = array( - '#type' => 'select', - '#title' => t('Module'), - '#element_validate' => array('icm_module_validate'), - '#options'=>icm_get_modules(), - '#required' => TRUE, - '#description' => t('The name of the module containing the plugin file.'), - ); - - $form['form']['filename'] = array( - '#type' => 'textfield', - '#title' => t('File'), - '#element_validate' => array('icm_filename_validate'), - '#required' => TRUE, - '#description' => t('The relative path of the file containing the ingest method class/method.'), - ); - - $form['form']['class'] = array( - '#type' => 'textfield', - '#title' => t('Class'), - '#element_validate' => array('icm_class_validate'), - '#required' => TRUE, - '#size'=>30, - '#description' => t('The name of the ingest method class.'), - ); - $form['form']['method'] = array( - '#type' => 'textfield', - '#title' => t('Method'), - '#element_validate' => array('icm_method_validate'), - '#size'=>30, - '#required' => TRUE, - '#description' => t('The name of the class method to call when ingesting a file.'), - ); - - $form['form']['dsid'] = array( - '#type' => 'textfield', - '#title' => t('Datastream Identifier'), - '#size' => 30, - '#maxlength' => 64, - '#required' => TRUE, - '#description' => t('The datastream ID that will store the output from this method.'), - ); - - $form['form']['modified_files_ext'] = array( - '#type' => 'textfield', - '#title' => t('Modified Files Extension'), - '#size' => 30, - '#required' => TRUE, - '#description' => t('The file extension that will be appended to the modified file.'), - ); - - - - $form['form']['model_pid'] = array('#type' => 'hidden', '#value'=> $model_pid); - $form['form']['submit'] = array('#type' => 'submit', '#value' => t('Save')); - $form['form']['cancel'] = array('#type' => 'button', '#value' => t('Cancel'), '#id'=>'cancel'); - return $form; -} - - -function icm_model_add_ds_validate($form,&$form_state) -{ - module_load_include('inc', 'fedora_repository', 'ContentModel'); - - if (!ContentModel::validDsid($form_state['values']['form']['dsid'])) - { - form_set_error('form][dsid',t('Error: Invalid datastream identifier. Please try again.')); - } - - //only proceed if no errors have been found. - if (form_get_errors() !== NULL) - return; - - - if (($cm = ContentModel::loadFromModel($form_state['values']['form']['model_pid']))!==FALSE) - { - if ($cm->addDs($form_state['values']['form']['dsid'],$form_state['values']['form']['display_in_fieldset']==1) && $cm->saveToFedora()) - { - echo 'success:'.t('Successfully added datastream to model %model_pid.',array('%model_pid'=>$cm->pid)); - exit(); - } else - { - form_set_error('form][name',t('Error: Unable to add datastream to model %model_pid.',array('%model_pid'=>$cm->pid))); - } - } else - { - form_set_error('',t('Error: Unable to load content model %cm_pid.',array('%cm_pid'=>htmlentities($form_state['values']['form']['model_pid'])))); - } - -} - -function icm_model_add_ds(&$form_state,$params=null) -{ - - if (is_array($params)) - { - $model_pid = $params[0]; - } else - { - $model_pid = $form_state['post']['form']['model_pid']; - } - - $form['form'] = array( - '#type' => 'fieldset', - '#title' => t('Add Datastream to model %model_pid',array('%model_pid'=>$model_pid)), - '#tree' => TRUE, - ); - - $form['form']['dsid'] = array( - '#type' => 'textfield', - '#title' => t('Datastream Identifier'), - '#size' => 30, - '#maxlength' => 64, - '#required' => TRUE, - '#description' => t('The datastream ID that will store the output from this method.'), - ); - - $form['form']['display_in_fieldset'] = array( - '#type' => 'checkbox', - '#title' => t('Display in Fieldset'), - '#size' => 30, - '#required' => TRUE, - '#description' => t('Display this datastream in the fieldset for this model?'), - ); - - - - $form['form']['model_pid'] = array('#type' => 'hidden', '#value'=> $model_pid); - $form['form']['submit'] = array('#type' => 'submit', '#value' => t('Save')); - $form['form']['cancel'] = array('#type' => 'button', '#value' => t('Cancel'), '#id'=>'cancel'); - return $form; -} - - -function icm_model_add_dispmeth_validate($form,&$form_state) -{ - //only proceed if no errors have been found. - if (form_get_errors() !== NULL) - return; - - module_load_include('inc', 'fedora_repository', 'ContentModel'); - - $module = $form_state['values']['form']['module']; - $file = $form_state['values']['form']['filename']; - $class= $form_state['values']['form']['class']; - $method=$form_state['values']['form']['method']; - $path = drupal_get_path('module',$module); - - if (empty($path) || !file_exists($path.'/'.$file)) - { - form_set_error('form][filename',t('Error: Selected plugin file not found. Please try again.')); - } else - { - require_once ($path.'/'.$file); - if (!class_exists($class)) - { - form_set_error('form][class',t('Error: Specified class does not exist in the plugin. Please try again.')); - } else - { - $obj = @new $class; - if (!method_exists($obj,$method)) - { - form_set_error('form][method',t('Error: Specified method does not exist in the specified class/plugin. Please try again.')); - } - } - } - - if (!ContentModel::validDsid($form_state['values']['form']['dsid'])) - { - form_set_error('form][dsid',t('Error: Invalid datastream identifier. Please try again.')); - } - - //only proceed if no errors have been found. - if (form_get_errors() !== NULL) - return; - - - if (($cm = ContentModel::loadFromModel($form_state['values']['form']['model_pid']))!==FALSE) - { - if ($cm->addDispMeth($form_state['values']['form']['dsid'],$module,$file,$class,$method) && $cm->saveToFedora()) - { - echo 'success:'.t('Successfully added display method to datastream %dsid of model %model_pid.',array('%dsid'=>htmlentities($form_state['values']['form']['dsid']),'%model_pid'=>$cm->pid)); - exit(); - } else - { - form_set_error('form][name',t('Error: Unable to add display method to datastream %dsid of model %model_pid.',array('%dsid'=>htmlentities($form_state['values']['form']['dsid']),'%model_pid'=>$cm->pid))); - } - } else - { - form_set_error('',t('Error: Unable to load content model %cm_pid.',array('%cm_pid'=>htmlentities($form_state['values']['form']['model_pid'])))); - } -} - -function icm_model_add_dispmeth(&$form_state,$params=null) -{ - - if (is_array($params)) - { - $model_pid = $params[0]; - $dsid = $params[1]; - } else - { - $model_pid = $form_state['post']['form']['model_pid']; - $dsid = $form_state['post']['form']['dsid']; - } - - $form['form'] = array( - '#type' => 'fieldset', - '#title' => t('Add Display Method to datastream %dsid of model %model_pid',array('%dsid'=>$dsid,'%model_pid'=>$model_pid)), - '#tree' => TRUE, - ); - - $form['form']['module'] = array( - '#type' => 'select', - '#title' => t('Module'), - '#element_validate' => array('icm_module_validate'), - '#options'=>icm_get_modules(), - '#required' => TRUE, - '#description' => t('The name of the module containing the plugin file.'), - ); - - $form['form']['filename'] = array( - '#type' => 'textfield', - '#title' => t('File'), - '#element_validate' => array('icm_filename_validate'), - '#required' => TRUE, - '#description' => t('The relative path of the file containing the ingest method class/method.'), - ); - - $form['form']['class'] = array( - '#type' => 'textfield', - '#title' => t('Class'), - '#element_validate' => array('icm_class_validate'), - '#required' => TRUE, - '#size'=>30, - '#description' => t('The name of the ingest method class.'), - ); - $form['form']['method'] = array( - '#type' => 'textfield', - '#title' => t('Method'), - '#element_validate' => array('icm_method_validate'), - '#size'=>30, - '#required' => TRUE, - '#description' => t('The name of the class method to call when displaying the datastream.'), - ); - - $form['form']['model_pid'] = array('#type' => 'hidden', '#value'=> $model_pid); - $form['form']['dsid'] = array('#type' => 'hidden', '#value'=> $dsid); - $form['form']['submit'] = array('#type' => 'submit', '#value' => t('Save')); - $form['form']['cancel'] = array('#type' => 'button', '#value' => t('Cancel'), '#id'=>'cancel'); - return $form; -} - - -function icm_model_edit_ingestForm_validate($form,&$form_state) -{ - module_load_include('inc', 'fedora_repository', 'ContentModel'); - if (!ContentModel::validDsid($form_state['values']['form']['dsid'])) - { - form_set_error('form][dsid',t('Error: Invalid datastream identifier. Please try again.')); - } - - $module=$form_state['values']['form']['module']; - $file = $form_state['values']['form']['filename']; - $class= $form_state['values']['form']['class']; - $method=$form_state['values']['form']['method']; - $handler=$form_state['values']['form']['handler']; - $path = drupal_get_path('module',$module); - - if (empty($path) || !file_exists($path.'/'.$file)) - { - form_set_error('form][filename',t('Error: Selected plugin file not found. Please try again.')); - } else - { - require_once ($path.'/'.$file); - if (!class_exists($class)) - { - form_set_error('form][class',t('Error: Specified class does not exist in the plugin. Please try again.')); - } else - { - $obj = @new $class; - if (!method_exists($obj,$method)) - { - form_set_error('form][method',t('Error: Specified builder method does not exist in the specified class/plugin. Please try again.')); - } - if (!method_exists($obj,$handler)) - { - form_set_error('form][handler',t('Error: Specified handler method does not exist in the specified class/plugin. Please try again.')); - } - } - } - - //only proceed if no errors have been found. - if (form_get_errors() !== NULL) - return; - - - if (($cm = ContentModel::loadFromModel($form_state['values']['form']['model_pid']))!==FALSE) - { - if ($cm->editIngestFormAttributes(htmlentities($form_state['values']['form']['dsid']),htmlentities($form_state['values']['form']['page']),$form_state['values']['form']['hide_file_chooser']==1,$form_state['values']['form']['redirect']==1) - && $cm->editIngestFormBuilderMethod($module,$file,$class,$method,$handler) - && $cm->saveToFedora()) - { - echo 'success:'.t('Successfully updated ingest form of model %model_pid.',array('%model_pid'=>$cm->pid)); - exit(); - } else - { - form_set_error('form][name',t('Error: Unable to update ingest form of model %model_pid.',array('%model_pid'=>$cm->pid))); - } - } else - { - form_set_error('',t('Error: Unable to load content model %cm_pid.',array('%cm_pid'=>htmlentities($form_state['values']['form']['model_pid'])))); - } -} - -function icm_model_edit_ingestForm(&$form_state,$params=null) -{ - - if (is_array($params)) - { - $model_pid = $params[1]; - } else - { - $model_pid = $form_state['post']['form']['model_pid']; - } - - $form['form'] = array( - '#type' => 'fieldset', - '#title' => t('Edit Ingest Form of model %model_pid',array('%model_pid'=>$model_pid)), - '#tree' => TRUE, - ); - - module_load_include('inc', 'fedora_repository', 'ContentModel'); - if (($cm = ContentModel::loadFromModel($model_pid))!==false) - { - - $attr = $cm->getIngestFormAttributes(); - $builderMethod = $cm->getIngestFormBuilderMethod(); - - $form['form']['dsid'] = array( - '#type' => 'textfield', - '#title' => t('Datastream Identifier'), - '#size' => 30, - '#maxlength' => 64, - '#default_value'=>$attr['dsid'], - '#required' => TRUE, - - '#description' => t('The datastream ID that stores the collected metadata from the form.'), - ); - - $form['form']['page'] = array( - '#type' => 'textfield', - '#title' => t('Page'), - '#size' => 3, - '#required' => TRUE, - '#default_value' => $attr['page'], - '#description' => t('??? not sure what this field is for. Cant find a reference to it, candidate for removal. '), - ); - - $form['form']['hide_file_chooser'] = array( - '#type' => 'checkbox', - '#title' => t('Hide File Chooser'), - '#size' => 3, - '#required' => TRUE, - '#default_value' => $attr['hide_file_chooser']?1:0, - '#description' => t('If enabled, the file choose will not be displayed in the ingest form for this model.'), - ); - - $form['form']['redirect'] = array( - '#type' => 'checkbox', - '#title' => t('Redirect on Ingest'), - '#size' => 3, - '#required' => TRUE, - '#default_value' => $attr['redirect']?1:0, - '#description' => t('If enabled, the user will be redirected to the collection view on successful ingest.'), - ); - - $form['form']['module'] = array( - '#type' => 'select', - '#title' => t('Module'), - '#element_validate' => array('icm_module_validate'), - '#options'=>icm_get_modules(), - '#required' => TRUE, - '#default_value'=> ($builderMethod['module']==''?'fedora_repository':$builderMethod['module']), - '#description' => t('The name of the module containing the plugin file.'), - ); - - $form['form']['filename'] = array( - '#type' => 'textfield', - '#title' => t('File'), - '#element_validate' => array('icm_filename_validate'), - '#required' => TRUE, - '#default_value'=> $builderMethod['file'], - '#description' => t('The relative path of the file containing the builder/handler method class/method.'), - ); - - $form['form']['class'] = array( - '#type' => 'textfield', - '#title' => t('Class'), - '#element_validate' => array('icm_class_validate'), - '#required' => TRUE, - '#default_value'=> $builderMethod['class'], - '#size'=>30, - '#description' => t('The name of the builder/handler class.'), - ); - $form['form']['method'] = array( - '#type' => 'textfield', - '#title' => t('Form Builder Method'), - '#element_validate' => array('icm_method_validate'), - '#size'=>30, - '#required' => TRUE, - '#default_value'=> $builderMethod['method'], - '#description' => t('The name of the class method to build the ingest form.'), - ); - - $form['form']['handler'] = array( - '#type' => 'textfield', - '#title' => t('Form Handler Method'), - '#element_validate' => array('icm_method_validate'), - '#size'=>30, - '#required' => TRUE, - '#default_value'=> $builderMethod['handler'], - '#description' => t('The name of the class method to handle the ingest form.'), - ); - - $form['form']['model_pid'] = array('#type' => 'hidden', '#value'=> $model_pid); - $form['form']['submit'] = array('#type' => 'submit', '#value' => t('Save')); - - } else - { - form_set_error('',t('Error: Unable to load content model %model_pid.',array('%model_pid'=>$model_pid))); - } - - $form['form']['cancel'] = array('#type' => 'button', '#value' => t('Cancel'), '#id'=>'cancel'); - - return $form; -} - - -function icm_model_edit_adddsmeth_validate($form,&$form_state) -{ - module_load_include('inc', 'fedora_repository', 'ContentModel'); - if (!ContentModel::validDsid($form_state['values']['form']['dsid'])) - { - form_set_error('form][dsid',t('Error: Invalid datastream identifier. Please try again.')); - } - - $module = $form_state['values']['form']['module']; - $file = $form_state['values']['form']['filename']; - $class= $form_state['values']['form']['class']; - $method=$form_state['values']['form']['method']; - $handler=$form_state['values']['form']['handler']; - $path = drupal_get_path('module',$module); - - if (empty($path) || !file_exists($path.'/'.$file)) - { - form_set_error('form][filename',t('Error: Selected plugin file not found. Please try again.')); - } else - { - require_once ($path.'/'.$file); - if (!class_exists($class)) - { - form_set_error('form][class',t('Error: Specified class does not exist in the plugin. Please try again.')); - } else - { - $obj = @new $class; - if (!method_exists($obj,$method)) - { - form_set_error('form][method',t('Error: Specified builder method does not exist in the specified class/plugin. Please try again.')); - } - if (!method_exists($obj,$handler)) - { - form_set_error('form][handler',t('Error: Specified handler method does not exist in the specified class/plugin. Please try again.')); - } - } - } - - //only proceed if no errors have been found. - if (form_get_errors() !== NULL) - return; - - - if (($cm = ContentModel::loadFromModel($form_state['values']['form']['model_pid']))!==FALSE) - { - if ($cm->editIngestFormAttributes(htmlentities($form_state['values']['form']['dsid']),htmlentities($form_state['values']['form']['page']),$form_state['values']['form']['hide_file_chooser']==1,$form_state['values']['form']['redirect']==1) - && $cm->editIngestFormBuilderMethod($module,$file,$class,$method,$handler) - && $cm->saveToFedora()) - { - echo 'success:'.t('Successfully updated ingest form of model %model_pid.',array('%model_pid'=>$cm->pid)); - exit(); - } else - { - form_set_error('form][name',t('Error: Unable to update ingest form of model %model_pid.',array('%model_pid'=>$cm->pid))); - } - } else - { - form_set_error('',t('Error: Unable to load content model %cm_pid.',array('%cm_pid'=>htmlentities($form_state['values']['form']['model_pid'])))); - } -} - -function icm_model_edit_adddsmeth(&$form_state,$params=null) -{ - - if (is_array($params)) - { - $model_pid = $params[0]; - $dsid = $params[1]; - } else - { - $model_pid = $form_state['post']['form']['model_pid']; - $dsid = $form_state['post']['form']['dsid']; - } - - $form['form'] = array( - '#type' => 'fieldset', - '#title' => t('Edit Add DataStream Method of model %model_pid datastream %dsid',array('%model_pid'=>$model_pid,'%dsid'=>$dsid)), - '#tree' => TRUE, - ); - - $form['form']['label'] = array('#value'=> t('This method will be called when a datastream is ingested into %dsid. The resulting file generated by the method is then ingested into the specified datastream.')); - - module_load_include('inc', 'fedora_repository', 'ContentModel'); - if (($cm = ContentModel::loadFromModel($model_pid))!==false) - { - - $method = $cm->getIngestFormBuilderMethod(); - - - $form['form']['module'] = array( - '#type' => 'select', - '#title' => t('Module'), - '#element_validate' => array('icm_module_validate'), - '#options'=>icm_get_modules(), - '#default_value'=>($method['module']==''?'fedora_repository':$method['module']), - '#required' => TRUE, - '#description' => t('The name of the module containing the plugin file.'), - ); - - $form['form']['filename'] = array( - '#type' => 'textfield', - '#title' => t('File'), - '#element_validate' => array('icm_filename_validate'), - '#default_value' =>$method['file'], - '#required' => TRUE, - '#description' => t('The relative path of the file containing the ingest method class/method.'), - ); - - $form['form']['class'] = array( - '#type' => 'textfield', - '#title' => t('Class'), - '#element_validate' => array('icm_class_validate'), - '#required' => TRUE, - '#default_value'=> $method['class'], - '#size'=>30, - '#description' => t('The name of the class.'), - ); - $form['form']['method'] = array( - '#type' => 'textfield', - '#title' => t('Form Builder Method'), - '#element_validate' => array('icm_method_validate'), - '#size'=>30, - '#required' => TRUE, - '#default_value'=> $method['method'], - '#description' => t('The name of the class method called.'), - ); - - - $form['form']['out_dsid'] = array( - '#type' => 'textfield', - '#title' => t('Datastream Identifier'), - '#size' => 30, - '#maxlength' => 64, - '#default_value'=>$attr['dsid'], - '#required' => TRUE, - '#description' => t('The datastream ID that stores the resulting file from the specified method.'), - ); - - $form['form']['modified_files_ext'] = array( - '#type' => 'textfield', - '#title' => t('Modified Files Extension'), - '#size' => 30, - '#required' => TRUE, - '#description' => t('The file extension that will be appended to the modified file.'), - ); - - $form['form']['model_pid'] = array('#type' => 'hidden', '#value'=> $model_pid); - $form['form']['dsid'] = array('#type' => 'hidden', '#value'=> $dsid); - $form['form']['submit'] = array('#type' => 'submit', '#value' => t('Save')); - - } else - { - form_set_error('',t('Error: Unable to load content model %model_pid.',array('%model_pid'=>$model_pid))); - } - - $form['form']['cancel'] = array('#type' => 'button', '#value' => t('Cancel'), '#id'=>'cancel'); - - return $form; -} - - -function icm_model_add_ingestFormElement_validate($form,&$form_state) -{ - - //only proceed if no errors have been found. - if (form_get_errors() !== NULL) - return; - - module_load_include('inc', 'fedora_repository', 'ContentModel'); - - if (($cm = ContentModel::loadFromModel($form_state['values']['form']['model_pid']))!==FALSE) - { - - $elements = $cm->getIngestFormElements(); - $found = false; - foreach ($elements as $el) - { - if ($el['name']==$form_state['values']['form']['name']) - { - $found=true; - break; - } - } - - if ($found) - { - form_set_error('form][name',t('Error: The specified form element name is already listed in the ingest form. Please edit or delete the existing form element instead.')); - } - else if ($cm->addIngestFormElement(htmlentities($form_state['values']['form']['name']), - htmlentities($form_state['values']['form']['label']), - $form_state['values']['form']['type'], - $form_state['values']['form']['required']==1, - htmlentities($form_state['values']['form']['description'])) && - - $cm->setIngestFormElementParam(htmlentities($form_state['values']['form']['name']), - '#sticky', - $form_state['values']['form']['sticky']==1?'TRUE':false) && - - $cm->setIngestFormElementParam(htmlentities($form_state['values']['form']['name']), - '#autocomplete_path', - trim($form_state['values']['form']['autocomplete'])!=''?trim($form_state['values']['form']['autocomplete']):false) - && $cm->saveToFedora()) - { - echo 'success:'.t('Successfully added ingest form element to model %model_pid.',array('%model_pid'=>$cm->pid)); - exit(); - } else - { - form_set_error('form][name',t('Error: Unable to add ingest form element to model %model_pid.',array('%model_pid'=>$cm->pid))); - } - } else - { - form_set_error('',t('Error: Unable to load content model %cm_pid.',array('%cm_pid'=>htmlentities($form_state['values']['form']['model_pid'])))); - } -} - -function icm_model_add_ingestFormElement(&$form_state,$params=null) -{ - if (is_array($params)) - { - $model_pid = $params[0]; - } else - { - $model_pid = $form_state['post']['form']['model_pid']; - } - - $form['form'] = array( - '#type' => 'fieldset', - '#title' => t('Add element to ingest form of %model_pid',array('%model_pid'=>$model_pid)), - '#tree' => TRUE, - ); - - $form['form']['name'] = array( - '#type' => 'textfield', - '#title' => t('Name'), - '#size' => 30, - '#required' => TRUE, - '#description' => t('The name of the form element.'), - ); - - $form['form']['label'] = array( - '#type' => 'textfield', - '#title' => t('Label'), - '#size' => 30, - '#description' => t('The label that will be displayed for the form element. If left blank, defaults to the element name.'), - ); - - $form['form']['type'] = array( - '#type' => 'select', - '#title' => t('Type'), - '#required'=> TRUE, - '#options'=> array('textfield'=>t('Textfield'), - 'select'=>t('Select'), - 'checkbox'=>t('Checkbox'), - 'radio'=>t('Radio'), - 'textarea'=>t('Textarea'), - 'filechooser'=>t('Ingest File Chooser'), - 'list'=>t('List/Tag Editor'), - 'fieldset'=>t('Fieldset'), - 'people'=>t('People List (incl. name, title, organization, conference, role)'), - 'other_select'=>t('Select (with \'other\' option)'), - 'datepicker'=>t('Datepicker'), - 'copyright'=>t('Creative-Commons Copyright Chooser'), - 'hidden'=>t('Hidden'), - 'file'=>t('File Upload (browse)'), - 'markup'=>t('HTML Markup (no field)'), - ), - '#description'=> t('The type of form element to display.') - ); - - $form['form']['required'] = array( - '#type' => 'checkbox', - '#title' => t('Required'), - '#description' => t('If enabled, the form element will be required.'), - ); - - $form['form']['sticky'] = array( - '#type' => 'checkbox', - '#title' => t('Sticky'), - '#description' => t('If enabled, the entered value will be carried over to the next ingest.'), - ); - - - $form['form']['autocomplete'] = array( - '#type' => 'textfield', - '#title' => t('Autocomplete Path'), - '#description' => t('Filled in, the field will suggest values from the current collection as the user types as listed by the specified drupal path. Only available for textfields.'), - ); - - $form['form']['description'] = array( - '#type' => 'textarea', - '#title' => t('Description'), - '#size'=>30, - '#description' => t('A brief description that will appear next to the form element.'), - ); - - $form['form']['model_pid'] = array('#type' => 'hidden', '#value'=> $model_pid); - $form['form']['submit'] = array('#type' => 'submit', '#value' => t('Save')); - $form['form']['cancel'] = array('#type' => 'button', '#value' => t('Cancel'), '#id'=>'cancel'); - - return $form; -} - - -function icm_model_edit_ingestFormElement_validate($form,&$form_state) -{ - - //only proceed if no errors have been found. - if (form_get_errors() !== NULL) - return; - - module_load_include('inc', 'fedora_repository', 'ContentModel'); - - if (($cm = ContentModel::loadFromModel($form_state['values']['form']['model_pid']))!==FALSE) - { - - $elements = $cm->getIngestFormElements(); - $found = false; - foreach ($elements as $el) - { - if ($el['name']==$form_state['values']['form']['name']) - { - $found=true; - break; - } - } - - if (!$found) - { - form_set_error('form][name',t('Error: The specified form element was not found in the ingest form.')); - } - else if ($cm->editIngestFormElement(htmlentities($form_state['values']['form']['name']), - htmlentities($form_state['values']['form']['label']), - $form_state['values']['form']['type'], - $form_state['values']['form']['required']==1, - htmlentities($form_state['values']['form']['description'])) && - - $cm->setIngestFormElementParam(htmlentities($form_state['values']['form']['name']), - '#sticky', - $form_state['values']['form']['sticky']==1?'TRUE':false) && - - $cm->setIngestFormElementParam(htmlentities($form_state['values']['form']['name']), - '#autocomplete_path', - trim($form_state['values']['form']['autocomplete'])!=''?trim($form_state['values']['form']['autocomplete']):false) && - - $cm->saveToFedora()) - { - echo 'success:'.t('Successfully updated ingest form element to model %model_pid.',array('%model_pid'=>$cm->pid)); - exit(); - } else - { - form_set_error('form][name',t('Error: Unable to updated ingest form element to model %model_pid.',array('%model_pid'=>$cm->pid))); - } - } else - { - form_set_error('',t('Error: Unable to load content model %cm_pid.',array('%cm_pid'=>htmlentities($form_state['values']['form']['model_pid'])))); - } -} - -function icm_model_edit_ingestFormElement(&$form_state,$params=null) -{ - if (is_array($params)) - { - $model_pid = array_shift($params); - $name = join(' ',$params); - } else - { - $model_pid = $form_state['post']['form']['model_pid']; - $name = $form_state['post']['form']['name']; - } - - module_load_include('inc', 'fedora_repository', 'ContentModel'); - if (($cm = ContentModel::loadFromModel($model_pid))!==false) - { - $elements = $cm->getIngestFormElements(); - $element = false; - foreach ($elements as $el) - { - if ($el['name'] == $name) - { - $element=$el; - break; - } - } - - if ($element === false) - { - form_set_error('',t('Error: Specified ingest form element "%name" does not exist. Please try again.',array('%name'=>$name))); - } else - { - - $form['form'] = array( - '#type' => 'fieldset', - '#title' => t('Edit element "%name" in ingest form of %model_pid',array('%name'=>$name,'%model_pid'=>$model_pid)), - '#tree' => TRUE, - ); - - $form['form']['nameDisp'] = array( - '#type' => 'item', - '#title' => t('Name'), - '#description' => t('The name of the form element.'), - '#value'=>$name - ); - - $form['form']['label'] = array( - '#type' => 'textfield', - '#title' => t('Label'), - '#size' => 30, - '#default_value' => ($element['label']==$name)?'':$element['label'], - '#description' => t('The label that will be displayed for the form element. If left blank, defaults to the element name.'), - ); - - $form['form']['type'] = array( - '#type' => 'select', - '#title' => t('Type'), - '#required'=> TRUE, - '#default_value'=>$element['type'], - '#options'=> array('textfield'=>t('Textfield'), - 'select'=>t('Select'), - 'checkbox'=>t('Checkbox'), - 'radio'=>t('Radio'), - 'textarea'=>t('Textarea'), - 'filechooser'=>t('Ingest File Chooser'), - 'list'=>t('List/Tag Editor'), - 'fieldset'=>t('Fieldset'), - 'people'=>t('People List (incl. name, title, organization, conference, role)'), - 'other_select'=>t('Select (with \'other\' option)'), - 'datepicker'=>t('Datepicker'), - 'copyright'=>t('Creative-Commons Copyright Chooser'), - 'hidden'=>t('Hidden'), - 'file'=>t('File Upload (browse)'), - 'markup'=>t('HTML Markup (no field)'), - ), - '#description'=> t('The type of form element to display.
Warning: Changing the type from "Select" or "Radio" to anything else will cause any authoritative list to be permanently removed.') - ); - - $form['form']['required'] = array( - '#type' => 'checkbox', - '#title' => t('Required'), - '#default_value'=> $element['required']?1:0, - '#description' => t('If enabled, the form element will be required.'), - ); - - $form['form']['sticky'] = array( - '#type' => 'checkbox', - '#title' => t('Sticky'), - '#default_value'=> isset($element['parameters']['#sticky']) && $element['parameters']['#sticky']?1:0, - '#description' => t('If enabled, the entered value will be carried over to the next ingest.'), - ); - - $form['form']['autocomplete'] = array( - '#type' => 'textfield', - '#title' => t('Autocomplete Path'), - '#default_value'=> isset($element['parameters']['#autocomplete_path'])?$element['parameters']['#autocomplete_path']:'', - '#description' => t('Filled in, the field will suggest values from the current collection as the user types as listed by the specified drupal path. Only available for textfields.'), - ); - - - $form['form']['description'] = array( - '#type' => 'textarea', - '#title' => t('Description'), - '#default_value' => $element['description'], - '#description' => t('A brief description that will appear next to the form element.'), - ); - - $form['form']['model_pid'] = array('#type' => 'hidden', '#value'=> $model_pid); - $form['form']['name'] = array('#type' => 'hidden', '#value'=> $name); - $form['form']['submit'] = array('#type' => 'submit', '#value' => t('Save')); - } - } else { - form_set_error('',t('Error: Unable to load content model %model_pid.',array('%model_pid'=>$model_pid))); - } - - - $form['form']['cancel'] = array('#type' => 'button', '#value' => t('Cancel'), '#id'=>'cancel'); - - return $form; -} - - -function icm_model_add_authListItem_validate($form,&$form_state) -{ - - //only proceed if no errors have been found. - if (form_get_errors() !== NULL) - return; - - module_load_include('inc', 'fedora_repository', 'ContentModel'); - - if (($cm = ContentModel::loadFromModel($form_state['values']['form']['model_pid']))!==FALSE) - { - - $elements = $cm->getIngestFormElements(); - $found = false; - foreach ($elements as $el) - { - if ($el['name']==$form_state['values']['form']['name']) - { - $found=true; - break; - } - } - - if (!$found) - { - form_set_error('form][name',t('Error: The specified form element was not found in the ingest form.')); - } - else if ($cm->addAuthListItem($form_state['values']['form']['name'],htmlentities($form_state['values']['form']['authValue']),htmlentities($form_state['values']['form']['authLabel'])) - && $cm->saveToFedora()) - { - echo 'success:'.t('Successfully added authoritative list item to ingest form element to model %model_pid.',array('%model_pid'=>$cm->pid)); - exit(); - } else - { - form_set_error('form][name',t('Error: Unable to add authoritative list item to ingest form of model %model_pid.',array('%model_pid'=>$cm->pid))); - } - } else - { - form_set_error('',t('Error: Unable to load content model %cm_pid.',array('%cm_pid'=>htmlentities($form_state['values']['form']['model_pid'])))); - } -} - - - -function icm_model_add_authListItem(&$form_state,$params=null) -{ - if (is_array($params)) - { - $model_pid = array_shift($params); - $name = join(' ',$params); - } else - { - $model_pid = $form_state['post']['form']['model_pid']; - $name = $form_state['post']['form']['name']; - } - - module_load_include('inc', 'fedora_repository', 'ContentModel'); - if (($cm = ContentModel::loadFromModel($model_pid))!==false) - { - $elements = $cm->getIngestFormElements(); - $element = false; - foreach ($elements as $el) - { - if ($el['name'] == $name) - { - $element=$el; - break; - } - } - - if ($element === false) - { - form_set_error('',t('Error: Specified ingest form element "%name" does not exist. Please try again.',array('%name'=>$name))); - } else - { - - $form['form'] = array( - '#type' => 'fieldset', - '#title' => t('Add item to the authoritative list of element "%name" of ingest form for %model_pid',array('%name'=>$name,'%model_pid'=>$model_pid)), - '#tree' => TRUE, - ); - - $form['form']['nameDisp'] = array( - '#type' => 'item', - '#title' => t('Element Name'), - '#description' => t('The name of the form element.'), - '#value'=>$name - ); - - $form['form']['labelDisp'] = array( - '#type' => 'item', - '#title' => t('Element Label'), - '#value' => $element['label'], - '#description' => t('The label that will be displayed for the form element.'), - ); - - - $form['form']['authValue'] = array( - '#type' => 'textfield', - '#title' => t('Value'), - '#size'=> 30, - '#required' => TRUE, - '#description' => t('Authoritative list value.'), - ); - - $form['form']['authLabel'] = array( - '#type' => 'textfield', - '#title' => t('Label'), - '#size'=> 30, - '#description' => t('Authoritative list label. If left blank the item\'s value will also be used as the label.'), - ); - - $form['form']['model_pid'] = array('#type' => 'hidden', '#value'=> $model_pid); - $form['form']['name'] = array('#type' => 'hidden', '#value'=> $name); - $form['form']['submit'] = array('#type' => 'submit', '#value' => t('Save')); - } - } else { - form_set_error('',t('Error: Unable to load content model %model_pid.',array('%model_pid'=>$model_pid))); - } - - - $form['form']['cancel'] = array('#type' => 'button', '#value' => t('Cancel'), '#id'=>'cancel'); - - return $form; -} - - - -function icm_model_update_editMetadataMethod_validate($form,&$form_state) -{ - //only proceed if no errors have been found. - if (form_get_errors() !== NULL) - return; - - module_load_include('inc', 'fedora_repository', 'ContentModel'); - - $module = $form_state['values']['form']['module']; - $file = $form_state['values']['form']['filename']; - $class= $form_state['values']['form']['class']; - $method=$form_state['values']['form']['method']; - $handler=$form_state['values']['form']['handler']; - $path = drupal_get_path('module',$module); - - if (empty($path) || !file_exists($path.'/'.$file)) - { - form_set_error('form][filename',t('Error: Selected plugin file not found. Please try again.')); - } else - { - require_once ($path.'/'.$file); - if (!class_exists($class)) - { - form_set_error('form][class',t('Error: Specified class does not exist in the plugin. Please try again.')); - } else - { - $obj = new $class; - if (!method_exists($obj,$method)) - { - form_set_error('form][method',t('Error: Specified builder method does not exist in the specified class/plugin. Please try again.')); - } - if (!method_exists($obj,$handler)) - { - form_set_error('form][handler',t('Error: Specified handler method does not exist in the specified class/plugin. Please try again.')); - } - } - } - - if (!ContentModel::validDsid($form_state['values']['form']['dsid'])) - { - form_set_error('form][dsid',t('Error: Invalid datastream identifier. Please try again.')); - } - - //only proceed if no errors have been found. - if (form_get_errors() !== NULL) - return; - - module_load_include('inc', 'fedora_repository', 'ContentModel'); - - if (($cm = ContentModel::loadFromModel($form_state['values']['form']['model_pid']))!==FALSE) - { - if ($cm->updateEditMetadataMethod($module,$file,$class,$method,$handler,$form_state['values']['form']['dsid']) && $cm->saveToFedora()) - { - echo 'success:'.t('Successfully updated edit metadata method to model %model_pid.',array('%model_pid'=>$cm->pid)); - exit(); - } else - { - form_set_error('form][name',t('Error: Unable to update edit metadata method to model %model_pid.',array('%model_pid'=>$cm->pid))); - } - } else - { - form_set_error('',t('Error: Unable to load content model %cm_pid.',array('%cm_pid'=>htmlentities($form_state['values']['form']['model_pid'])))); - } - -} - -function icm_model_update_editMetadataMethod(&$form_state,$params=null) -{ - - if (is_array($params)) - { - $model_pid = $params[0]; - } else - { - $model_pid = $form_state['post']['form']['model_pid']; - } - - $form['form'] = array( - '#type' => 'fieldset', - '#title' => t('Update Edit Metadata Method to model %model_pid',array('%model_pid'=>$model_pid)), - '#tree' => TRUE, - ); - - module_load_include('inc', 'fedora_repository', 'ContentModel'); - if (($cm = ContentModel::loadFromModel($model_pid))!==false) - { - - $method = $cm->getEditMetadataMethod(); - - $form['form']['dsid'] = array( - '#type' => 'textfield', - '#title' => t('Datastream Identifier'), - '#size' => 30, - '#maxlength' => 64, - '#default_value'=>isset($method['dsid'])?$method['dsid']:'', - '#required' => TRUE, - '#description' => t('The datastream ID that stores the collected metadata from the form.'), - ); - - $form['form']['module'] = array( - '#type' => 'select', - '#title' => t('Module'), - '#element_validate' => array('icm_module_validate'), - '#options'=>icm_get_modules(), - '#required' => TRUE, - '#default_value'=>isset($method['module'])?$method['module']:'', - '#description' => t('The name of the module containing the plugin file.'), - ); - - $form['form']['filename'] = array( - '#type' => 'textfield', - '#title' => t('File'), - '#element_validate' => array('icm_filename_validate'), - '#default_value'=>isset($method['file'])?$method['file']:'', - '#required' => TRUE, - '#description' => t('The relative path of the file containing the ingest method class/method.'), - ); - - $form['form']['class'] = array( - '#type' => 'textfield', - '#title' => t('Class'), - '#element_validate' => array('icm_class_validate'), - '#required' => TRUE, - '#size'=>30, - '#default_value'=>isset($method['class'])?$method['class']:'', - '#description' => t('The name of the ingest method class.'), - ); - $form['form']['method'] = array( - '#type' => 'textfield', - '#title' => t('Builder Method'), - '#element_validate' => array('icm_method_validate'), - '#size'=>30, - '#required' => TRUE, - '#default_value'=>isset($method['method'])?$method['method']:'', - '#description' => t('The name of the class method to call when building the edit metadata form.'), - ); - - $form['form']['handler'] = array( - '#type' => 'textfield', - '#title' => t('Handler Method'), - '#element_validate' => array('icm_method_validate'), - '#size'=>30, - '#required' => TRUE, - '#default_value'=>isset($method['handler'])?$method['handler']:'', - '#description' => t('The name of the class method to call to handle the edit metadata form.'), - ); - - - $form['form']['model_pid'] = array('#type' => 'hidden', '#value'=> $model_pid); - $form['form']['submit'] = array('#type' => 'submit', '#value' => t('Save')); - } else - { - form_set_error('',t('Error: Unable to load content model %model_pid.',array('%model_pid'=>$model_pid))); - } - - - - $form['form']['cancel'] = array('#type' => 'button', '#value' => t('Cancel'), '#id'=>'cancel'); - return $form; -} - - -function icm_model_rollback_validate($form,&$form_state) -{ - //only proceed if no errors have been found. - if (form_get_errors() !== NULL) - return; - - module_load_include('inc', 'fedora_repository', 'ContentModel'); - - if (($cm = ContentModel::loadFromModel($form_state['values']['form']['model_pid']))!==FALSE) - { - - $history = $cm->getHistory(); - $found = false; - foreach ($history as $key=>$ver) - { - if ($ver['versionID'] == $form_state['values']['form']['version']) - { - $found = $key; - break; - } - } - - if ($found === false) - { - form_set_error('',t('Error: Selected version was not found. Please try again.')); - } else if ($found == 0 && $form_state['values']['form']['removeOlder'] == 0) - { - form_set_error('',t('Error: Selected version is the current version. Nothing changed.')); - } else - { - $success=true; - if ($found > 0) - { - $startDate = $history[$found-1]['createDate']; - $success = $cm->purgeVersions($history[$found-1]['createDate'],null); - } - - if ($form_state['values']['form']['removeOlder'] == 1 && isset($history[$found+1])) - { - $endDate = $history[$found+1]['createDate']; - $success = $success && $cm->purgeVersions(null,$endDate); - } - - if ($success) - { - echo 'success:'.t('Successfully rolled back version of content model %cm_pid',array('%cm_pid'=>$cm->pid)); - exit(); - - } else - { - form_set_error('',t('Error: Unable to roll back version. Check watchdog logs.')); - } - } - - } else - { - form_set_error('',t('Error: Unable to load content model %cm_pid.',array('%cm_pid'=>htmlentities($form_state['values']['form']['model_pid'])))); - - } -} - -function icm_model_rollback(&$form_state,$params=null) -{ - - if (is_array($params)) - { - $model_pid = $params[0]; - } else - { - $model_pid = $form_state['post']['form']['model_pid']; - } - - $form['form'] = array( - '#type' => 'fieldset', - '#title' => t('Rollback Content Model %model_pid',array('%model_pid'=>$model_pid)), - '#tree' => TRUE, - ); - - module_load_include('inc', 'fedora_repository', 'ContentModel'); - - if (($cm = ContentModel::loadFromModel($model_pid))!==false) - { - - $history = $cm->getHistory(); - - $options = array(); - foreach ($history as $ver) - { - $options[$ver['versionID']] = date(DATE_RFC822,strtotime($ver['createDate'])); - } - - if ($history !== false && count($history) > 0) - { - - - $form['form']['warning'] = array('#value' => 'Warning: Rolling back a datastream will purge all versions up-to the selected datastream.'); - - - $form['form']['cur'] = array( - '#type'=> 'item', - '#title'=> t('Current Version:'), - '#value'=> date(DATE_RFC822,strtotime($history[0]['createDate'])) - ); - - $form['form']['version'] = array( - '#type' => 'select', - '#title' => t('Version'), - '#options' => $options - ); - - $form['form']['removeOlder'] = array( - '#type' => 'checkbox', - '#title' => 'Purge Older Versions', - '#description' => 'If enabled, also purges versions of the datastream that are OLDER than the selected, effectively leaving only the selected version.' - ); - - $form['form']['submit'] = array('#type' => 'submit', '#value' => t('Save')); - - } else - { - $form['form']['version'] = array( - '#type'=> 'item', - '#title'=> t('Rollback to Version:'), - '#value'=> t('only one version available.') - ); - } - - - - } else - { - form_set_error('',t('Error: Unable to load content model %model_pid.',array('%model_pid'=>$model_pid))); - } - - $form['form']['model_pid'] = array('#type' => 'hidden', '#value'=> $model_pid); - $form['form']['cancel'] = array('#type' => 'button', '#value' => t('Cancel'), '#id'=>'cancel'); - return $form; -} - -function icm_model_purge_validate($form,&$form_state) -{ - - if ($form_state['values']['form']['confirm'] == 0) - { - form_set_error('form][confirm',t('If you would like to purge the selected content model, please check the confirmation checkbox and try again.')); - } else - { - $model_pid = $form_state['values']['form']['model_pid']; - - module_load_include('inc','fedora_repository','api/fedora_item'); - module_load_include('inc','fedora_repository','ContentModel'); - - if (($cm = ContentModel::loadFromModel($model_pid))!==FALSE) - { - $fedoraItem = new Fedora_Item($model_pid); - - if ($fedoraItem->purge(t('Purged using Islandora Content Modeller.'))) - { - echo 'success:'.t('Successfully purged content model %model_pid.',array('%model_pid'=>$model_pid)); - exit(); - - } else - { - form_set_error('',t('Error: Purge failed. Please contact an administrator for assistance.')); - } - - } else - { - form_set_error('',t('Error: Unable to load specified content model.')); - } - - } -} - -function icm_model_purge(&$form_state,$params=null) -{ - - if (is_array($params)) - { - $model_pid = $params[0]; - } else - { - $model_pid = $form_state['post']['form']['model_pid']; - } - - $form['form'] = array( - '#type' => 'fieldset', - '#title' => t('Purge Content Model %model_pid',array('%model_pid'=>$model_pid)), - '#tree' => TRUE, - ); - - module_load_include('inc', 'fedora_repository', 'ContentModel'); - - if (($cm = ContentModel::loadFromModel($model_pid))!==false) - { - $form['form']['warning'] = array('#value' => 'Warning: Purging a content model will affect any objects and collections that reference the model. Once purged, the entire model will be permanently deleted.'); - - $form['form']['confirm'] = array('#type' => 'checkbox', - '#title' => t('Confirm purge of model %model_pid',array('%model_pid'=>$model_pid)), - '#default_vale' => 0, - '#required' => TRUE); - - $form['form']['submit'] = array('#type' => 'submit', '#value' => t('Save')); - - } else - { - form_set_error('',t('Error: Unable to load content model %model_pid.',array('%model_pid'=>$model_pid))); - } - - $form['form']['model_pid'] = array('#type' => 'hidden', '#value'=> $model_pid); - $form['form']['cancel'] = array('#type' => 'button', '#value' => t('Cancel'), '#id'=>'cancel'); - return $form; -} - -function icm_model_new_submit($form,&$form_state) -{ - - //save the values for the current step into the storage array - $form_state['storage']['values'][$form_state['storage']['step']] = $form_state['values']; - - - if ($form_state['storage']['step'] == 2) - { - - module_load_include('inc','fedora_repository','api/fedora_item'); - module_load_include('inc','fedora_repository','ContentModel'); - - $item = Fedora_Item::ingest_new_item($form_state['storage']['values'][1]['form']['pid'],'A',$form_state['storage']['values'][1]['form']['name']); - $item->add_relationship('fedora-model:hasModel','info:fedora/fedora-system:ContentModel-3.0',FEDORA_MODEL_URI); - $item->add_datastream_from_file(drupal_get_path('module', 'fedora_repository').'/images/Crystal_Clear_action_run.png', 'TN', 'Thumbnail'); - switch ($form_state['storage']['values'][1]['form']['initialize']) - { - case 'blank': - //($pid,$name,$modelDsid, $defaultMimetype, $ingestFormDsid, $ingestFormPage, $ingestFormHideChooser, $ingestFormFile, $ingestFormClass, $ingestFormMethod, $ingestFormHandler) - $cm = ContentModel::ingestBlankModel($form_state['storage']['values'][1]['form']['pid'], - $form_state['storage']['values'][1]['form']['name'], - ContentModel::getDefaultDSID(), - $form_state['storage']['values'][2]['form']['type'], - $form_state['storage']['values'][2]['form']['dsid'], - $form_state['storage']['values'][2]['form']['page'], - $form_state['storage']['values'][2]['form']['hide_file_chooser']==1, - $form_state['storage']['values'][2]['from']['module'], - $form_state['storage']['values'][2]['form']['filename'], - $form_state['storage']['values'][2]['form']['class'], - $form_state['storage']['values'][2]['form']['method'], - $form_state['storage']['values'][2]['form']['handler']); - break; - - case 'model': - $cm = ContentModel::ingestFromModel($form_state['storage']['values'][1]['form']['pid'], - $form_state['storage']['values'][1]['form']['name'], - ContentModel::getDefaultDSID(), - $form_state['storage']['values'][2]['form']['model_pid']); - break; - - case 'file': - $cm = ContentModel::ingestFromFile($form_state['storage']['values'][1]['form']['pid'], - $form_state['storage']['values'][1]['form']['name'], - ContentModel::getDefaultDSID(), - drupal_get_path('module','fedora_repository').'/'.$form_state['storage']['values'][2]['form']['xml_filename']); - - - break; - } - - - - if ($cm !== false) - { - echo 'success:'.t('Successfully ingested new content model.'); - exit(); - }else - { - echo t('Error: Unable to ingest new content model. Please try again or contact an administrator.'); - - } - - } else - { - // check the button that was clicked and action the step chagne - $form_state['storage']['step']++; - - //tell Drupal we are redrawing the same form - $form_state['rebuild'] = TRUE; - - } -} - -function icm_model_new_validate($form, &$form_state) -{ - module_load_include('inc', 'fedora_repository', 'ContentModel'); - module_load_include('inc', 'fedora_repository', 'api/fedora_item'); - - switch ($form_state['storage']['step']) - { - case 1: - if (!ContentModel::validPid($form_state['values']['form']['pid'])) - { - form_set_error('form][pid', t('Error: Invalid persistant identifier. Please try again.')); - } else if (Fedora_Item::fedora_item_exists($form_state['values']['form']['pid'])) - { - form_set_error('form][pid', t('Error: Specified PID already exists. Please choose a different PID and try again.')); - } - break; - - - case 2: - if ($form_state['storage']['values'][1]['form']['initialize'] == 'blank') - { - if (!ContentModel::validDsid($form_state['values']['form']['dsid'])) - { - form_set_error('form][dsid', t('Error: Invalid datastream identifier. Please try again.')); - } - if (intval($form_state['values']['form']['page']) <= 0) - { - form_set_error('form][page', t('Error: Page must be a positive integer. Please try again.')); - } - - $module=$form_state['values']['form']['module']; - $file = $form_state['values']['form']['filename']; - $class= $form_state['values']['form']['class']; - $method=$form_state['values']['form']['method']; - $handler=$form_state['values']['form']['handler']; - $path = drupal_get_path('module',$module); - - if (empty($path) || !file_exists($path.'/'.$file)) - { - form_set_error('form][filename',t('Error: Selected plugin file not found. Please try again.')); - } else - { - require_once ($path.'/'.$file); - if (!class_exists($class)) - { - form_set_error('form][class',t('Error: Specified class does not exist in the plugin. Please try again.')); - } else - { - $obj = @new $class; - if (!method_exists($obj,$method)) - { - form_set_error('form][method',t('Error: Specified builder method does not exist in the specified class/plugin. Please try again.')); - } - if (!method_exists($obj,$handler)) - { - form_set_error('form][handler',t('Error: Specified handler method does not exist in the specified class/plugin. Please try again.')); - } - } - } - } - break; - - } - -} - -function icm_model_new(&$form_state,$params=null) -{ - $form['#multistep']= TRUE; - - $form['form'] = array( - '#type' => 'fieldset', - '#title' => t('Create/Install New Content Model'), - '#tree' => TRUE, - ); - - if (empty($form_state['storage']['step'])) - { - // we are coming in without a step, so default to step 1 - $form_state['storage']['step'] = 1; - } - - switch ($form_state['storage']['step']) - { - case 1: - $form['form']['pid'] = array( - '#type' => 'textfield', - '#title' => t('Persistent Identifier'), - '#size' => 30, - '#required' => TRUE, - '#maxsize' => 64, - '#description' => t('The persistent identifier that will be used to identify the new content model. Make sure to choose a namespace that you will have access to from islandora.'), - ); - - $form['form']['name'] = array( - '#type' => 'textfield', - '#title' => t('Name'), - '#size' => 30, - '#required' => TRUE, - '#description' => t('A short human readable name for the content model.'), - ); - - $form['form']['initialize'] = array( - '#type' => 'select', - '#title' => t('Initialize Content Model'), - '#options' => array('blank'=>t('Start with a blank model'), - 'model'=>t('Clone an existing installed model'), - 'file'=>t('Load from a content model XML file')), - '#description' => t('Determines how the new content model is initialized.') - ); - - break; - - case 2: - - - $form['form']['#description'] = 'PID: '.$form_state['storage']['values'][1]['form']['pid'].'
'. - 'Name: '.$form_state['storage']['values'][1]['form']['name'].'

'; - - switch ($form_state['storage']['values'][1]['form']['initialize']) - { - case 'model': - $form['form']['#description'] .= t('Please select an content model below that will be used as the base for this new content model. The model name will be updated to the value entered in the previous step.'); - module_load_include('inc','fedora_repository','CollectionClass'); - module_load_include('inc','fedora_repository','ContentModel'); - $collectionHelper = new CollectionClass(); - - $options=array(); - $items = new SimpleXMLElement( $collectionHelper->getRelatedItems(variable_get('fedora_content_model_collection_pid','islandora:ContentModelCollection') ,null,null)); - for ($i = 0; $i < count($items->results->result); $i++) - { - list(,$pid)=preg_split('/\//',$items->results->result[$i]->object['uri']); - - $cm = ContentModel::loadFromModel($pid); - if ($cm !== false) - { - $options[$pid] = $items->results->result[$i]->title .' ('.$pid.')'; - } - } - - $form['form']['model_pid'] = array( - '#type' => 'select', - '#title' => t('Content Model'), - '#required' => TRUE, - '#options' => $options, - '#description' => t('The currently installed content model to clone.'), - ); - break; - - case 'file': - $form['form']['#description'] .= t('Please select an ISLANDORACM XML file that will be used as the base for this new content model.'); - - $plugin_path = drupal_get_path('module','fedora_repository').'/content_models'; - - $files = array(''); - if ( ($dir = opendir($plugin_path)) !== false) - { - while (($file = readdir($dir)) !== false) - { - if (preg_match('/\.xml$/',$file)) - { - $files['content_models/'.$file]='content_models/'.$file; - } - } - } - - $form['form']['xml_filename'] = array( - '#type' => 'select', - '#title' => t('File'), - '#options'=>$files, - '#required' => TRUE, - '#description' => t('The relative path of the file containing the desired content model datastream.'), - ); - - break; - - case 'blank': - default: - - $form['form']['#description'] .= t('The only additional required information that a model must have is the ingest form method/handler. Once the model has been added, please go in and add any additional mimetypes, datastreams and ingest rules and ingest form elements that are neccessary. '); - - - $form['form']['type'] = array( - '#type' => 'textfield', - '#title' => t('Mimetype'), - '#size' => 30, - '#required' => TRUE, - '#description' => t('A content mimetype that can be ingested using this model.'), - ); - - $form['form']['dsid'] = array( - '#type' => 'textfield', - '#title' => t('Datastream Identifier'), - '#size' => 30, - '#maxlength' => 64, - '#default_value'=>$attr['dsid'], - '#required' => TRUE, - - '#description' => t('The datastream ID that stores the collected metadata from the form.'), - ); - - $form['form']['page'] = array( - '#type' => 'textfield', - '#title' => t('Page'), - '#size' => 3, - '#required' => TRUE, - '#default_value' => $attr['page'], - '#description' => t('??? not sure what this field is for. Cant find a reference to it, candidate for removal. '), - ); - - $form['form']['hide_file_chooser'] = array( - '#type' => 'checkbox', - '#title' => t('Hide File Chooser'), - '#size' => 3, - '#required' => TRUE, - '#default_value' => $attr['hide_file_chooser']?1:0, - '#description' => t('If enabled, the file choose will not be displayed in the ingest form for this model.'), - ); - - $form['form']['redirect'] = array( - '#type' => 'checkbox', - '#title' => t('Redirect on Ingest'), - '#size' => 3, - '#required' => TRUE, - '#default_value' => $attr['redirect']?1:0, - '#description' => t('If enabled, the user will be redirected to the collection view on successful ingest.'), - ); - - $form['form']['module'] = array( - '#type' => 'select', - '#title' => t('Module'), - '#element_validate' => array('icm_module_validate'), - '#options'=>icm_get_modules(), - '#required' => TRUE, - '#default_value'=>$builderMethod['module'], - '#description' => t('The name of the module containing the form builder plugin file.'), - ); - - $form['form']['filename'] = array( - '#type' => 'textfield', - '#title' => t('File'), - '#element_validate' => array('icm_filename_validate'), - '#required' => TRUE, - '#default_value'=>$builderMethod['file'], - '#description' => t('The relative path of the file containing the form builder/handler class/method.'), - ); - - $form['form']['class'] = array( - '#type' => 'textfield', - '#title' => t('Class'), - '#element_validate' => array('icm_class_validate'), - '#required' => TRUE, - '#default_value'=> $builderMethod['class'], - '#size'=>30, - '#description' => t('The name of the builder/handler class.'), - ); - $form['form']['method'] = array( - '#type' => 'textfield', - '#title' => t('Form Builder Method'), - '#element_validate' => array('icm_method_validate'), - '#size'=>30, - '#required' => TRUE, - '#default_value'=> $builderMethod['method'], - '#description' => t('The name of the class method to build the ingest form.'), - ); - - $form['form']['handler'] = array( - '#type' => 'textfield', - '#title' => t('Form Handler Method'), - '#element_validate' => array('icm_method_validate'), - '#size'=>30, - '#required' => TRUE, - '#default_value'=> $builderMethod['handler'], - '#description' => t('The name of the class method to handle the ingest form.'), - ); - - break; - } - - break; - - } - $form['form']['submit'] = array('#type' => 'submit', '#value' => t('Save')); - $form['form']['cancel'] = array('#type' => 'button', '#value' => t('Cancel'), '#id'=>'cancel'); - - return $form; -} - - - -function icm_collection_purge_validate($form,&$form_state) -{ - - if ($form_state['values']['form']['confirm'] == 0) - { - form_set_error('form][confirm',t('If you would like to purge the selected collection, please check the confirmation checkbox and try again.')); - } else - { - $cp_pid = $form_state['values']['form']['cp_pid']; - - module_load_include('inc','fedora_repository','api/fedora_item'); - module_load_include('inc','fedora_repository','CollectionPolicy'); - - if (($cp = CollectionPolicy::loadFromCollection($cp_pid))!==FALSE) - { - $fedoraItem = new Fedora_Item($cp_pid); - - if ($fedoraItem->purge(t('Purged using Islandora Content Modeller.'))) - { - echo 'success:'.t('Successfully purged collection %cp_pid.',array('%cp_pid'=>$cp_pid)); - exit(); - } else - { - form_set_error('',t('Error: Purge failed. Please contact an administrator for assistance.')); - } - - } else - { - form_set_error('',t('Error: Unable to load specified collection policy.')); - } - - } -} - -function icm_collection_purge(&$form_state,$params=null) -{ - - if (is_array($params)) - { - $cp_pid = $params[0]; - } else - { - $cp_pid = $form_state['post']['form']['cp_pid']; - } - - $form['form'] = array( - '#type' => 'fieldset', - '#title' => t('Purge Collection %cp_pid',array('%cp_pid'=>$cp_pid)), - '#tree' => TRUE, - ); - - module_load_include('inc', 'fedora_repository', 'CollectionPolicy'); - - if (($cm = CollectionPolicy::loadFromCollection($cp_pid))!==false) - { - $form['form']['warning'] = array('#value' => 'Warning: Purging a collection will orphan any objects contained in the collection. This can not be undone.'); - - $form['form']['confirm'] = array('#type' => 'checkbox', - '#title' => t('Confirm purge of collection %cp_pid',array('%cp_pid'=>$cp_pid)), - '#default_vale' => 0, - '#required' => TRUE); - - $form['form']['submit'] = array('#type' => 'submit', '#value' => t('Save')); - - } else - { - form_set_error('',t('Error: Unable to load collection %cp_pid.',array('%cp_pid'=>$cp_pid))); - } - - $form['form']['cp_pid'] = array('#type' => 'hidden', '#value'=> $cp_pid); - $form['form']['cancel'] = array('#type' => 'button', '#value' => t('Cancel'), '#id'=>'cancel'); - return $form; -} - -function icm_collection_new_submit($form,&$form_state) -{ - - //save the values for the current step into the storage array - $form_state['storage']['values'][$form_state['storage']['step']] = $form_state['values']; - - - - if ($form_state['storage']['step'] == 2) - { - - module_load_include('inc','fedora_repository','api/fedora_item'); - module_load_include('inc','fedora_repository','CollectionPolicy'); - - $cp = false; - if (($parent_cp = CollectionPolicy::loadFromCollection($form_state['storage']['parent'])) !== FALSE) - { - $item = Fedora_Item::ingest_new_item($form_state['storage']['values'][1]['form']['pid'],'A',$form_state['storage']['values'][1]['form']['name']); - $item->add_relationship('fedora-model:hasModel','info:fedora/'.variable_get('fedora_collection_model_pid','islandora:collectionCModel') ,FEDORA_MODEL_URI); - $item->add_relationship($parent_cp->getRelationship(),$parent_cp->pid,RELS_EXT_URI); - $item->add_datastream_from_file(drupal_get_path('module', 'fedora_repository').'/images/Crystal_Clear_filesystem_folder_grey.png', 'TN', 'Thumbnail'); - switch ($form_state['storage']['values'][1]['form']['initialize']) - { - case 'blank': - //($pid,$name,$modelDsid, $defaultMimetype, $ingestFormDsid, $ingestFormPage, $ingestFormHideChooser, $ingestFormFile, $ingestFormClass, $ingestFormMethod, $ingestFormHandler) - $cp = CollectionPolicy::ingestBlankPolicy($form_state['storage']['values'][1]['form']['pid'], - $form_state['storage']['values'][1]['form']['name'], - CollectionPolicy::getDefaultDSID(), - $form_state['storage']['values'][2]['form']['model']['pid'], - $form_state['storage']['values'][2]['form']['model']['namespace'], - $form_state['storage']['values'][2]['form']['relationship'], - $form_state['storage']['values'][2]['form']['term']['field'], - $form_state['storage']['values'][2]['form']['term']['value']); - break; - - case 'collection': - $cp = CollectionPolicy::ingestFromCollection($form_state['storage']['values'][1]['form']['pid'], - $form_state['storage']['values'][1]['form']['name'], - CollectionPolicy::getDefaultDSID(), - $form_state['storage']['values'][2]['form']['collection_pid']); - break; - - case 'file': - $cp = CollectionPolicy::ingestFromFile($form_state['storage']['values'][1]['form']['pid'], - $form_state['storage']['values'][1]['form']['name'], - CollectionPolicy::getDefaultDSID(), - drupal_get_path('module','fedora_repository').'/'.$form_state['storage']['values'][2]['form']['policy_filename']); - - - break; - } - } - - - if ($cp !== false) - { - echo 'success:'.t('Successfully ingested new collection.'); - exit(); - }else - { - echo t('Error: Unable to ingest new collection. Please try again or contact an administrator.'); - - } - - } else - { - // check the button that was clicked and action the step chagne - $form_state['storage']['step']++; - - //tell Drupal we are redrawing the same form - $form_state['rebuild'] = TRUE; - - } -} - -function icm_collection_new_validate($form, &$form_state) -{ - module_load_include('inc', 'fedora_repository', 'CollectionPolicy'); - module_load_include('inc', 'fedora_repository', 'ContentModel'); - module_load_include('inc', 'fedora_repository', 'api/fedora_item'); - - if ($cp = CollectionPolicy::loadFromCollection($form_state['storage']['parent']) === FALSE) - { - form_set_error('',t('Error: Unable to load parent collection %cp_pid. Please try adding to a different collection or contact an administrator.',array('%cp_pid',$form_state['storage']['parent']))); - } - - switch ($form_state['storage']['step']) - { - case 1: - if (!CollectionPolicy::validPid($form_state['values']['form']['pid'])) - { - form_set_error('form][pid', t('Error: Invalid persistant identifier. Please try again.')); - } else if (Fedora_Item::fedora_item_exists($form_state['values']['form']['pid'])) - { - form_set_error('form][pid', t('Error: Specified PID already exists. Please choose a different PID and try again.')); - } - break; - - - case 2: - switch ($form_state['storage']['values'][1]['form']['initialize'] ) - { - case 'blank': - if ($form_state['values']['form']['model']['pid'] != $form_state['storage']['values'][1]['form']['pid'] && ($cm = ContentModel::loadFromModel($form_state['values']['form']['model']['pid'])) === FALSE) - { - form_set_error('form][model][pid', t('Error: Specified content model could not be loaded. Please choose a different model or contact an administrator.')); - } - if (!ContentModel::validPid($form_state['values']['form']['model']['namespace'])) - { - form_set_error('form][model][namespace',t('Error: Invalid namespace format.')); - } - break; - - case 'collection': - if (!CollectionPolicy::validPid($form_state['values']['form']['collection_pid']) || ($cp = CollectionPolicy::loadFromCollection($form_state['values']['form']['collection_pid'])) === FALSE) - { - form_set_error('form][collection_pid', t('Error: Specified collection could not be loaded. Please choose a different collection or contact an administrator.')); - } - break; - - } - break; - - } - -} - -function icm_collection_new(&$form_state,$params=null) -{ - $form['#multistep']= TRUE; - - $form['form'] = array( - '#type' => 'fieldset', - '#title' => t('Create/Install New Collection'), - '#tree' => TRUE, - ); - - if (empty($form_state['storage']['step'])) - { - // we are coming in without a step, so default to step 1 - $form_state['storage']['step'] = 1; - $form_state['storage']['parent'] = $params[0]; - } - - switch ($form_state['storage']['step']) - { - case 1: - $form['form']['pid'] = array( - '#type' => 'textfield', - '#title' => t('Persistent Identifier'), - '#size' => 30, - '#required' => TRUE, - '#maxsize' => 64, - '#description' => t('The persistent identifier that will be used to identify the new collection. Make sure to choose a namespace that you will have access to from islandora.'), - ); - - $form['form']['name'] = array( - '#type' => 'textfield', - '#title' => t('Name'), - '#size' => 30, - '#required' => TRUE, - '#description' => t('A short human readable name for the collection.'), - ); - - $form['form']['initialize'] = array( - '#type' => 'select', - '#title' => t('Initialize Collection Policy'), - '#options' => array('blank'=>t('Start with a blank policy'), - 'collection'=>t('Clone the policy from an existing collection'), - 'file'=>t('Load from a collection policy XML file')), - '#description' => t('Determines how the new collection policy is initialized.') - ); - - break; - - case 2: - - - $form['form']['#description'] = 'PID: '.$form_state['storage']['values'][1]['form']['pid'].'
'. - 'Name: '.$form_state['storage']['values'][1]['form']['name'].'

'; - - switch ($form_state['storage']['values'][1]['form']['initialize']) - { - case 'collection': - $form['form']['#description'] .= t('Please select a collection below whose collection policy will be used as the basis for the new collection. The collections name will be updated to the value entered in the previous step.'); - module_load_include('inc','fedora_repository','CollectionClass'); - module_load_include('inc','fedora_repository','ContentModel'); - - $form['form']['collection_pid'] = array( - '#type' => 'textfield', - '#title' => t('Collection'), - '#required' => TRUE, - '#size' => 30, - '#maxsize' => 64, - '#description' => t('The currently installed collection to clone.'), - ); - break; - - case 'file': - $form['form']['#description'] .= t('Please select an COLLECTION_POLICY XML file that will be used as the base for this new collection.'); - - $plugin_path = drupal_get_path('module','fedora_repository').'/collection_policies'; - $files = array(''); - if ( ($dir = opendir($plugin_path)) !== false) - { - while (($file = readdir($dir)) !== false) - { - if (preg_match('/\.xml$/',$file)) - { - $files['collection_policies/'.$file]='collection_policies/'.$file; - } - } - } - - $form['form']['policy_filename'] = array( - '#type' => 'select', - '#title' => t('File'), - '#options'=>$files, - '#required' => TRUE, - '#description' => t('The relative path of the file containing the desired collection policy datastream.'), - ); - - break; - - case 'blank': - default: - - $form['form']['#description'] .= t('The only additional required information that a collection must have is an allowed content model, relationship and default search term. Once the collection has been added, please go in and add any content models and search terms that are neccessary. '); - - module_load_include('inc','fedora_repository','CollectionClass'); - module_load_include('inc','fedora_repository','ContentModel'); - $collectionHelper = new CollectionClass(); - - $options=array($form_state['storage']['values'][1]['form']['pid']=> 'Self ('.$form_state['storage']['values'][1]['form']['pid'].')'); - $items = new SimpleXMLElement( $collectionHelper->getRelatedItems(variable_get('icm_model_collection_pid','islandora:ContentModelCollection') ,null,null)); - for ($i = 0; $i < count($items->results->result); $i++) - { - list(,$pid)=preg_split('/\//',$items->results->result[$i]->object['uri']); - - $cm = ContentModel::loadFromModel($pid); - if ($cm !== false) - { - $options[$pid] = $items->results->result[$i]->title .' ('.$pid.')'; - } - } - - $form['form']['relationship'] = array( - '#type' => 'textfield', - '#title'=> t('Relationship'), - '#size' => 30, - '#required' => TRUE, - '#description' => t('The relationship to use for objects in this collection.'), - '#default_value' => 'isMemberOfCollection' - ); - - $form['form']['model'] = array( - '#type' => 'fieldset', - '#title' => t('Initial Content Model'), - '#tree' => TRUE, - ); - - $form['form']['model']['pid'] = array( - '#type' => 'select', - '#title' => t('Persistent Identifier'), - '#required' => TRUE, - '#options' => $options, - '#description' => t('The PID of the content model that can be ingested into this collection.'), - ); - - - $form['form']['model']['namespace'] = array( - '#type'=> 'textfield', - '#title'=> t('Namespace'), - '#description' => t('The base namespace for objects of this type injested into the collection. eg islandora:collection '), - '#size' => 30, - '#maxSize' => 60, - '#required' => TRUE - ); - - $form['form']['term'] = array( - '#type' => 'fieldset', - '#title' => t('Search Term'), - '#tree' => TRUE, - ); - - $form['form']['term']['field'] = array( - '#type' => 'textfield', - '#title' => t('Field'), - '#size' => 30, - '#required' => TRUE, - '#description' => t('The name of the field in the DC to search.'), - ); - - $form['form']['term']['value'] = array( - '#type' => 'textfield', - '#title' => t('Label'), - '#size' => 30, - '#required' => TRUE, - '#description' => t('A descriptive label for the field displayed on the search form.'), - ); - - - break; - } - - break; - - } - $form['form']['submit'] = array('#type' => 'submit', '#value' => t('Save')); - $form['form']['cancel'] = array('#type' => 'button', '#value' => t('Cancel'), '#id'=>'cancel'); - - return $form; -} - - -function icm_collection_edit_validate($form,&$form_state) -{ - //only proceed if no errors have been found. - if (form_get_errors() !== NULL) - return; - - module_load_include('inc','fedora_repository','CollectionPolicy'); - - $c_pid = $form_state['values']['form']['collection_pid']; - - if (($cp = CollectionPolicy::loadFromCollection($c_pid)) !== FALSE) - { - if ($cp->setRelationship(trim($form_state['values']['form']['relationship'])) && $cp->setStagingArea(trim($form_state['values']['form']['staging_area'])) && $cp->saveToFedora()) - { - echo 'success:'.t('Successfully updated collection policy of %cp_pid%.',array('%cp_pid%'=>$cp->pid)); - exit(); - - } else - { - form_set_error('',t('Error: Unable to update collection policy of %cp_pid%.',array('%cp_pid%'=>$cp->pid))); - } - } -} - - -function icm_collection_edit(&$form_state,$params=null) -{ - - if (is_array($params) && isset($params[0])) - { - $collection_pid = $params[0]; - } else if (isset($form_state['post']['form']['collection_pid'])) - { - $collection_pid = $form_state['post']['form']['collection_pid']; - } - - $form['form'] = array( - '#type'=>'fieldset', - '#title'=> t('Edit collection %collection_pid', array('%collection_pid'=>$collection_pid)), - '#tree'=>TRUE - ); - - module_load_include('inc','fedora_repository','CollectionPolicy'); - if (($cp = CollectionPolicy::loadFromCollection($collection_pid))!==FALSE) - { - - $staging_area = $cp->getStagingArea(false); - if ($staging_area == false) - { - $staging_area = ''; - } - - $form['form']['relationship'] = array( - '#type' => 'textfield', - '#title' => t('Relationship'), - '#required' => TRUE, - '#default_value' => $cp->getRelationship(), - '#size' => 30, - '#maxSize' => 60, - '#description' => t('The relationship to use for members of this collection.'), - ); - - $form['form']['staging_area'] = array( - '#type'=> 'textfield', - '#title'=> t('Staging Area'), - '#default_value'=> $staging_area, - '#description' => t('The path to the staging area to use when ingesting files into this collection. If left blank, the staging area of the parent collection will be used. Please do not include a trailing slash.'), - '#size' => 30, - '#maxSize' => 60 - ); - - $form['form']['collection_pid'] = array('#type' => 'hidden', '#value'=> $collection_pid); - $form['form']['submit'] = array('#type' => 'submit', '#value' => t('Save')); - } else - { - form_set_error('',t('Error: Unable to load requested collection_policy.')); - } - - - $form['form']['cancel'] = array('#type' => 'button', '#value' => t('Cancel'), '#id'=>'cancel'); - - return $form; -} - -function /*icm*/_model_service_add(&$form_state,$params=null) -{ - - if (empty($form_state['storage']['step'])) - { - // we are coming in without a step, so default to step 1 - $form_state['storage']['step'] = 1; - $form_state['storage']['cm_pid'] = $params[0]; - } - - $cm_pid = $form_state['storage']['cm_pid']; - - $form['#multistep']= TRUE; - - $form['form'] = array( - '#type' => 'fieldset', - '#title' => t('Add Service to Content Model %cm_pid.',array('%cm_pid'=>$cm_pid)), - '#tree' => TRUE, - ); - - - switch ($form_state['storage']['step']) - { - case 1: - - module_load_include('inc','fedora_repository','CollectionClass'); - $collectionHelper = new CollectionClass(); - - $options=array(); - $items = new SimpleXMLElement( $collectionHelper->getRelatedItems(variable_get('fedora_service_def_collection_pid','uofm:serviceDefCollection') ,null,null)); - for ($i = 0; $i < count($items->results->result); $i++) - { - list(,$pid)=preg_split('/\//',$items->results->result[$i]->object['uri']); - - $cm = ContentModel::loadFromModel($pid); - if ($cm !== false) - { - $options[$pid] = $items->results->result[$i]->title .' ('.$pid.')'; - } - } - - $form['form'] = array( - '#type'=>'fieldset', - '#title'=> t('Add content model to collection %collection_pid', array('%collection_pid'=>$collection_pid)), - '#tree'=>TRUE - ); - - $form['form']['model_pid'] = array( - '#type' => 'select', - '#title' => t('Content Model'), - '#required' => TRUE, - '#options' => $options, - '#description' => t('A descriptive label for the field displayed on the search form.'), - ); - - $form['form']['namespace'] = array( - '#type'=> 'textfield', - '#title'=> t('Namespace'), - '#description' => t('The base namespace for objects of this type injested into the collection. eg islandora:collection '), - '#size' => 30, - '#maxSize' => 60, - '#required' => TRUE - ); - break; - - } - $form['form']['submit'] = array('#type' => 'submit', '#value' => t('Save')); - $form['form']['cancel'] = array('#type' => 'button', '#value' => t('Cancel'), '#id'=>'cancel'); - - return $form; -} - -function icm_display_rawXml(&$form_state,$params=null) -{ - - $form['form'] = array( - '#type' => 'fieldset', - '#title' => t('Display Raw XML'), - '#tree' => TRUE, - ); - - if (is_array($params)) - { - $type = $params[0]; - $pid = $params[1]; - - switch (strtolower($type)) - { - case 'model': - module_load_include('inc', 'fedora_repository', 'ContentModel'); - if (($cm = ContentModel::loadFromModel($pid))!==false) - { - $form['form']['pid'] = array( - '#type'=>'item', - '#title'=>t('PID'), - '#value'=>$pid - ); - $form['form']['pre'] = array( - '#value'=>'
'.htmlentities($cm->dumpXml()).'
' - ); - } else - { - form_set_error('',t('Error: Unable to load requested content model.')); - } - break; - - case 'collection': - module_load_include('inc', 'fedora_repository', 'CollectionPolicy'); - if (($cp = CollectionPolicy::loadFromCollection($pid))!==false) - { - $form['form']['pid'] = array( - '#type'=>'item', - '#title'=>t('PID'), - '#value'=>$pid - ); - $form['form']['pre'] = array( - '#value'=>'
'.htmlentities($cp->dumpXml()).'
' - ); - } else - { - form_set_error('',t('Error: Unable to load requested collection policy.')); - } - break; - } - - } else - { - form_set_error('',t('Error: Unknown XML Datastream Specified.')); - } - $form['form']['cancel'] = array('#type' => 'button', '#value' => t('Close'), '#id'=>'cancel'); - - return $form; -} - diff --git a/content_modeller/js/content_modeller.js b/content_modeller/js/content_modeller.js deleted file mode 100644 index 3d815111..00000000 --- a/content_modeller/js/content_modeller.js +++ /dev/null @@ -1,271 +0,0 @@ - var collection = new Array('Root'); - var model = false; - -$(document).ready(function () { - - $(document).ajaxStart(function(){ - $('#ajaxBusy').show(); - }).ajaxStop(function(){ - $('#ajaxBusy').hide(); - }); - - $('#Notification').jnotifyInizialize({ - oneAtTime: false, - appendType: 'append' - }) - .css({ - 'marginTop': '20px', - 'left': '20px', - 'width': '500px', - 'z-index': '9999' - }); - - updateCollectionTree(); - updateModelList(); - - $('.refresh').click(function () { - $('#Notification').jnotifyAddMessage({text: 'Refreshed collection '+collection[collection.length-1]+' and model '+(model==false?'list':model)+'.', permanent: false}); - updateCollectionTree(); - if (model == false) - updateModelList(); - else - updateModelTree(); - return false; - }); - - $('.list').click(function () { - $('#Notification').jnotifyAddMessage({text: 'Refreshed model list.', permanent: false}); - model = false; - updateModelList(); - return false; - }); - - - function updateBreadcrumbs() - { - var content = ''; - for (var i = 0; i < collection.length; i++) - { - content += ''+collection[i]+' /'; - } - $('#collection_crumbs').html(content); - } - - function handleForm() - { - $('#edit-form-module').change(function () { - $.get('modeller/ajax/getFiles/', { module: $('#edit-form-module').val() }, function (data) { - $('#edit-form-filename-select').html(data); - }); - $('#edit-form-class-select, #edit-form-method-select, #edit-form-handler-select').html(''); - }); - - $('.form-item #edit-form-filename').hide(); - $('.form-item #edit-form-filename').before(''); - $('#edit-form-filename-select').change(function () { - $('#edit-form-filename').val($('#edit-form-filename-select').val()); - $.get('modeller/ajax/getClasses/', { module: $('#edit-form-module').val(), - file: $('#edit-form-filename').val(), - className: $('#edit-form-class').val() }, - function (data) { $('#edit-form-class-select').html(data); }); - }); - - - $('.form-item #edit-form-class').hide(); - $('.form-item #edit-form-class').before(''); - $('#edit-form-class-select').change(function () { - $('#edit-form-class').val($('#edit-form-class-select').val()); - $.get('modeller/ajax/getMethods/', { module: $('#edit-form-module').val(), - file: $('#edit-form-filename').val(), - className: $('#edit-form-class').val() }, - function (data) { - $('#edit-form-method-select').html(data); - $('#edit-form-handler-select').html(data); - }); - }); - - if ($('#edit-form-file').val() || $('#edit-form-class').val() || $('#edit-form-filename').val()) - { - $.get('modeller/ajax/getFiles/', { module: $('#edit-form-module').val(), file: $('#edit-form-filename').val() }, function (data) { - $('#edit-form-filename-select').html(data); - }); - $.get('modeller/ajax/getClasses/', { module: $('#edit-form-module').val(), file: $('#edit-form-filename').val(), className: $('#edit-form-class').val() }, function (data) { - $('#edit-form-class-select').html(data); - }); - } - - $('.form-item #edit-form-method, .form-item #edit-form-handler').hide(); - $('.form-item #edit-form-method').before(''); - $('.form-item #edit-form-handler').before(''); - $('#edit-form-method-select').change(function () { - $('#edit-form-method').val($('#edit-form-method-select').val()); - }); - $('#edit-form-handler-select').change(function () { - $('#edit-form-handler').val($('#edit-form-handler-select').val()); - }); - - - if ( $('#edit-form-class').val()) - { - $.get('modeller/ajax/getMethods/', { module: $('#edit-form-module').val(), file: $('#edit-form-filename').val(), className: $('#edit-form-class').val(), method: $('#edit-form-method').val() }, function (data) { - $('#edit-form-method-select').html(data); - }); - $.get('modeller/ajax/getMethods/', { module: $('#edit-form-module').val(), file: $('#edit-form-filename').val(), className: $('#edit-form-class').val(), method: $('#edit-form-handler').val() }, function (data) { - $('#edit-form-handler-select').html(data); - }); - } - - $('#ajaxForm #cancel').click(function (d) { - $('#ajaxForm').fadeOut(); - return false; - }); - - $('#ajaxForm form').submit(function (d) { - $.post(d.target.action, - $('#'+d.target.id).serialize()+'&op=Save', - function (data) - { - lines = data.split(':'); - if (lines.shift() == 'success') - { - $('#Notification').jnotifyAddMessage({text: lines.join(':'), permanent: false}); - $('#ajaxForm').fadeOut(); - if (model == false) - updateModelList(); - else - updateModelTree(); - updateCollectionTree(); - } else - { - $('#ajaxForm').html(data); - handleForm(); - } - }); - return false; - }); - } - - function buttonIcons() - { - $('.ajaxButtonIcon').unbind(); - $('.ajaxButtonIcon').click(function () { - $.get('modeller/ajax/button', { formReq: this.id}, function (data) { - lines = data.split(':'); - if (lines.shift() == 'success') - { - $('#Notification').jnotifyAddMessage({text: lines.join(':'), permanent: false}); - if (model == false) - updateModelList(); - else - updateModelTree(); - updateCollectionTree(); - } else - { - $('#Notification').jnotifyAddMessage({text: data, permanent: false, type: 'error'}); - } - }); - - }); - } - - function formIcons() - { - $('.ajaxFormIcon').unbind(); - $('.ajaxFormIcon').click(function () { - var params=this.id.split(' '); - var formName=params.shift(); - $.get('modeller/ajax/processForm/'+formName, { formReq: params.join(' ')}, function (data) { - if (data == '') - { - $('#Notification').jnotifyAddMessage({text: 'Error: Unable to load requested form \''+formName+'\'.', permanent: false, type: 'error'}); - } else - { - $('#ajaxForm').html(data).fadeIn(); - handleForm(); - } - }); - - return false; - }); - } - - function updateModelList() { - $.get('modeller/ajax/listModels' , function (j) { - $('#model_tree').html(j); - $('#model_tree ul').treeview({ animated: "fast", - collapsed: true, - unique: false, - persist: "cookie", - cookieId: "modelTree"}); - - $(".list_model").click( function () { - model = this.id; - updateModelTree(); - $('#Notification').jnotifyAddMessage({text: 'Displayed model '+this.id, permanent: false}); - return false; - }); - - buttonIcons(); - formIcons(); - - }); - } - - function updateModelTree() { - $.get('modeller/ajax/model', { model_pid: model} , function (j) { - $('#model_tree').html(j); - $('#model_tree ul').treeview({ animated: "fast", - collapsed: true, - unique: false, - persist: "cookie", - cookieId: "modelTree"}); - - buttonIcons(); - formIcons(); - - }); - } - - function updateCollectionTree() { - collection_pid = collection[collection.length-1]; - if (collection_pid == 'Root') - collection_pid = false; - - $.get('modeller/ajax/collection', { collection_pid: collection_pid} , function (j) { - updateBreadcrumbs(); - - $('#collection_tree').html(j); - $('#collection_tree ul').treeview({ animated: "fast", - collapsed: true, - unique: false, - persist: "cookie", - cookieId: "collectionTree" }); - - buttonIcons(); - formIcons(); - - $(".collection_model").click( function () { - model = this.id; - updateModelTree(); - $('#Notification').jnotifyAddMessage({text: 'Displayed model '+this.id, permanent: false}); - return false; - }); - - $(".collection_child").click( function () { - collection.push(this.id); - updateCollectionTree(); - $('#Notification').jnotifyAddMessage({text: 'Switched to collection '+this.id, permanent: false}); - return false; - }); - - $(".collection_crumb").click( function () { - var pop_no = collection.length-this.id-1; - for (var i =0; i < pop_no; i++) - collection.pop(); - updateCollectionTree(); - $('#Notification').jnotifyAddMessage({text: 'Switched to collection '+collection[collection.length-1], permanent: false}); - return false; - }); - }); - } - }); diff --git a/content_modeller/js/jquery.cookie.js b/content_modeller/js/jquery.cookie.js deleted file mode 100644 index 8e8e1d9e..00000000 --- a/content_modeller/js/jquery.cookie.js +++ /dev/null @@ -1,92 +0,0 @@ -/** - * Cookie plugin - * - * Copyright (c) 2006 Klaus Hartl (stilbuero.de) - * Dual licensed under the MIT and GPL licenses: - * http://www.opensource.org/licenses/mit-license.php - * http://www.gnu.org/licenses/gpl.html - * - */ - -/** - * Create a cookie with the given name and value and other optional parameters. - * - * @example $.cookie('the_cookie', 'the_value'); - * @desc Set the value of a cookie. - * @example $.cookie('the_cookie', 'the_value', {expires: 7, path: '/', domain: 'jquery.com', secure: true}); - * @desc Create a cookie with all available options. - * @example $.cookie('the_cookie', 'the_value'); - * @desc Create a session cookie. - * @example $.cookie('the_cookie', null); - * @desc Delete a cookie by passing null as value. - * - * @param String name The name of the cookie. - * @param String value The value of the cookie. - * @param Object options An object literal containing key/value pairs to provide optional cookie attributes. - * @option Number|Date expires Either an integer specifying the expiration date from now on in days or a Date object. - * If a negative value is specified (e.g. a date in the past), the cookie will be deleted. - * If set to null or omitted, the cookie will be a session cookie and will not be retained - * when the the browser exits. - * @option String path The value of the path atribute of the cookie (default: path of page that created the cookie). - * @option String domain The value of the domain attribute of the cookie (default: domain of page that created the cookie). - * @option Boolean secure If true, the secure attribute of the cookie will be set and the cookie transmission will - * require a secure protocol (like HTTPS). - * @type undefined - * - * @name $.cookie - * @cat Plugins/Cookie - * @author Klaus Hartl/klaus.hartl@stilbuero.de - */ - -/** - * Get the value of a cookie with the given name. - * - * @example $.cookie('the_cookie'); - * @desc Get the value of a cookie. - * - * @param String name The name of the cookie. - * @return The value of the cookie. - * @type String - * - * @name $.cookie - * @cat Plugins/Cookie - * @author Klaus Hartl/klaus.hartl@stilbuero.de - */ -jQuery.cookie = function(name, value, options) { - if (typeof value != 'undefined') { // name and value given, set cookie - options = options || {}; - if (value === null) { - value = ''; - options.expires = -1; - } - var expires = ''; - if (options.expires && (typeof options.expires == 'number' || options.expires.toUTCString)) { - var date; - if (typeof options.expires == 'number') { - date = new Date(); - date.setTime(date.getTime() + (options.expires * 24 * 60 * 60 * 1000)); - } else { - date = options.expires; - } - expires = '; expires=' + date.toUTCString(); // use expires attribute, max-age is not supported by IE - } - var path = options.path ? '; path=' + options.path : ''; - var domain = options.domain ? '; domain=' + options.domain : ''; - var secure = options.secure ? '; secure' : ''; - document.cookie = [name, '=', encodeURIComponent(value), expires, path, domain, secure].join(''); - } else { // only name given, get cookie - var cookieValue = null; - if (document.cookie && document.cookie != '') { - var cookies = document.cookie.split(';'); - for (var i = 0; i < cookies.length; i++) { - var cookie = jQuery.trim(cookies[i]); - // Does this cookie string begin with the name we want? - if (cookie.substring(0, name.length + 1) == (name + '=')) { - cookieValue = decodeURIComponent(cookie.substring(name.length + 1)); - break; - } - } - } - return cookieValue; - } -}; \ No newline at end of file diff --git a/content_modeller/js/jquery.jnotify.js b/content_modeller/js/jquery.jnotify.js deleted file mode 100644 index 0366e791..00000000 --- a/content_modeller/js/jquery.jnotify.js +++ /dev/null @@ -1,143 +0,0 @@ -/** -* jQuery.jNotify -* jQuery Notification Engine -* -* Copyright (c) 2010 Fabio Franzini -* -* Permission is hereby granted, free of charge, to any person obtaining a copy -* of this software and associated documentation files (the "Software"), to deal -* in the Software without restriction, including without limitation the rights -* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -* copies of the Software, and to permit persons to whom the Software is -* furnished to do so, subject to the following conditions: -* -* The above copyright notify and this permission notify shall be included in -* all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -* THE SOFTWARE. -* -* @author Fabio Franzini -* @copyright 2010 www.fabiofranzini.com -* @version 1 -**/ - -(function(jQuery) { - jQuery.fn.jnotifyInizialize = function(options) { - var element = this; - - var defaults = { - oneAtTime: false, - appendType: 'append' - }; - - var options = jQuery.extend({}, defaults, options); - - this.addClass('notify-wrapper'); - - if (options.oneAtTime) - this.addClass('notify-wrapper-oneattime'); - - if (options.appendType == 'prepend' && options.oneAtTime == false) - this.addClass('notify-wrapper-prepend'); - - return this; - }; - jQuery.fn.jnotifyAddMessage = function(options) { - - var notifyWrapper = this; - - if (notifyWrapper.hasClass('notify-wrapper')) { - - var defaults = { - text: '', - type: 'message', - showIcon: true, - permanent: false, - disappearTime: 3000 - }; - - var options = jQuery.extend({}, defaults, options); - var styleClass; - var iconClass; - - switch (options.type) { - case 'message': - { - styleClass = 'ui-state-highlight'; - iconClass = 'ui-icon-info'; - } - break; - case 'error': - { - styleClass = 'ui-state-error'; - iconClass = 'ui-icon-alert'; - } - break; - default: - { - styleClass = 'ui-state-highlight'; - iconClass = 'ui-icon-info'; - } - break; - } - - if (notifyWrapper.hasClass('notify-wrapper-oneattime')) { - this.children().remove(); - } - - var notifyItemWrapper = jQuery('
'); - var notifyItem = jQuery('
') - .addClass(styleClass); - - if (notifyWrapper.hasClass('notify-wrapper-prepend')) - notifyItem.prependTo(notifyWrapper); - else - notifyItem.appendTo(notifyWrapper); - - notifyItem.wrap(notifyItemWrapper); - - if (options.showIcon) - jQuery('') - .addClass(iconClass) - .appendTo(notifyItem); - - jQuery('').html(options.text).appendTo(notifyItem); - jQuery('
') - .prependTo(notifyItem) - .click(function() { remove(notifyItem) }); - - // IEsucks - if (navigator.userAgent.match(/MSIE (\d+\.\d+);/)) { - notifyWrapper.css({ top: document.documentElement.scrollTop }); - //http://groups.google.com/group/jquery-dev/browse_thread/thread/ba38e6474e3e9a41 - notifyWrapper.removeClass('IEsucks'); - } - // ------ - - if (!options.permanent) { - setTimeout(function() { remove(notifyItem); }, options.disappearTime); - } - } - - function remove(obj) { - obj.animate({ opacity: '0' }, 600, function() { - obj.parent().animate({ height: '0px' }, 300, - function() { - obj.parent().remove(); - // IEsucks - if (navigator.userAgent.match(/MSIE (\d+\.\d+);/)) { - //http://groups.google.com/group/jquery-dev/browse_thread/thread/ba38e6474e3e9a41 - obj.parent().parent().removeClass('IEsucks'); - } - // ------- - }); - }); - } - }; -})(jQuery); \ No newline at end of file diff --git a/content_modeller/js/jquery.treeview.min.js b/content_modeller/js/jquery.treeview.min.js deleted file mode 100644 index be38dfee..00000000 --- a/content_modeller/js/jquery.treeview.min.js +++ /dev/null @@ -1,254 +0,0 @@ -/* -* Treeview 1.4 - jQuery plugin to hide and show branches of a tree -* -* http://bassistance.de/jquery-plugins/jquery-plugin-treeview/ -* http://docs.jquery.com/Plugins/Treeview -* -* Copyright (c) 2007 Jörn Zaefferer -* -* Dual licensed under the MIT and GPL licenses: -* http://www.opensource.org/licenses/mit-license.php -* http://www.gnu.org/licenses/gpl.html -* -* Revision: $Id: jquery.treeview.js 4684 2008-02-07 19:08:06Z joern.zaefferer $ -* -*/ - -;(function($) { - - $.extend($.fn, { - swapClass: function(c1, c2) { - var c1Elements = this.filter('.' + c1); - this.filter('.' + c2).removeClass(c2).addClass(c1); - c1Elements.removeClass(c1).addClass(c2); - return this; - }, - replaceClass: function(c1, c2) { - return this.filter('.' + c1).removeClass(c1).addClass(c2).end(); - }, - hoverClass: function(className) { - className = className || "hover"; - return this.hover(function() { - $(this).addClass(className); - }, function() { - $(this).removeClass(className); - }); - }, - heightToggle: function(animated, callback) { - animated ? - this.animate({ height: "toggle" }, animated, callback) : - this.each(function(){ - jQuery(this)[ jQuery(this).is(":hidden") ? "show" : "hide" ](); - if(callback) - callback.apply(this, arguments); - }); - }, - heightHide: function(animated, callback) { - if (animated) { - this.animate({ height: "hide" }, animated, callback); - } else { - this.hide(); - if (callback) - this.each(callback); - } - }, - prepareBranches: function(settings) { - if (!settings.prerendered) { - // mark last tree items - this.filter(":last-child:not(ul)").addClass(CLASSES.last); - // collapse whole tree, or only those marked as closed, anyway except those marked as open - this.filter((settings.collapsed ? "" : "." + CLASSES.closed) + ":not(." + CLASSES.open + ")").find(">ul").hide(); - } - // return all items with sublists - return this.filter(":has(>ul)"); - }, - applyClasses: function(settings, toggler) { - - this.filter(":has(>ul):not(:has(>a))").find(">span").click(function(event) { - toggler.apply($(this).next()); - }).add( $("a", this) ).hoverClass(); - - if (!settings.prerendered) { - // handle closed ones first - this.filter(":has(>ul:hidden)") - .addClass(CLASSES.expandable) - .replaceClass(CLASSES.last, CLASSES.lastExpandable); - - // handle open ones - this.not(":has(>ul:hidden)") - .addClass(CLASSES.collapsable) - .replaceClass(CLASSES.last, CLASSES.lastCollapsable); - - // create hitarea - this.prepend("
").find("div." + CLASSES.hitarea).each(function() { - var classes = ""; - $.each($(this).parent().attr("class").split(" "), function() { - classes += this + "-hitarea "; - }); - $(this).addClass( classes ); - }); - } - - // apply event to hitarea - this.find("div." + CLASSES.hitarea).click( toggler ); - }, - treeview: function(settings) { - - if (!settings.cookieId) { - settings = $.extend({ - cookieId: "treeview" - }, settings); - } - - if (settings.add) { - return this.trigger("add", [settings.add]); - } - - if ( settings.toggle ) { - var callback = settings.toggle; - settings.toggle = function() { - return callback.apply($(this).parent()[0], arguments); - }; - } - - // factory for treecontroller - function treeController(tree, control) { - // factory for click handlers - function handler(filter) { - return function() { - // reuse toggle event handler, applying the elements to toggle - // start searching for all hitareas - toggler.apply( $("div." + CLASSES.hitarea, tree).filter(function() { - // for plain toggle, no filter is provided, otherwise we need to check the parent element - return filter ? $(this).parent("." + filter).length : true; - }) ); - return false; - }; - } - // click on first element to collapse tree - $("a:eq(0)", control).click( handler(CLASSES.collapsable) ); - // click on second to expand tree - $("a:eq(1)", control).click( handler(CLASSES.expandable) ); - // click on third to toggle tree - $("a:eq(2)", control).click( handler() ); - } - - // handle toggle event - function toggler() { - $(this) - .parent() - // swap classes for hitarea - .find(">.hitarea") - .swapClass( CLASSES.collapsableHitarea, CLASSES.expandableHitarea ) - .swapClass( CLASSES.lastCollapsableHitarea, CLASSES.lastExpandableHitarea ) - .end() - // swap classes for parent li - .swapClass( CLASSES.collapsable, CLASSES.expandable ) - .swapClass( CLASSES.lastCollapsable, CLASSES.lastExpandable ) - // find child lists - .find( ">ul" ) - // toggle them - .heightToggle( settings.animated, settings.toggle ); - if ( settings.unique ) { - $(this).parent() - .siblings() - // swap classes for hitarea - .find(">.hitarea") - .replaceClass( CLASSES.collapsableHitarea, CLASSES.expandableHitarea ) - .replaceClass( CLASSES.lastCollapsableHitarea, CLASSES.lastExpandableHitarea ) - .end() - .replaceClass( CLASSES.collapsable, CLASSES.expandable ) - .replaceClass( CLASSES.lastCollapsable, CLASSES.lastExpandable ) - .find( ">ul" ) - .heightHide( settings.animated, settings.toggle ); - } - } - - function serialize() { - function binary(arg) { - return arg ? 1 : 0; - } - var data = []; - branches.each(function(i, e) { - data[i] = $(e).is(":has(>ul:visible)") ? 1 : 0; - }); - $.cookie(settings.cookieId, data.join("") ); - } - - function deserialize() { - var stored = $.cookie(settings.cookieId); - if ( stored ) { - var data = stored.split(""); - branches.each(function(i, e) { - $(e).find(">ul")[ parseInt(data[i]) ? "show" : "hide" ](); - }); - } - } - - // add treeview class to activate styles - this.addClass("treeview"); - - // prepare branches and find all tree items with child lists - var branches = this.find("li").prepareBranches(settings); - - switch(settings.persist) { - case "cookie": - var toggleCallback = settings.toggle; - settings.toggle = function() { - serialize(); - if (toggleCallback) { - toggleCallback.apply(this, arguments); - } - }; - deserialize(); - break; - case "location": - var current = this.find("a").filter(function() { return this.href.toLowerCase() == location.href.toLowerCase(); }); - if ( current.length ) { - current.addClass("selected").parents("ul, li").add( current.next() ).show(); - } - break; - } - - branches.applyClasses(settings, toggler); - - // if control option is set, create the treecontroller and show it - if ( settings.control ) { - treeController(this, settings.control); - $(settings.control).show(); - } - - return this.bind("add", function(event, branches) { - $(branches).prev() - .removeClass(CLASSES.last) - .removeClass(CLASSES.lastCollapsable) - .removeClass(CLASSES.lastExpandable) - .find(">.hitarea") - .removeClass(CLASSES.lastCollapsableHitarea) - .removeClass(CLASSES.lastExpandableHitarea); - $(branches).find("li").andSelf().prepareBranches(settings).applyClasses(settings, toggler); - }); - } - }); - - // classes used by the plugin - // need to be styled via external stylesheet, see first example - var CLASSES = $.fn.treeview.classes = { - open: "open", - closed: "closed", - expandable: "expandable", - expandableHitarea: "expandable-hitarea", - lastExpandableHitarea: "lastExpandable-hitarea", - collapsable: "collapsable", - collapsableHitarea: "collapsable-hitarea", - lastCollapsableHitarea: "lastCollapsable-hitarea", - lastCollapsable: "lastCollapsable", - lastExpandable: "lastExpandable", - last: "last", - hitarea: "hitarea" - }; - - // provide backwards compability - $.fn.Treeview = $.fn.treeview; - -})(jQuery); \ No newline at end of file diff --git a/content_modeller/treeview.inc b/content_modeller/treeview.inc deleted file mode 100644 index f5fa751b..00000000 --- a/content_modeller/treeview.inc +++ /dev/null @@ -1,56 +0,0 @@ -type = $type; - $this->content = $content; - $this->id = $id; - $this->icons = $icons; - } - - function buildTree($class = NULL, $includeul = TRUE) { - $ret = ''; - if ($includeul) - $ret .= '