diff --git a/install/db/dedalo4_install.psql.zip b/install/db/dedalo4_install.psql.zip deleted file mode 100644 index 76abdc673e..0000000000 Binary files a/install/db/dedalo4_install.psql.zip and /dev/null differ diff --git a/lib/dedalo/component_text_area/js/component_text_area.js b/lib/dedalo/component_text_area/js/component_text_area.js index e7d70f54ae..e568958d8f 100644 --- a/lib/dedalo/component_text_area/js/component_text_area.js +++ b/lib/dedalo/component_text_area/js/component_text_area.js @@ -2245,6 +2245,7 @@ alert("get_tag_label"); // IMG : Create and insert image in text //var img_html = component_text_area.build_note_img(label, state, data) +<<<<<<< HEAD let img = component_text_area.build_dom_element_from_data(tag_type, note_number, state, label, data) if (component_text_area.is_tiny(ed)===false) { @@ -2328,6 +2329,26 @@ alert("get_tag_label"); },150) }); } +======= + var img = component_text_area.build_dom_element_from_data(tag_type, note_number, state, label, data) + var img_html = img.outerHTML + + // Insert html on editor + ed.selection.setContent( img_html, {format:'raw'} ) + + // Set editor as modified and save + ed.setDirty(true) + component_text_area.Save( document.getElementById(ed.id), null, ed ).then(function(response){ + // On finish save, select created tag (the last) and trigger click action + var last_tag_obj = component_text_area.get_last_element(ed, 'note') + if (last_tag_obj) { + // Select image in text editor + ed.selection.select(last_tag_obj); //select the inserted element // .scrollIntoView(false) + // Trigger exec click on selected tag + last_tag_obj.click(); + } + }) +>>>>>>> origin/master } }) diff --git a/lib/dedalo/component_text_area/js/text_editor.js b/lib/dedalo/component_text_area/js/text_editor.js index 3bf72a8d1b..01ad560384 100644 --- a/lib/dedalo/component_text_area/js/text_editor.js +++ b/lib/dedalo/component_text_area/js/text_editor.js @@ -110,6 +110,7 @@ var text_editor = new function() { } },false) /* +<<<<<<< HEAD text_preview.addEventListener("keyup", function(e){ var key = 'text_preview' localStorage[key] = self.innerHTML; @@ -117,6 +118,105 @@ var text_editor = new function() { //console.log("text_editor.wrapper_id: ",text_editor.wrapper_id); +======= + external_plugins: { + + "image" : DEDALO_ROOT_WEB + "/lib/tinymce/js/tinymce/plugins/image/plugin.min.js", + "print" : DEDALO_ROOT_WEB + "/lib/tinymce/js/tinymce/plugins/print/plugin.min.js", + "searchreplace" : DEDALO_ROOT_WEB + "/lib/tinymce/js/tinymce/plugins/searchreplace/plugin.min.js", + "code" : DEDALO_ROOT_WEB + "/lib/tinymce/js/tinymce/plugins/code/plugin.min.js", + "fullscreen" : DEDALO_ROOT_WEB + "/lib/tinymce/js/tinymce/plugins/fullscreen/plugin.min.js", + "paste" : DEDALO_ROOT_WEB + "/lib/tinymce/js/tinymce/plugins/paste/plugin.min.js", + //"wordcount" : DEDALO_ROOT_WEB + "/lib/tinymce/js/tinymce/plugins/wordcount/plugin.min.js", + "nanospell": DEDALO_ROOT_WEB + "/lib/tinymce/nanospell/plugin.js" + }, + */ + skin_url : DEDALO_ROOT_WEB + "/lib/tinymce/js/tinymce/skins/lightgray", + theme_url : DEDALO_ROOT_WEB + "/lib/tinymce/js/tinymce/themes/modern/theme.min.js?" +page_globals.dedalo_version, + + + // ENCODING + entity_encoding : "raw", + + // P : FORCE NO INSERT TINYMCE PARAGRAPS "

