Changeset 13119
- Timestamp:
- 10/26/07 21:59:27 (1 year ago)
- Files:
-
- trunk/midcom/midcom.core/midcom/application.php (modified) (44 diffs)
- trunk/midcom/midcom.helper.datamanager/datamanager.php (modified) (1 diff)
- trunk/midcom/midcom.helper.datamanager/documentation/midcom.helper.datamanger.widget_html.example (deleted)
- trunk/midcom/midcom.helper.datamanager/static/columned.css (modified) (2 diffs)
- trunk/midcom/midcom.helper.datamanager/static/datamanager.css (modified) (1 diff)
- trunk/midcom/midcom.helper.datamanager/static/htmlarea (deleted)
- trunk/midcom/midcom.helper.datamanager/widget_html.php (deleted)
- trunk/support/clean_files.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/midcom/midcom.core/midcom/application.php
r12985 r13119 105 105 * @package midcom 106 106 */ 107 class midcom_application 107 class midcom_application 108 108 { 109 109 /** … … 301 301 */ 302 302 private $_jquery_enabled = false; 303 303 304 304 private $_jquery_init_scripts = ''; 305 305 306 306 /** 307 307 * Array with all JQuery state scripts for the page's head. … … 419 419 420 420 $this->_status = MIDCOM_STATUS_PREPARE; 421 421 422 422 // Load the services that are always needed, including the serviceloader 423 423 $this->_load_core_services(); 424 424 425 425 // Start-up some of the services 426 426 $this->auth->initialize(); … … 483 483 $this->style = new midcom_helper__styleloader(); 484 484 $this->auth = new midcom_services_auth(); 485 485 486 486 // These can be refactored behind serviceloader 487 $this->permalinks = new midcom_services_permalinks(); 487 $this->permalinks = new midcom_services_permalinks(); 488 488 $this->tmp = new midcom_services_tmp(); 489 489 $this->toolbars = new midcom_services_toolbars(); … … 492 492 $this->_services['rcs'] = new midcom_services_rcs($GLOBALS['midcom_config']); 493 493 } 494 494 495 495 /** 496 496 * Load core DBA classes … … 544 544 * @see midcom_application::_process() 545 545 */ 546 public function codeinit() 546 public function codeinit() 547 547 { 548 548 if ($this->get_current_context() == 0) 549 { 549 { 550 550 // Initialize the UI message stack from session 551 551 $this->uimessages->initialize(); … … 555 555 $this->_parser = $this->serviceloader->load('midcom_core_service_urlparser'); 556 556 $this->_parser->parse($GLOBALS['midgard']->argv); 557 558 if (!$this->_parser) 557 558 if (!$this->_parser) 559 559 { 560 560 debug_push_class(__CLASS__, __FUNCTION__); … … 565 565 566 566 $this->_process(); 567 567 568 568 if ($this->get_current_context() == 0) 569 569 { … … 579 579 * Style template, usually <(content)>. 580 580 */ 581 public function content() 582 { 583 584 585 586 debug_push_class(__CLASS__, __FUNCTION__); 581 public function content() 582 { 583 584 585 586 debug_push_class(__CLASS__, __FUNCTION__); 587 587 588 588 // Enter Context … … 673 673 * @return int The ID of the newly created context. 674 674 */ 675 public function dynamic_load($url, $config = array(), $type = MIDCOM_REQUEST_CONTENT) 675 public function dynamic_load($url, $config = array(), $type = MIDCOM_REQUEST_CONTENT) 676 676 { 677 677 debug_push_class(__CLASS__, __FUNCTION__); … … 821 821 debug_add("Substyle '$substyle' selected", MIDCOM_LOG_INFO); 822 822 break; 823 823 824 824 case 'serveattachmentguid': 825 825 case 'serveattachment': … … 828 828 debug_add('Too many arguments remaining for serve_attachment.', MIDCOM_LOG_ERROR); 829 829 } 830 830 831 831 debug_add("Trying to serve Attachment with GUID {$value}", MIDCOM_LOG_INFO); 832 832 833 833 $attachment = new midcom_baseclasses_database_attachment($value); 834 834 if ( !$attachment … … 837 837 $this->generate_error(MIDCOM_ERRNOTFOUND, 'Failed to access attachment: ' . mgd_errstr()); 838 838 } 839 839 840 840 if (!$attachment->can_do('midgard:autoserve_attachment')) 841 841 { 842 842 $this->generate_error(MIDCOM_ERRNOTFOUND, 'Failed to access attachment: Autoserving denied.'); 843 843 } 844 844 845 845 $this->serve_attachment($attachment); 846 846 $this->finish(); 847 847 exit(); 848 848 849 849 case 'permalink': 850 850 $guid = $value; … … 855 855 // This will exit; 856 856 } 857 857 858 858 // We use "302 Found" here so that search engines and others will keep using the PermaLink instead of the temporary 859 859 $this->header("Location: {$destination}", 302); 860 860 $this->finish(); 861 861 exit(); 862 862 863 863 case 'cache': 864 864 if ($value == 'invalidate') … … 880 880 $this->auth->logout(); 881 881 // This will exit; 882 882 883 883 case 'login': 884 884 // Value is ignored … … 902 902 $this->_showdebuglog($value); 903 903 break; 904 904 905 905 default: 906 906 debug_add("Unknown MidCOM URL Property ignored: {$key} => {$value}", MIDCOM_LOG_WARN); … … 913 913 $this->_status = MIDCOM_STATUS_CANHANDLE; 914 914 915 do 915 do 916 916 { 917 917 $object = $this->_parser->get_current_object(); … … 921 921 $this->generate_error(MIDCOM_ERRCRIT, "Root node missing."); 922 922 } 923 923 924 924 if (is_a($object, 'midgard_attachment')) 925 925 { … … 929 929 $path = $object->component; 930 930 931 if (!$path) 931 if (!$path) 932 932 { 933 933 debug_add("No component defined for this node.", MIDCOM_LOG_ERROR); … … 941 941 // If so, execute it, if not, continue. 942 942 943 if ($this->_can_handle($object)) 943 if ($this->_can_handle($object)) 944 944 { 945 945 $this->_status = MIDCOM_STATUS_HANDLE; 946 946 947 947 $prefix = $this->_parser->get_url(); 948 948 949 949 // Initialize context 950 950 $this->_context[$this->_currentcontext][MIDCOM_CONTEXT_ANCHORPREFIX] = $prefix; … … 983 983 984 984 /** 985 * Simple: if current context is not '0' we were called from another context. 985 * Simple: if current context is not '0' we were called from another context. 986 986 * If so we should not break application now - just gracefully continue. 987 987 */ 988 989 if ($this->get_current_context() == 0) 988 989 if ($this->get_current_context() == 0) 990 990 { 991 991 $this->generate_error(MIDCOM_ERRNOTFOUND, "This page is not available on this server."); … … 1052 1052 $this->generate_error(MIDCOM_ERRCRIT, "Unkown Request Type encountered:" . $this->_context[$this->current_context][MIDCOM_CONTEXT_REQUESTTYPE]); 1053 1053 } 1054 1054 1055 1055 $handler =& $this->componentloader->get_interface_class($path); 1056 1056 … … 1064 1064 // $this->generate_error($handler->errcode($this->_currentcontext), $handler->errstr($this->_currentcontext)); 1065 1065 $this->generate_error(MIDCOM_ERRCRIT, "Component $path failed to handle the request"); 1066 1066 1067 1067 // This will exit. 1068 1068 } … … 1140 1140 $this->generate_error(MIDCOM_ERRCRIT, "Unkown Request Type encountered:" . $this->_context[$this->current_context][MIDCOM_CONTEXT_REQUESTTYPE]); 1141 1141 } 1142 1142 1143 1143 // Get component interface class 1144 1144 $component_interface =& $this->componentloader->get_interface_class($path); 1145 if ($component_interface === null) 1145 if ($component_interface === null) 1146 1146 { 1147 1147 $path = 'midcom.core.nullcomponent'; … … 1167 1167 return false; 1168 1168 } 1169 1169 1170 1170 debug_add("Component {$path} in {$object->name} will handle request.", MIDCOM_LOG_INFO); 1171 1171 debug_pop(); … … 1184 1184 * @access private 1185 1185 */ 1186 private function & _loadconfig($object) 1186 private function & _loadconfig($object) 1187 1187 { 1188 1188 $path = $this->get_context_data(MIDCOM_CONTEXT_COMPONENT); … … 1226 1226 $this->generate_error(MIDCOM_ERRCRIT, "Unkown Request Type encountered:" . $this->_context[$this->current_context][MIDCOM_CONTEXT_REQUESTTYPE]); 1227 1227 } 1228 1228 1229 1229 $component =& $this->componentloader->get_interface_class($this->get_context_data(MIDCOM_CONTEXT_COMPONENT)); 1230 1230 $component->show_content($this->_currentcontext); … … 1378 1378 * @return midcom_helper__componentloader The reference of the component loader in use. 1379 1379 */ 1380 public function & get_component_loader () 1380 public function & get_component_loader () 1381 1381 { 1382 1382 return $this->componentloader; … … 1450 1450 $key = $param2; 1451 1451 } 1452 1452 1453 1453 if (!is_array($this->_context)) 1454 1454 { … … 1492 1492 * @access private 1493 1493 */ 1494 function _set_context_data($value, $param1, $param2 = null) 1494 function _set_context_data($value, $param1, $param2 = null) 1495 1495 { 1496 1496 if (is_null($param2)) … … 1837 1837 * @param integer $response_code HTTP response code to send with the header 1838 1838 */ 1839 function header($header, $response_code = null) 1839 function header($header, $response_code = null) 1840 1840 { 1841 1841 $this->cache->content->register_sent_header($header); 1842 1842 1843 1843 if (!is_null($response_code)) 1844 1844 { … … 2033 2033 $code = 200; 2034 2034 break; 2035 2035 2036 2036 case MIDCOM_ERRNOTFOUND: 2037 2037 $header = "HTTP/1.0 404 Not Found"; … … 2302 2302 fpassthru($f); 2303 2303 $attachment->close(); 2304 2304 2305 2305 //$this->exit(); 2306 2306 exit(); … … 2417 2417 function add_jsfile($url, $prepend = false) 2418 2418 { 2419 // Adds an URL for a <script type="text/javascript" src=" htmlarea.js"></script>2419 // Adds an URL for a <script type="text/javascript" src="tinymce.js"></script> 2420 2420 // like call. $url is inserted into src. Duplicates are omitted. 2421 2421 if (! in_array($url, $this->_jsfiles)) … … 2467 2467 if ($prepend) 2468 2468 { 2469 $this->_prepend_jshead[] = $js_call; 2469 $this->_prepend_jshead[] = $js_call; 2470 2470 } 2471 2471 else … … 2579 2579 return false; 2580 2580 } 2581 2581 2582 2582 if (!array_key_exists('href', $attributes)) 2583 2583 { 2584 2584 return false; 2585 2585 } 2586 2586 2587 2587 // Register each URL only once 2588 2588 if (in_array($attributes['href'], $this->_linkhrefs)) … … 2591 2591 } 2592 2592 $this->_linkhrefs[] = $attributes['href']; 2593 2593 2594 2594 $output = ''; 2595 2595 2596 2596 if (array_key_exists('condition', $attributes)) 2597 2597 { 2598 2598 $this->_link_head .= "<!--[if {$attributes['condition']}]>\n"; 2599 2599 } 2600 2600 2601 2601 foreach ($attributes as $key => $val) 2602 2602 { 2603 2603 if ($key != 'conditions') 2604 2604 { 2605 $output .= " {$key}=\"{$val}\" "; 2605 $output .= " {$key}=\"{$val}\" "; 2606 2606 } 2607 2607 } … … 2713 2713 echo $this->_jquery_init_scripts; 2714 2714 } 2715 2715 2716 2716 if (!empty($this->_prepend_jshead)) 2717 2717 { … … 2719 2719 { 2720 2720 echo $js_call; 2721 } 2722 } 2723 2721 } 2722 } 2723 2724 2724 echo $this->_link_head; 2725 2725 echo $this->_object_head; … … 2745 2745 return; 2746 2746 } 2747 2747 2748 2748 $url = MIDCOM_STATIC_URL . "/jQuery/jquery-{$version}.js"; 2749 2749 $this->_jquery_init_scripts = '<script type="text/javascript" src="' . $url . '"></script>' . "\n"; 2750 2750 2751 2751 $script = 'var $j = jQuery.noConflict();'."\n"; 2752 2752 $script .= "var MIDCOM_STATIC_URL = '" . MIDCOM_STATIC_URL . "';\n"; … … 2756 2756 $this->_jquery_init_scripts .= trim($script) . "\n"; 2757 2757 $this->_jquery_init_scripts .= "</script>\n"; 2758 2758 2759 2759 $this->_jquery_enabled = true; 2760 2760 } … … 2776 2776 return; 2777 2777 } 2778 2778 2779 2779 echo '<script type="text/javascript">' . "\n"; 2780 2780 2781 2781 foreach ($this->_jquery_states as $status => $scripts) 2782 2782 { … … 2786 2786 echo "\n" . '$j(' . $status_target . ').' . $status_method . '(function() {'."\n"; 2787 2787 echo $scripts; 2788 echo "\n" . '});' . "\n"; 2788 echo "\n" . '});' . "\n"; 2789 2789 } 2790 2790 … … 2915 2915 $view_toolbar =& $this->toolbars->get_view_toolbar($this->_currentcontext); 2916 2916 $view_toolbar->bind_to($object); 2917 2917 2918 2918 // Bind the object to the metadata service 2919 2919 $this->metadata->bind_metadata_to_object(MIDCOM_METADATA_VIEW, $object, $this->_currentcontext); 2920 2920 $this->metadata->set_page_class($page_class, $this->_currentcontext); 2921 2921 2922 2922 $this->substyle_append($page_class); 2923 2923 } trunk/midcom/midcom.helper.datamanager/datamanager.php
r12014 r13119 257 257 * bulk uploads. 258 258 * 259 *260 * <b>Copyright references:</b>261 *262 * HTMLAREA, copyright (c) 2002-2004,263 * interactivetools.com, inc.264 * HTMLAREA is available under a BSD-derived license. More information265 * at http://www.interactivetools.com/products/htmlarea/license.html266 *267 * The DHTML Calendar, version 0.9.6 "Keep cool but don't freeze"268 * Copyright Mihai Bazon, 2002, 2003 | http://dynarch.com/mishoo/269 *270 * Details and latest version at:271 * http://dynarch.com/mishoo/calendar.epl272 *273 * This script is distributed under the GNU Lesser General Public License.274 * Read the entire license text here: http://www.gnu.org/licenses/lgpl.html275 259 * 276 260 * @package midcom.helper.datamanager trunk/midcom/midcom.helper.datamanager/static/columned.css
r4138 r13119 46 46 47 47 /* Normal content entry */ 48 div.form_viewfield, form.datamanager input.shorttext, form.datamanager textarea, form.datamanager select, form.datamanager input.fileselector, form.datamanager .htmlarea, form.datamanagerspan.mceEditorContainer48 div.form_viewfield, form.datamanager input.shorttext, form.datamanager textarea, form.datamanager select, form.datamanager input.fileselector, form.datamanager span.mceEditorContainer 49 49 { 50 50 font-size: 1.15em; … … 57 57 { 58 58 width: 20%; 59 }60 form.datamanager .htmlarea61 {62 margin-left: 10%;63 59 } 64 60 form.datamanager textarea.longtext trunk/midcom/midcom.helper.datamanager/static/datamanager.css
r3285 r13119 13 13 14 14 @import "../midcom.helper.datamanager/jscript-calendar/jscalendar.css"; 15 @import "../midcom.helper.datamanager/htmlarea/htmlarea.css";16 17 15 18 16 form.datamanager label trunk/support/clean_files.php
r4797 r13119 39 39 '/config\.inc$/', 40 40 // skip 3rd party DM1/2 plugins 41 '#/static/(tinymce|jscript-calendar|tiny_mce| htmlarea|communityhtml)/#',41 '#/static/(tinymce|jscript-calendar|tiny_mce|communityhtml)/#', 42 42 ); 43 43 … … 71 71 return preg_replace("/[ \t]+$/m", '', $data); 72 72 } 73 73 74 74 function walk_dir($dir) 75 75 { … … 97 97 } 98 98 } 99 99 100 100 echo "processing {$path}\n"; 101 101 if (!is_readable($path))