" + //v3 force_br_newlines : true, // need true for webkit + force_p_newlines : false, + forced_root_block : false, // Needed for 3.x + + // SIZE : + width : '100%', + height : editor_height, + + autoresize_min_height : 88, + autoresize_max_height : 276, + autoresize_bottom_margin: 10, + + // CSS + content_css : cssFile, + //skin : 'lightgray', + + // IMAGES : Avoid user resize images + object_resizing : false, + paste_block_drop : false, // block drag images on true + + // HTML ELEMENTS ALLOWED + valid_elements : html_tags_allowed, //"strong/b,em/i,div[class],span[class],img[id|src|class],br,p", + + // This option enables or disables the element cleanup functionality. If you set this option to false, + // all element cleanup will be skipped but other cleanup functionality such as URL conversion will still be executed. + //v3 verify_html : false, // default false (IMPORTANT FOR IMAGE TAGS ALWAYS SET FALSE) + //v3 apply_source_formatting : false, + + // Gestion de URL's por tiny. Default is both true + relative_urls : false, + convert_urls : false, + + // TESTING + //v3 remove_linebreaks : false, // remove line break stripping by tinyMCE so that we can read the HTML + //v3 verify_css_classes : false, + paste_create_linebreaks : true, // for paste plugin - single linefeeds are converted to hard line break elements + paste_auto_cleanup_on_paste : true, // for paste plugin - word paste will be executed when the user copy/paste content + + // SPELLCHECKER + browser_spellcheck : true, // Browser (Chrome) spellchecker bool + //spellchecker_rpc_url: DEDALO_ROOT_WEB + '/lib/tinymce/spellchecker/' + 'spellchecker.php', + + schema: 'html5-strict', + + // SETUP EDITOR + setup : function(ed) { + + // BUTTON PERSON + ed.addButton('button_person', { + tooltip: 'Add person', + image: '../themes/default/buttons/person.svg', + onclick: function(evt) { + component_text_area.load_tags_person() + } + }); + + // BUTTON NOTE + ed.addButton('button_note', { + tooltip: 'Add note', + image: '../themes/default/buttons/note.svg', + onclick: function(evt) { + component_text_area.create_new_note() + } + }); + + // BUTTON SAVE ADD + ed.addButton('button_save', { + text: get_label.salvar, + tooltip: get_label.salvar, + icon: false, + onclick: function(evt) { + // SAVE COMMAND + // It will get dirty if the user has made modifications to the contents + //ed.setDirty(true); // Force dirty state + text_editor.save_command(ed,evt,text_area_component); + } + }); +>>>>>>> origin/master // console.log("text_preview.style.opacity:",text_preview.style.opacity, typeof text_preview.style.opacity); if (text_preview.style.opacity=="0") { @@ -754,4 +854,4 @@ var text_editor = new function() { -};//end text_editor class \ No newline at end of file +};//end text_editor class diff --git a/lib/dedalo/extras/oh/widgets/av_duration/av_duration.php b/lib/dedalo/extras/oh/widgets/av_duration/av_duration.php new file mode 100644 index 0000000000..d3eac581ef --- /dev/null +++ b/lib/dedalo/extras/oh/widgets/av_duration/av_duration.php @@ -0,0 +1,194 @@ +widget_name; + $modo = $this->component_info->get_modo(); + $parent = $this->component_info->get_parent(); + $section_tipo = $this->component_info->get_section_tipo(); + $data_source = $this->data_source; + $component_portal_tipo = key($data_source); + $component_av_tipo = reset($data_source); + $filename = $modo; + + + switch ($modo) { + + case 'list': + $filename = 'edit'; + case 'edit': + + # + # DATA_SOURCE + # Format : + # stdClass Object + # ( + # [oh25] => rsc35 + # ) + #dump($data_source, ' data_source ++ '.to_string()); + + if (isset($this->ar_locators)) { + + $ar_locators = $this->ar_locators; // When we are in list, injected from portal data + + }else{ + + # + # COMPONENT PORTAL (calculate when in edit normally) + $component = component_common::get_instance('component_portal', + $component_portal_tipo, + $parent, + 'list', + DEDALO_DATA_NOLAN, + $section_tipo); + $ar_locators = $component->get_dato(); + } + #dump($ar_locators, ' ar_locators ++ '.to_string()); + + if (empty($ar_locators)) { + return null; + } + + require_once( DEDALO_LIB_BASE_PATH . '/media_engine/class.Ffmpeg.php'); + require_once( DEDALO_LIB_BASE_PATH . '/media_engine/class.OptimizeTC.php'); + + $total_duration = 0; + $ar_duration = array(); + $ar_resolved = array(); + $use_cache = true; + + foreach ($ar_locators as $current_locator) { + + + $duration_secs = 0; + + + $cache_key = $current_locator->section_tipo.'_'.$current_locator->section_id; + if (in_array($cache_key, $ar_resolved)) { + continue; + } + if ($use_cache && isset($_SESSION['dedalo4']['config']['av_duration'][$cache_key])) { + + $duration_secs = $_SESSION['dedalo4']['config']['av_duration'][$cache_key]; + #debug_log(__METHOD__." GET DUTARION FROM SESSION $current_locator->section_id ".to_string($duration_secs), logger::DEBUG); + + }else{ + /* DEACTIVATED + $modelo_name = RecordObj_dd::get_modelo_name_by_tipo(DEDALO_COMPONENT_RESOURCES_AV_DURATION_TIPO,true); + $component = component_common::get_instance($modelo_name, + DEDALO_COMPONENT_RESOURCES_AV_DURATION_TIPO, + $current_locator->section_id, + 'edit', + DEDALO_DATA_NOLAN, + $current_locator->section_tipo); + + $dato = $component->get_dato(); + */ + if (!empty($dato)) { + + $duration_secs = $dato; + if($use_cache) $_SESSION['dedalo4']['config']['av_duration'][$cache_key] = $duration_secs; + #debug_log(__METHOD__." GET DUTARION FROM DEDALO_COMPONENT_RESOURCES_AV_DURATION_TIPO $current_locator->section_id ".to_string($duration_secs), logger::DEBUG); + + }else{ + + $component_av = component_common::get_instance('component_av', + $component_av_tipo, + $current_locator->section_id, + 'list', + DEDALO_DATA_NOLAN, + $current_locator->section_tipo); + $video_path = $component_av->get_video_path(DEDALO_AV_QUALITY_DEFAULT); + if ( file_exists( $video_path) ) { + + $media_attributes = ffmpeg::get_media_attributes($video_path); + #dump($media_attributes, ' media_attributes ++ '.to_string()); + if (isset($media_attributes->format->duration)) { + $duration_secs = $media_attributes->format->duration; + + if($use_cache) $_SESSION['dedalo4']['config']['av_duration'][$cache_key] = $duration_secs; + } + }//end if (file_exists + #debug_log(__METHOD__." GET DUTARION FROM FILE MEDIA_ATTRIBUTES $current_locator->section_id ".to_string($duration_secs), logger::DEBUG); + }//end if (empty($dato)) { + } + + $ar_duration[$current_locator->section_id] = $duration_secs; + + $total_duration += (int)$duration_secs; + + $ar_resolved[] = $cache_key; + } + $total_duration_tc = OptimizeTC::seg2tc($total_duration); + #dump($ar_duration, ' ar_duration ++ '.to_string($total_duration_tc)); + + $widget_base_url = $this->get_widget_base_url(); + css::$ar_url[] = $widget_base_url ."/css/".$widget_name.".css"; + #js::$ar_url[] = $widget_base_url ."/js/".$widget_name.".js"; + + break; + + default: + return "Sorry. Mode: $modo is not supported"; + } + + + + + $page_html = dirname(__FILE__) . '/html/' . $widget_name . '_' . $filename . '.phtml'; + if( !include($page_html) ) { + echo "

Invalid widget mode $modo
"; + } + +?> \ No newline at end of file diff --git a/lib/dedalo/extras/oh/widgets/av_duration/css/av_duration.css b/lib/dedalo/extras/oh/widgets/av_duration/css/av_duration.css new file mode 100644 index 0000000000..5bd5aac45c --- /dev/null +++ b/lib/dedalo/extras/oh/widgets/av_duration/css/av_duration.css @@ -0,0 +1 @@ +ul.widget_av_duration{margin-top:4px;-webkit-user-select:none;user-select:none;width:58px;float:left}.widget_av_duration li{display:table;font-size:92%}.widget_av_duration li .label_first,.widget_av_duration li .label_second{display:table-cell;background-color:#f8f8f8;border-top:1px solid #e4e4e4;padding-top:2px;padding-bottom:2px}.widget_av_duration li .label_first{margin-right:5px;white-space:nowrap;text-align:right;padding-right:10px;min-width:40px;width:10%}.widget_av_duration li .label_second{width:90%}.widget_av_duration li .header{border-top:1px solid #ececec;font-weight:normal;text-transform:capitalize}.widget_av_duration li .label_second.header{cursor:pointer}ul.widget_av_duration .tab_content{display:none}/*# sourceMappingURL=av_duration.css.map */ \ No newline at end of file diff --git a/lib/dedalo/extras/oh/widgets/av_duration/css/av_duration.css.map b/lib/dedalo/extras/oh/widgets/av_duration/css/av_duration.css.map new file mode 100644 index 0000000000..b688658d86 --- /dev/null +++ b/lib/dedalo/extras/oh/widgets/av_duration/css/av_duration.css.map @@ -0,0 +1 @@ +{"version":3,"file":"av_duration.css","sources":["av_duration.less"],"names":[],"mappings":"AACA,EAAE,oBACD,cAAA,CACA,wBAAA,CACE,gBAAA,CACF,UAAA,CACA,WAEA,mBAAoB,IACnB,aAAA,CACA,cAEA,mBAAoB,GAAG,cACvB,mBAAoB,GAAG,eACtB,kBAAA,CACA,wBAAA,CACA,4BAAA,CACA,eAAA,CACA,mBAGD,mBAAoB,GAAG,cACtB,gBAAA,CACA,kBAAA,CACA,gBAAA,CACA,kBAAA,CACA,cAAA,CACA,UAED,mBAAoB,GAAG,eACtB,UAED,mBAAoB,GAAG,SACtB,4BAAA,CACA,kBAAA,CACA,0BAED,mBAAoB,GAAG,cAAa,QACnC,eAMD,EAAE,mBAAoB,cACrB","sourceRoot":""} \ No newline at end of file diff --git a/lib/dedalo/extras/oh/widgets/av_duration/css/av_duration.less b/lib/dedalo/extras/oh/widgets/av_duration/css/av_duration.less new file mode 100644 index 0000000000..f8a34e14a4 --- /dev/null +++ b/lib/dedalo/extras/oh/widgets/av_duration/css/av_duration.less @@ -0,0 +1,49 @@ + +ul.widget_av_duration { + margin-top: 4px; + -webkit-user-select: none; + user-select: none; + width: 58px; + float: left; + } + .widget_av_duration li { + display: table; + font-size: 92%; + } + .widget_av_duration li .label_first, + .widget_av_duration li .label_second { + display: table-cell; + background-color: #F8F8F8; + border-top: 1px solid #E4E4E4; + padding-top: 2px; + padding-bottom: 2px; + + } + .widget_av_duration li .label_first { + margin-right: 5px; + white-space: nowrap; + text-align: right; + padding-right: 10px; + min-width: 40px; + width: 10%; + } + .widget_av_duration li .label_second { + width: 90%; + } + .widget_av_duration li .header { + border-top: 1px solid #ECECEC; + font-weight: normal; + text-transform: capitalize; + } + .widget_av_duration li .label_second.header { + cursor: pointer; + /*background-image: url('../../../../themes/default/select_2x.png'); + background-repeat: no-repeat; + background-position: right 6px top 7px; + background-size: 14px;*/ + } + ul.widget_av_duration .tab_content { + display: none; + } + + \ No newline at end of file diff --git a/lib/dedalo/extras/oh/widgets/av_duration/html/av_duration_edit.phtml b/lib/dedalo/extras/oh/widgets/av_duration/html/av_duration_edit.phtml new file mode 100644 index 0000000000..fa77fe1ab8 --- /dev/null +++ b/lib/dedalo/extras/oh/widgets/av_duration/html/av_duration_edit.phtml @@ -0,0 +1,36 @@ +"; + + # + # HEADER + $html .= "
  • "; + #$html .= "
    ".label::get_label('total')."
    "; + $html .= "
    ".$total_duration_tc."
    "; + $html .= "
  • "; +/* + $html .= ""; //tab_content + foreach ($ar_duration as $section_id => $secs) { + + $html .= "
  • "; + + $html .= "
    ".$section_id."
    "; + + $tc = OptimizeTC::seg2tc($secs); + $html .= "
    ".$tc."
    "; + + $html .= "
  • "; + + }//end foreach ($ar_duration as $terminoID => $total) { + $html .= "
    "; +*/ + $html .= ""; + + print $html; + + +?> \ No newline at end of file diff --git a/lib/dedalo/extras/oh/widgets/descriptors/css/descriptors.css b/lib/dedalo/extras/oh/widgets/descriptors/css/descriptors.css new file mode 100644 index 0000000000..5dda3df1f8 --- /dev/null +++ b/lib/dedalo/extras/oh/widgets/descriptors/css/descriptors.css @@ -0,0 +1 @@ +.descriptors_button{padding:3px;padding-top:5px;cursor:pointer;font-weight:normal;text-transform:capitalize;padding-left:3px}.widget_descriptors{margin-top:2px;-webkit-user-select:none;user-select:none;width:100%;float:left}.widget_descriptors li{display:table;font-size:92%;width:100%}.widget_descriptors li .label_first,.widget_descriptors li .label_second{display:table-cell;background-color:#f8f8f8;border-top:1px solid #e4e4e4;padding-top:2px;padding-bottom:2px}.widget_descriptors li .label_first{margin-right:5px;white-space:nowrap;text-align:right;padding-right:10px;min-width:28px;width:10%}.widget_descriptors li .label_second{white-space:initial;width:164%;display:list-item}.widget_descriptors li .header{border-top:1px solid #ececec;font-weight:normal;text-transform:capitalize}.widget_descriptors li .label_second.header{cursor:pointer;background-image:url('../../../../../themes/default/select_2x.png');background-repeat:no-repeat;background-position:right 4px top 7px;background-size:14px;width:100%;padding-left:3px}ul.widget_descriptors .tab_content{display:none}/*# sourceMappingURL=descriptors.css.map */ \ No newline at end of file diff --git a/lib/dedalo/extras/oh/widgets/descriptors/css/descriptors.css.map b/lib/dedalo/extras/oh/widgets/descriptors/css/descriptors.css.map new file mode 100644 index 0000000000..002a71e774 --- /dev/null +++ b/lib/dedalo/extras/oh/widgets/descriptors/css/descriptors.css.map @@ -0,0 +1 @@ +{"version":3,"file":"descriptors.css","sources":["descriptors.less"],"names":[],"mappings":"AAQC,oBACI,WAAA,CACA,eAAA,CACA,cAAA,CACA,kBAAA,CACH,yBAAA,CACA,iBASF,oBACC,cAAA,CACA,wBAAA,CACE,gBAAA,CAEF,UAAA,CACA,WAEA,mBAAoB,IACnB,aAAA,CACA,aAAA,CACA,WAEA,mBAAoB,GAAG,cAAc,mBAAoB,GAAG,eAC3D,kBAAA,CACA,wBAAA,CACA,4BAAA,CACA,eAAA,CACA,mBAED,mBAAoB,GAAG,cACtB,gBAAA,CACA,kBAAA,CACA,gBAAA,CACA,kBAAA,CACA,cAAA,CACA,UAED,mBAAoB,GAAG,eACtB,mBAAA,CACA,UAAA,CACA,kBAED,mBAAoB,GAAG,SACtB,4BAAA,CACA,kBAAA,CACA,0BAED,mBAAoB,GAAG,cAAa,QACnC,cAAA,CACA,qBAAsB,8CAAtB,CACA,2BAAA,CACA,qCAAA,CACA,oBAAA,CACA,UAAA,CACA,iBAED,EAAE,mBAAoB,cACrB","sourceRoot":""} \ No newline at end of file diff --git a/lib/dedalo/extras/oh/widgets/descriptors/css/descriptors.less b/lib/dedalo/extras/oh/widgets/descriptors/css/descriptors.less new file mode 100644 index 0000000000..1ee379ae4a --- /dev/null +++ b/lib/dedalo/extras/oh/widgets/descriptors/css/descriptors.less @@ -0,0 +1,75 @@ + + +/* WIDGET_DESCRIPTORS LIST +------------------------------------------------ */ +.descriptors_list { + //background-color: #B0FE93; + + } + .descriptors_button { + padding: 3px; + padding-top: 5px; + cursor: pointer; + font-weight: normal; + text-transform: capitalize; + padding-left: 3px; + } + + + + + +/* WIDGET_DESCRIPTORS EDIT +------------------------------------------------ */ +.widget_descriptors { + margin-top: 2px; + -webkit-user-select: none; + user-select: none; + //width: 110px; + width: 100%; + float: left; + } + .widget_descriptors li { + display: table; + font-size: 92%; + width: 100%; + } + .widget_descriptors li .label_first, .widget_descriptors li .label_second { + display: table-cell; + background-color: #F8F8F8; + border-top: 1px solid #E4E4E4; + padding-top: 2px; + padding-bottom: 2px; + } + .widget_descriptors li .label_first { + margin-right: 5px; + white-space: nowrap; + text-align: right; + padding-right: 10px; + min-width: 28px; + width: 10%; + } + .widget_descriptors li .label_second { + white-space: initial; + width: 164%; + display: list-item; + } + .widget_descriptors li .header { + border-top: 1px solid #ECECEC; + font-weight: normal; + text-transform: capitalize; + } + .widget_descriptors li .label_second.header { + cursor: pointer; + background-image: url('../../../../../themes/default/select_2x.png'); + background-repeat: no-repeat; + background-position: right 4px top 7px; + background-size: 14px; + width: 100%; + padding-left: 3px; + } + ul.widget_descriptors .tab_content { + display: none; + } + + \ No newline at end of file diff --git a/lib/dedalo/extras/oh/widgets/descriptors/descriptors.php b/lib/dedalo/extras/oh/widgets/descriptors/descriptors.php new file mode 100644 index 0000000000..dc29562b39 --- /dev/null +++ b/lib/dedalo/extras/oh/widgets/descriptors/descriptors.php @@ -0,0 +1,135 @@ +widget_name; + $component_tipo = $this->component_info->get_tipo(); + $modo = $this->component_info->get_modo(); + $parent = $this->component_info->get_parent(); + $section_tipo = $this->component_info->get_section_tipo(); + $data_source = $this->data_source; + $component_portal_tipo = key($data_source); + $component_text_area_tipo = reset($data_source); + $filename = $modo; + + + switch ($modo) { + + case 'list': + $filename = 'list'; + + $widget_base_url = $this->get_widget_base_url(); + + $css_url = $widget_base_url ."/css/".$widget_name.".css"; + if ( !in_array($css_url, css::$ar_url) ) { + css::$ar_url[] = $css_url; + } + + $js_url = $widget_base_url ."/js/".$widget_name.".js"; + if ( !in_array($js_url, js::$ar_url) ) { + js::$ar_url[] = $js_url; + } + #dump(js::$ar_url, ' var ++ '.to_string()); + break; + + case 'edit': + # + # DATA_SOURCE + # Format : + # stdClass Object + # ( + # [oh25] => rsc35 + # ) + #dump($data_source, ' data_source ++ '.to_string()); + if (isset($this->ar_locators)) { + + $ar_locators = $this->ar_locators; // When we are in list, injected from portal data + + }else{ + + # + # COMPONENT PORTAL (calculate when in edit normally) + $component = component_common::get_instance('component_portal', + $component_portal_tipo, + $parent, + 'list', + DEDALO_DATA_NOLAN, + $section_tipo); + $ar_locators = $component->get_dato(); + } + # dump($ar_locators, ' ar_locators ++ '.to_string()); + + if (empty($ar_locators)) { + return null; + } + + # + # INDEXATIONS BY SECTION_ID (cinta) + $ar_indexations = array(); + foreach ($ar_locators as $key => $locator) { + #dump(RecordObj_descriptors::get_indexations_for_locator( $locator ), 'RecordObj_descriptors::get_indexations_for_locator( $locator ) ++ '.to_string()); + #$indexations = RecordObj_descriptors::get_indexations_for_locator( $locator ); + $indexations = component_relation_index::get_indexations_for_locator( $locator ); + #dump($indexations, ' indexations ++ '.to_string()); + + $ar_indexations[$locator->section_id] = $indexations; + } + #dump($ar_indexations, ' ar_indexations ++ '.to_string()); + if (empty($ar_indexations)) { + return null; + } + + # + # TERMS STATS (number of every term uses) + $ar_terms = array(); + $total_index= 0; + foreach ($ar_indexations as $section_id => $ar_value) foreach ($ar_value as $pseudo_locator => $count) { + #dump($pseudo_locator, ' pseudo_locator ++ '.to_string($count)); + if (isset($ar_terms[$pseudo_locator])) { + $ar_terms[$pseudo_locator] += $count; + #dump($pseudo_locator, ' pseudo_locator ++ '.to_string()); + }else{ + $ar_terms[$pseudo_locator]=$count; + } + $total_index += $count; + } + #dump($ar_terms, '$ar_terms ++ '.to_string()); + + + $ar_terms_resolved = array(); + foreach ($ar_terms as $pseudo_locator => $total) { + #$termino = RecordObj_ts::get_termino_by_tipo($pseudo_locator, DEDALO_DATA_LANG, true, true); + $locator = json_decode($pseudo_locator); + $termino = ts_object::get_term_by_locator( $locator, $lang=DEDALO_DATA_LANG, $from_cache=false ); + $ar_terms_resolved[$termino] = $total; + } + ksort($ar_terms_resolved, SORT_NATURAL); + + + $widget_base_url = $this->get_widget_base_url(); + + $css_url = $widget_base_url ."/css/".$widget_name.".css"; + if ( !in_array($css_url, css::$ar_url) ) { + css::$ar_url[] = $css_url; + } + + $js_url = $widget_base_url ."/js/".$widget_name.".js"; + if ( !in_array($js_url, js::$ar_url) ) { + js::$ar_url[] = $js_url; + } + break; + + default: + return "Sorry. Mode: $modo is not supported"; + } + + + + + $page_html = dirname(__FILE__) . '/html/' . $widget_name . '_' . $filename . '.phtml'; + if( !include($page_html) ) { + echo "
    Invalid widget mode $modo
    "; + } + +?> \ No newline at end of file diff --git a/lib/dedalo/extras/oh/widgets/descriptors/html/descriptors_edit.phtml b/lib/dedalo/extras/oh/widgets/descriptors/html/descriptors_edit.phtml new file mode 100644 index 0000000000..a8d4b386c9 --- /dev/null +++ b/lib/dedalo/extras/oh/widgets/descriptors/html/descriptors_edit.phtml @@ -0,0 +1,42 @@ +"; + + # + # HEADER + $html .= "
  • "; + #$html .= "
    ".label::get_label('total')."
    "; + $total_terms = count($ar_terms); + $additional_style = $total_terms<1 ? 'style="background:none"' : ''; + $html .= "
    ".label::get_label('terminos')." : $total_terms / $total_index
    "; + $html .= "
  • "; + + # + # ROWS + if ($total_terms>0) { + $html .= ""; + foreach ($ar_terms_resolved as $term => $total) { + + $html .= "
  • "; + + #$termino = RecordObj_ts::get_termino_by_tipo($terminoID, DEDALO_DATA_LANG, true, true); + + $html .= "
    ".$total."
    "; + $html .= "
    ".$term."
    "; + + $html .= "
  • "; + + }//end foreach ($ar_terms as $terminoID => $total) { + $html .= "
    "; + }//end if ($total_terms>0) { + + $html .= ""; + + + print $html; + +?> \ No newline at end of file diff --git a/lib/dedalo/extras/oh/widgets/descriptors/html/descriptors_list.phtml b/lib/dedalo/extras/oh/widgets/descriptors/html/descriptors_list.phtml new file mode 100644 index 0000000000..d804acc5d5 --- /dev/null +++ b/lib/dedalo/extras/oh/widgets/descriptors/html/descriptors_list.phtml @@ -0,0 +1,23 @@ +"; + + # Button + $html .= "
    ".label::get_label('terminos')."
    "; + + # Ajax container + $html .= "
    "; + + $html .= ""; + + print $html; +?> \ No newline at end of file diff --git a/lib/dedalo/extras/oh/widgets/descriptors/js/descriptors.js b/lib/dedalo/extras/oh/widgets/descriptors/js/descriptors.js new file mode 100644 index 0000000000..afe0641388 --- /dev/null +++ b/lib/dedalo/extras/oh/widgets/descriptors/js/descriptors.js @@ -0,0 +1,57 @@ +/** +* DESCRIPTORS +* +* +* +*/ +var descriptors = new function() { + + + + this.trigger_url = DEDALO_LIB_BASE_URL + '/extras/oh/widgets/descriptors/trigger.descriptors.php'; + + + + /** + * LOAD_TERMS + * @return promise + */ + this.load_terms = function(button_obj) { + + var response_div = button_obj.parentNode //.querySelector('.descriptors_container') + response_div.innerHTML = '
    Loading..
    ' + + + var trigger_vars = { + mode : 'load_terms', + component_tipo : button_obj.dataset.component_tipo, + section_tipo : button_obj.dataset.section_tipo, + section_id : button_obj.dataset.section_id, + component_portal_tipo : button_obj.dataset.component_portal_tipo, + component_text_area_tipo : button_obj.dataset.component_text_area_tipo, + } + //return console.log(trigger_vars); + + var jsPromise = common.get_json_data(descriptors.trigger_url, trigger_vars).then(function(response){ + if(SHOW_DEBUG===true) { + console.log(response.result); + } + + response_div.innerHTML = response.result + + // Hide button + button_obj.remove() + + // Open list action exec + var tab_title = response_div.querySelector('.tab_title') + if (tab_title) { + tab_title.click() + } + }) + + return jsPromise + };//end load_terms + + + +}//end descriptors \ No newline at end of file diff --git a/lib/dedalo/extras/oh/widgets/descriptors/trigger.descriptors.php b/lib/dedalo/extras/oh/widgets/descriptors/trigger.descriptors.php new file mode 100644 index 0000000000..f9d5397115 --- /dev/null +++ b/lib/dedalo/extras/oh/widgets/descriptors/trigger.descriptors.php @@ -0,0 +1,76 @@ + Auth error: please login "); + + +# set vars + $vars = array('mode'); + foreach($vars as $name) $$name = common::setVar($name); + +# mode + if(empty($mode)) exit(" Trigger: Error Need mode.."); + + +# CALL FUNCTION +if ( function_exists($mode) ) { + $result = call_user_func($mode); + echo json_encode($result); +} + + +/** +* LOAD_TERMS +* +*/ +function load_terms() { + + $vars = array('component_tipo','section_tipo','section_id','component_portal_tipo','component_text_area_tipo'); + foreach($vars as $name) $$name = common::setVar($name); + + # Structure widget config + $widget_str_object = widget::get_widget_str_object($component_tipo, 'descriptors'); + debug_log(__METHOD__." widget_str_object ".to_string(), logger::DEBUG); + + $component_info = component_common::get_instance($modelo_name='component_info', + $component_tipo, + $section_id, + $modo='edit', + $lang=DEDALO_DATA_NOLAN, + $section_tipo); + + $widget_str_object->component_info = $component_info; + + $widget = widget::getInstance(); + $widget->configure($widget_str_object); + $widget->modo = 'edit99'; + + $html = $widget->get_html(); + + $response = new stdClass(); + $response->result = $html; + $response->msg = 'Done'; + + return (object)$response; +}//end load_terms + + + + +?> \ No newline at end of file diff --git a/lib/dedalo/extras/oh/widgets/media_icons/css/media_icons.css b/lib/dedalo/extras/oh/widgets/media_icons/css/media_icons.css new file mode 100644 index 0000000000..889c22a3e3 --- /dev/null +++ b/lib/dedalo/extras/oh/widgets/media_icons/css/media_icons.css @@ -0,0 +1 @@ +ul.widget_media_icons{font-size:11px;font-family:"Menlo",monospace}.widget_media_icons li{white-space:nowrap}.widget_media_icons li a{vertical-align:middle;line-height:13px;height:15px}.widget_media_icons li a.label_section_id{width:auto;min-width:21px;text-align:right;padding-left:2px;padding-right:0;margin:0;display:inline-block}.widget_media_icons li a.label_section_id:hover{color:#000}.widget_media_icons li .link{margin:0}.widget_media_icons li .icon_border{margin:0;margin-left:2px;border-right:1px solid #dadada;width:18px;text-align:center;padding-right:4px;padding-left:1px}.widget_media_icons li .icon_border:last-of-type{border:none;padding-right:0}.widget_media_icons li .duration_tc{vertical-align:middle;display:inline-block;color:#898989}/*# sourceMappingURL=media_icons.css.map */ \ No newline at end of file diff --git a/lib/dedalo/extras/oh/widgets/media_icons/css/media_icons.css.map b/lib/dedalo/extras/oh/widgets/media_icons/css/media_icons.css.map new file mode 100644 index 0000000000..2086af913c --- /dev/null +++ b/lib/dedalo/extras/oh/widgets/media_icons/css/media_icons.css.map @@ -0,0 +1 @@ +{"version":3,"file":"media_icons.css","sources":["media_icons.less"],"names":[],"mappings":"AACA,EAAE,oBACD,cAAA,CACA,YAAa,kBAEb,mBAAoB,IAInB,mBAEA,mBAAoB,GAAG,GACtB,qBAAA,CACA,gBAAA,CACA,YAED,mBAAoB,GAAG,EAAC,kBACvB,UAAA,CACA,cAAA,CACA,gBAAA,CACA,gBAAA,CACA,eAAA,CACA,QAAA,CACA,qBAGA,mBAAoB,GAAG,EAAC,iBAAiB,OACxC,WAIF,mBAAoB,GAAG,OAGtB,SAED,mBAAoB,GAAG,cACtB,QAAA,CACA,eAAA,CACA,8BAAA,CACA,UAAA,CAEA,iBAAA,CACA,iBAAA,CACA,iBAKD,mBAAoB,GAAG,aAAY,cAClC,WAAA,CACA,gBAKD,mBAAoB,GAAG,cACtB,qBAAA,CACA,oBAAA,CACA","sourceRoot":""} \ No newline at end of file diff --git a/lib/dedalo/extras/oh/widgets/media_icons/css/media_icons.less b/lib/dedalo/extras/oh/widgets/media_icons/css/media_icons.less new file mode 100644 index 0000000000..ec1e3491a5 --- /dev/null +++ b/lib/dedalo/extras/oh/widgets/media_icons/css/media_icons.less @@ -0,0 +1,62 @@ + +ul.widget_media_icons { + font-size: 11px; + font-family: "Menlo",monospace; + } + .widget_media_icons li { + /*text-align: right; + max-width: 100px;*/ + //background-color: #FEDC4B + white-space: nowrap; + } + .widget_media_icons li a { + vertical-align: middle; + line-height: 13px; + height: 15px; + } + .widget_media_icons li a.label_section_id { + width: auto; + min-width:21px; + text-align: right; + padding-left: 2px; + padding-right: 0px; + margin: 0; + display: inline-block; + //background-color: #62FD9C + } + .widget_media_icons li a.label_section_id:hover { + color: #000000; + } + /* video icon + -------------------------------------- */ + .widget_media_icons li .link { + //margin-right: 2px; + //padding-top: 1px; + margin: 0; + } + .widget_media_icons li .icon_border { + margin: 0; + margin-left: 2px; + border-right: 1px solid #DADADA; + width: 18px; + //display: inline-block; + text-align: center; + padding-right: 4px; + padding-left: 1px; + } + .widget_media_icons li .icon_border:hover { + /*background-color: #D1D1D1;*/ + } + .widget_media_icons li .icon_border:last-of-type { + border: none; + padding-right: 0; + } + + /* duration + -------------------------------------- */ + .widget_media_icons li .duration_tc { + vertical-align: middle; + display: inline-block; + color: #898989; + } + \ No newline at end of file diff --git a/lib/dedalo/extras/oh/widgets/media_icons/html/media_icons_edit.phtml b/lib/dedalo/extras/oh/widgets/media_icons/html/media_icons_edit.phtml new file mode 100644 index 0000000000..a2e531ea4c --- /dev/null +++ b/lib/dedalo/extras/oh/widgets/media_icons/html/media_icons_edit.phtml @@ -0,0 +1,141 @@ +"; + foreach ($ar_locators as $current_locator) { + + $key_resolved = $current_locator->section_tipo.'_'.$current_locator->section_id; + if (in_array($key_resolved, $ar_locators_resolved)) { + continue; + } + + # + # MEDIA COMPONENT + $media_component = component_common::get_instance( $media_component_modelo_name, + $media_component_tipo, + $current_locator->section_id, + 'list', + DEDALO_DATA_NOLAN, + $current_locator->section_tipo); + #$ar_locators = $component->get_dato(); + #dump($media_component, ' media_component ++ '.to_string()); + #dump($this, ' this ++ '.to_string()); + + $html .= "
  • "; + + # + # SECTION_ID link + $url = "?t=$current_locator->section_tipo&id=$current_locator->section_id"; + $title = label::get_label('edicion'); + $html .= ""; + $html .= $current_locator->section_id; + $html .= ""; + + # + # MEDIA ICON + switch ($media_component_modelo_name) { + case 'component_av': + $video_path = $media_component->get_video_path(DEDALO_AV_QUALITY_DEFAULT); + + #$cache_key = $current_locator->section_tipo.'_'.$current_locator->section_id; + + if (file_exists( $video_path = $media_component->get_video_path(DEDALO_AV_QUALITY_DEFAULT) )) { + # av duration + $tc = $media_component->get_duration_seconds('timecode'); + $video_id = $media_component->get_video_id(); + $title = label::get_label('abrir'); + $html .= " "; + }else{ + $tc = null; + $html .= " "; + } + break; + + default: + $icon_name = 'file_icon'; + break; + } + + # + # TRANSCRIPTION LINK + if (isset($this->transcription)) { + $title = label::get_label('tool_transcription'); + switch ($link_target) { + case 'process': + $url = "?t={$this->transcription->process_section_tipo}&top_tipo=".TOP_TIPO."&auto_search=1&{$this->transcription->search_section_id}={$current_locator->section_id}"; + $html .= ""; + break; + default: + // icon_bs icon_transcription + $html .= "transcription->component_tipo}\" + data-section_tipo=\"$current_locator->section_tipo\" + data-parent=\"$current_locator->section_id\" + data-context_name=\"component_av\" + onclick=\"tool_common.open_tool_transcription(this)\">TR"; + }} + + # + # INDEXATION LINK + if (isset($this->indexation)) { + $title = label::get_label('tool_indexation'); + switch ($link_target) { + case 'process': + $url = "?t={$this->indexation->process_section_tipo}&top_tipo=".TOP_TIPO."&auto_search=1&{$this->indexation->search_section_id}={$current_locator->section_id}"; + $html .= ""; + break; + default: + // icon_bs icon_indexation + $html .= "indexation->component_tipo}\" + data-section_tipo=\"$current_locator->section_tipo\" + data-parent=\"$current_locator->section_id\" + onclick=\"tool_common.open_tool_indexation(this)\">IN"; + }} + + # + # TRANSLATION LINK + if (isset($this->translation)) { + $title = label::get_label('tool_lang'); + switch ($link_target) { + case 'process': + $url = "?t={$this->translation->section_tipo}&top_tipo=".TOP_TIPO."&auto_search=1&{$this->translation->search_section_id}={$current_locator->section_id}"; + $html .= ""; + break; + default: + // icon_bs icon_translation + $html .= "translation->component_tipo}\" + data-section_tipo=\"$current_locator->section_tipo\" + data-parent=\"$current_locator->section_id\" + onclick=\"tool_common.open_tool_lang(this)\">TL"; + }} + + # + # TC DURATION + switch ($media_component_modelo_name) { + case 'component_av': + $html .= "
    ".$tc."
    "; + break; + + default: + break; + } + + $ar_locators_resolved[] = $key_resolved; + $html .= "
  • "; + + }//end foreach ($ar_locators as $current_locator) { + $html .= ""; + + print $html; //"
    Hello widget $widget_name"; + + +?> \ No newline at end of file diff --git a/lib/dedalo/extras/oh/widgets/media_icons/media_icons.php b/lib/dedalo/extras/oh/widgets/media_icons/media_icons.php new file mode 100644 index 0000000000..56f43dfd20 --- /dev/null +++ b/lib/dedalo/extras/oh/widgets/media_icons/media_icons.php @@ -0,0 +1,73 @@ +widget_name; + $modo = $this->component_info->get_modo(); + $parent = $this->component_info->get_parent(); + $section_tipo = $this->component_info->get_section_tipo(); + $data_source = $this->data_source; + $component_portal_tipo = key($data_source); + $media_component_tipo = reset($data_source); + $filename = $modo; + switch ($modo) { + + case 'list': + $filename = 'edit'; + case 'edit': + + # + # DATA_SOURCE + # Format : + # stdClass Object + # ( + # [oh25] => rsc35 + # ) + #dump($data_source, ' data_source ++ '.to_string()); + + if (isset($this->ar_locators)) { + + $ar_locators = $this->ar_locators; // When we are in list, injected from portal data + + }else{ + + # + # COMPONENT PORTAL (calculate when in edit normally) + $component = component_common::get_instance('component_portal', + $component_portal_tipo, + $parent, + 'list', + DEDALO_DATA_NOLAN, + $section_tipo); + $ar_locators = $component->get_dato(); + } + #dump($ar_locators, ' ar_locators ++ '.to_string()); + + if (empty($ar_locators)) { + return null; + } + + $widget_base_url = $this->get_widget_base_url(); + css::$ar_url[] = $widget_base_url ."/css/".$widget_name.".css"; + #js::$ar_url[] = $widget_base_url ."/js/".$widget_name.".js"; + + $media_component_modelo_name = RecordObj_dd::get_modelo_name_by_tipo($media_component_tipo, true); + + $use_cache = true; + + break; + + default: + return "Sorry. Mode: $modo is not supported"; + } + + + + + $page_html = dirname(__FILE__) . '/html/' . $widget_name . '_' . $filename . '.phtml'; + if( !include($page_html) ) { + echo "
    Invalid widget mode $modo
    "; + } + +?> \ No newline at end of file diff --git a/lib/dedalo/extras/oh/widgets/tags/css/tags.css b/lib/dedalo/extras/oh/widgets/tags/css/tags.css new file mode 100644 index 0000000000..d437d5184a --- /dev/null +++ b/lib/dedalo/extras/oh/widgets/tags/css/tags.css @@ -0,0 +1 @@ +.widgets_wrapper{padding:0;max-width:239px;width:inherit}ul.widget_descriptors{margin-top:4px;-webkit-user-select:none;user-select:none;width:auto;min-width:110px;float:left;display:table;margin:0;padding:0;padding-bottom:8px}.widget_descriptors li{display:table;font-size:92%;width:100%;line-height:1.1em}.widget_descriptors li>.label_first,.widget_descriptors li>.label_second{display:table-cell;background-color:#f8f8f8;border-bottom:1px solid #e4e4e4;padding-top:3px;padding-bottom:0;padding-right:5px;padding-left:2px}.widget_descriptors li .label_first{text-align:left;padding-right:5px;min-width:90px;width:13%;text-transform:uppercase}.widget_descriptors li .label_second img{vertical-align:text-bottom}.widget_descriptors li .label_second .error,.widget_descriptors li .label_second .warning{margin:2px;margin-left:0;margin-right:0;margin-top:0;width:100%}ul.widget_descriptors .tab_content{display:none}/*# sourceMappingURL=tags.css.map */ \ No newline at end of file diff --git a/lib/dedalo/extras/oh/widgets/tags/css/tags.css.map b/lib/dedalo/extras/oh/widgets/tags/css/tags.css.map new file mode 100644 index 0000000000..6cfdb3c713 --- /dev/null +++ b/lib/dedalo/extras/oh/widgets/tags/css/tags.css.map @@ -0,0 +1 @@ +{"version":3,"file":"tags.css","sources":["tags.less"],"names":[],"mappings":"AAEA,iBAKI,SAAA,CACA,eAAA,CACH,cAKD,EAAE,oBACD,cAAA,CACA,wBAAA,CACE,gBAAA,CACF,UAAA,CACA,eAAA,CACA,UAAA,CACA,aAAA,CACA,QAAA,CACA,SAAA,CACA,mBAEA,mBAAoB,IACnB,aAAA,CACA,aAAA,CACA,UAAA,CACA,kBAEA,mBAAoB,GAAG,cAAgB,mBAAoB,GAAG,eAC7D,kBAAA,CACA,wBAAA,CACA,+BAAA,CACA,eAAA,CACA,gBAAA,CACA,iBAAA,CACA,iBAED,mBAAoB,GAAG,cACtB,eAAA,CACA,iBAAA,CACA,cAAA,CACA,SAAA,CACA,yBAQA,mBAAoB,GAAG,cAAc,KACpC,2BAED,mBAAoB,GAAG,cAAc,QAAQ,mBAAoB,GAAG,cAAc,UACjF,UAAA,CACA,aAAA,CACA,cAAA,CACA,YAAA,CACA,WAsBF,EAAE,mBAAoB,cACrB","sourceRoot":""} \ No newline at end of file diff --git a/lib/dedalo/extras/oh/widgets/tags/css/tags.less b/lib/dedalo/extras/oh/widgets/tags/css/tags.less new file mode 100644 index 0000000000..af35aab995 --- /dev/null +++ b/lib/dedalo/extras/oh/widgets/tags/css/tags.less @@ -0,0 +1,89 @@ + + +.widgets_wrapper { + /* + width: inherit; + white-space: inherit; + */ + padding: 0; + max-width: 239px; + width: inherit; +} + +/* WIDGET_DESCRIPTORS +------------------------------------------------ */ +ul.widget_descriptors { + margin-top: 4px; + -webkit-user-select: none; + user-select: none; + width: auto; + min-width: 110px; + float: left; + display: table; + margin: 0; + padding: 0; + padding-bottom: 8px; + } + .widget_descriptors li { + display: table; + font-size: 92%; + width: 100%; + line-height: 1.1em; + } + .widget_descriptors li > .label_first, .widget_descriptors li > .label_second { + display: table-cell; + background-color: #F8F8F8; + border-bottom: 1px solid #E4E4E4; + padding-top: 3px; + padding-bottom: 0; + padding-right: 5px; + padding-left: 2px; + } + .widget_descriptors li .label_first { + text-align: left; + padding-right: 5px; + min-width: 90px; + width: 13%; + text-transform: uppercase; + } + .widget_descriptors li .label_second { + /* + white-space: initial; + display: list-item; + */ + } + .widget_descriptors li .label_second img { + vertical-align: text-bottom; + } + .widget_descriptors li .label_second .error, .widget_descriptors li .label_second .warning { + margin: 2px; + margin-left: 0; + margin-right: 0; + margin-top: 0; + width: 100%; + } + + .widget_descriptors li > .label_first, .widget_descriptors li > .label_second { + /*border: none !important;*/ + } + + /* + .widget_descriptors li .header { + border-top: 1px solid #ECECEC; + font-weight: normal; + text-transform: capitalize; + } + .widget_descriptors li .label_second.header { + cursor: pointer; + background-image: url('../../../../themes/default/select_2x.png'); + background-repeat: no-repeat; + background-position: right 4px top 7px; + background-size: 14px; + width: 100%; + } + */ + ul.widget_descriptors .tab_content { + display: none; + } + + \ No newline at end of file diff --git a/lib/dedalo/extras/oh/widgets/tags/html/tags_edit.phtml b/lib/dedalo/extras/oh/widgets/tags/html/tags_edit.phtml new file mode 100644 index 0000000000..514e796465 --- /dev/null +++ b/lib/dedalo/extras/oh/widgets/tags/html/tags_edit.phtml @@ -0,0 +1,119 @@ +"; + + # + # HEADER + #$html .= "
  • "; + #$html .= "
    ".label::get_label('terminos')." : $total_terms / $total_index
    "; + #$html .= "
  • "; + + + # + # ROWS + + # + # TC + $html .= "
  • "; + $html .= "
    TC :
    "; + $html .= "
    ".$total_tc."
    "; + $html .= "
  • "; + + + #if(SHOW_DEBUG) { + if (!empty($ar_tc_wrong)) { + $html .= "
  • "; + $html .= "
    "; + foreach ($ar_tc_wrong as $current_tc) { + $html .= " ".label::get_label('etiqueta_revisar').": $current_tc
    "; + } + $html .= "
    "; + $html .= "
  • "; + } + #} + + + # + # INDEX + $html .= "
  • "; + $html .= "
    INDEX :
    "; + $html .= "
    ".$total_index."
    "; + $html .= "
  • "; + + # + # INDEX IN MISSING + /* + if (!empty($ar_missing_indexIn) || !empty($ar_missing_indexOut)) { + $html .= "
  • "; + #$html .= "
    ".label::get_label('index_errors')."
    "; + + + $html .= "
    "; + + // MODO DESGLOSADO + $missing_indexIn_html=''; + if (!empty($ar_missing_indexIn)) { + foreach ($ar_missing_indexIn as $ctag) { + #dump($ctag, ' ctag ++ '.to_string()); + + #$tag_id = TR::tag2value($ctag); + #dump($tag_id, ' $tag_id ++ '.to_string()); + // ?m=tool_indexation&t=rsc36§ion_tipo=rsc167&parent=2&top_tipo=oh1&top_id=1&tag_id=1 + #$url = "?m=tool_indexation&t={$tipo}§ion_tipo={$section_tipo}&parent={$parent}&top_tipo={$top_tipo}&top_id={$top_id}&tag_id={$tag_id}"; + + $img = TR::create_text_editor_image_from_tag( $ctag, 'index' ); + $missing_indexIn_html .= "".label::get_label('etiqueta_perdida').":$img
    "; + } + } + $html .= $missing_indexIn_html; + + $missing_indexOut_html=''; + if (!empty($ar_missing_indexOut)) { + foreach ($ar_missing_indexOut as $ctag) { + + $img = TR::create_text_editor_image_from_tag( $ctag, 'index' ); + $missing_indexOut_html .= "".label::get_label('etiqueta_perdida').":$img
    "; + } + } + $html .= $missing_indexOut_html; + + + #$html .= "".label::get_label('etiquetas_borradas').": $total_deleted_tags
    "; + + $html .= "
    "; + + $html .= "
  • "; + } + */ + + if ($total_missing_tags>0 || $total_to_review_tags>0) { + + $html .= "
  • "; + $html .= "
    "; + if ($total_missing_tags>0) { + $html .= " ".label::get_label('etiquetas_perdidas').": $total_missing_tags
    "; + } + if ($total_to_review_tags>0) { + $html .= " ".label::get_label('etiqueta_revisar').": $total_to_review_tags
    "; + } + $html .= "
    "; + $html .= "
  • "; + } + + # + # TOTALS CHARS + $html .= "
  • "; + $html .= "
    CHARS :
    "; + $html .= "
    ".$total_chars."
    "; + $html .= "
  • "; + + + $html .= ""; + + + print $html; + +?> \ No newline at end of file diff --git a/lib/dedalo/extras/oh/widgets/tags/tags.php b/lib/dedalo/extras/oh/widgets/tags/tags.php new file mode 100644 index 0000000000..e44963204b --- /dev/null +++ b/lib/dedalo/extras/oh/widgets/tags/tags.php @@ -0,0 +1,173 @@ +widget_name; + $modo = $this->component_info->get_modo(); + $parent = $this->component_info->get_parent(); + $section_tipo = $this->component_info->get_section_tipo(); + $lang = DEDALO_DATA_LANG; + $data_source = $this->data_source; + $component_text_area_tipo = $data_source; + $filename = $modo; + + /* + if(!SHOW_DEBUG) { + echo "Working here.."; + return null; + } + */ + + + switch ($modo) { + + case 'list': + $filename = 'edit'; + + case 'edit': + # + # RAW TEXT + $original_lang = component_text_area::force_change_lang($component_text_area_tipo, $parent, $modo, $lang, $section_tipo); + $component = component_common::get_instance('component_text_area', + $component_text_area_tipo, + $parent, + $modo, + $original_lang, + $section_tipo); + $raw_text = $component->get_dato(); + #dump($raw_text, ' raw_text ++ '.to_string($component_text_area_tipo .'-'. $parent.' - '.$lang )); + + # + # TC'S' + $pattern = TR::get_mark_pattern($mark='tc',$standalone=false); + # Search math patern tags + preg_match_all($pattern, $raw_text, $matches_tc, PREG_PATTERN_ORDER); + #dump($matches_tc[0],"matches_tc ".to_string($pattern)); + $total_tc = 0; + if (isset($matches_tc[0])) { + $total_tc = count($matches_tc[0]); + } + #dump($total_tc, ' total_tc ++ '.to_string()); + #dump($matches_tc[1], '$matches_tc[1] ++ '.to_string()); + + # TC WRONG + require_once(DEDALO_LIB_BASE_PATH.'/media_engine/class.OptimizeTC.php'); + $ar_secs = []; + $ar_tc_wrong = []; + foreach ($matches_tc[1] as $key => $value) { + #dump($value, ' value ++ '.to_string($key)); + $secs = OptimizeTC::TC2seg($value); + $ar_secs[$key] = $secs; + #dump($secs, ' secs ++ '.to_string()); + if ($key>0 && $secs<$ar_secs[$key-1]) { + $ar_tc_wrong[] = $value; + #dump($secs, ' $secs ++ ERROR '.to_string($value)); + } + } + #dump($ar_tc_wrong, ' $ar_tc_wrong ++ '.to_string()); + + # + # INDEX + # INDEX IN + $pattern = TR::get_mark_pattern($mark='indexIn',$standalone=false); + preg_match_all($pattern, $raw_text, $matches_indexIn, PREG_PATTERN_ORDER); + #dump($matches_indexIn,"matches_indexIn ".to_string($pattern)); + $total_indexIn = 0; + if (isset($matches_indexIn[0])) { + $total_indexIn = count($matches_indexIn[0]); + } + #dump($total_indexIn, ' total_indexIn ++ '.to_string()); + + # INDEX OUT + $pattern = TR::get_mark_pattern($mark='indexOut',$standalone=false); + preg_match_all($pattern, $raw_text, $matches_indexOut, PREG_PATTERN_ORDER); + #dump($matches_indexOut,"matches_indexOut ".to_string($pattern)); + $total_indexOut = 0; + if (isset($matches_indexOut[0])) { + $total_indexOut = count($matches_indexOut[0]); + } + #dump($total_indexOut, ' total_indexOut ++ '.to_string()); + + # INDEX MISSING IN + $ar_missing_indexIn=array(); + foreach ($matches_indexOut[2] as $key => $value) { + if (!in_array($value, $matches_indexIn[2])) { + $tag_in = $matches_indexOut[0][$key]; + $tag_in = str_replace('[/', '[', $tag_in); + $ar_missing_indexIn[] = $tag_in; + } + } + #dump($ar_missing_indexIn, ' ar_missing_indexIn ++ '.to_string()); + + # INDEX MISSING OUT + $ar_missing_indexOut=array(); + foreach ($matches_indexIn[2] as $key => $value) { + if (!in_array($value, $matches_indexOut[2])) { + $tag_out = $matches_indexIn[0][$key]; // As we only have the in tag, we create out tag + $tag_out = str_replace('[', '[/', $tag_out); + $ar_missing_indexOut[] = $tag_out; + } + } + #dump($ar_missing_indexOut, ' ar_missing_indexOut ++ '.to_string()); + + + $ar_different_index = array(); + if(isset($matches_indexIn[2])) foreach ($matches_indexIn[2] as $value) { + $ar_different_index[] = $value; + } + if(isset($matches_indexOut[2])) foreach ($matches_indexOut[2] as $value) { + $ar_different_index[] = $value; + } + $ar_different_index = array_unique($ar_different_index); + $total_index = count($ar_different_index); + #dump($ar_different_index, ' $ar_different_index ++ '.to_string($total_index)); + + + # + # BLUE TAGS (DELETED) + $pattern = "/\[\/{0,1}index-d-([0-9]+)\]/"; + preg_match_all($pattern, $raw_text, $matches_deleted, PREG_PATTERN_ORDER); + #dump($matches_deleted, ' matches_deleted ++ '.to_string()); + $ar_deleted = array_unique( $matches_deleted[1] ); + + + # Contabilizamos las etiquetas rotas encontradas + las etiquetas azules existentes en el texto + # No se contabilizan aquí las posibles 'perdidas' referenciadas en el tesauro pero que no están en el texto actual (por velocidad) + # estas se añadirán automáticamente al entrar en modo edit al principio del texto + $total_missing_tags = count($ar_missing_indexIn) + count($ar_missing_indexOut) + count($ar_deleted); + + + # + # RED TAGS (TO REVIEW) + $pattern = "/\[\/{0,1}index-r-([0-9]+)\]/"; + preg_match_all($pattern, $raw_text, $matches_to_review, PREG_PATTERN_ORDER); + #dump($matches_to_review, ' matches_to_review ++ '.to_string()); + $ar_to_review = array_unique( $matches_to_review[1] ); + $total_to_review_tags = count($ar_to_review); + + + # + # TOTAL CHARS + $total_chars = mb_strlen($raw_text,'UTF-8'); + + + $widget_base_url = $this->get_widget_base_url(); + css::$ar_url[] = $widget_base_url ."/css/".$widget_name.".css"; + #js::$ar_url[] = $widget_base_url ."/js/".$widget_name.".js"; + + break; + + default: + return "Sorry. Mode: $modo is not supported"; + } + + + + + $page_html = dirname(__FILE__) . '/html/' . $widget_name . '_' . $filename . '.phtml'; + if( !include($page_html) ) { + echo "
    Invalid widget mode $modo
    "; + } + +?> \ No newline at end of file diff --git a/lib/dedalo/login/class.login.php b/lib/dedalo/login/class.login.php index 4429041b6a..a9ef76712e 100644 --- a/lib/dedalo/login/class.login.php +++ b/lib/dedalo/login/class.login.php @@ -847,8 +847,11 @@ public function test_su_default_password() { DEDALO_SECTION_USERS_TIPO); $dato = $component->get_dato(); $default = login::SU_DEFAULT_PASSWORD; // Dedalo4debugChangePsW +<<<<<<< HEAD $encryption_mode = encryption_mode(); +======= +>>>>>>> origin/master if( $encryption_mode==='openssl' ) { if (dedalo_decrypt_openssl($dato)==$default) {