2016-10-06 15:57:01 +00:00
< ? php
2022-05-17 18:00:37 +00:00
2016-10-06 15:57:01 +00:00
/**
* Project :
* Contenido Content Management System
*
* Description :
* Misc . functions of area con
*
* Requirements :
* @ con_php_req 5.0
*
*
* @ package Contenido Backend includes
* @ version 1.1 . 1
* @ author Jan Lengowski
* @ copyright four for business AG < www . 4 fb . de >
* @ license http :// www . contenido . org / license / LIZENZ . txt
* @ link http :// www . 4 fb . de
* @ link http :// www . contenido . org
* @ since file available since contenido release <= 4.6
*
* { @ internal
* @ created 2003 - 03 - 26
* @ modified 2008 - 06 - 27 , Frederic Schneider , add security fix
* @ modified 2008 - 09 - 08 , Ingo van Peeren , improved navigation tree in left bottom frame , expanding /
* collapsing of navigation tree without reloading ( AJAX /
* javascript solution based on jquery )
* @ modified 2008 - 09 - 18 , Ingo van Peeren , moved template - changing to jquery
* @ modified 2010 - 06 - 16 , Timo Trautmann , Fixed a bug wit the Syncselection ( there was no right userright check )
*
2019-07-03 11:58:28 +00:00
* $Id $ :
2016-10-06 15:57:01 +00:00
* }}
*
*/
2022-05-17 18:00:37 +00:00
if ( ! defined ( 'CON_FRAMEWORK' )) {
die ( 'Illegal call' );
2016-10-06 15:57:01 +00:00
}
2022-05-17 18:00:37 +00:00
cInclude ( " includes " , " functions.str.php " );
cInclude ( " includes " , " functions.tpl.php " );
2016-10-06 15:57:01 +00:00
cInclude ( 'includes' , 'functions.lang.php' );
2022-05-17 18:00:37 +00:00
if ( ! isset ( $oTpl ) || ! is_object ( $oTpl )) {
2016-10-06 15:57:01 +00:00
$oTpl = new Template ();
}
$oTpl -> reset ();
global $sess , $frame , $area ;
2022-05-17 18:00:37 +00:00
$idcat = ( isset ( $_GET [ 'idcat' ]) && is_numeric ( $_GET [ 'idcat' ])) ? $_GET [ 'idcat' ] : - 1 ;
2016-10-06 15:57:01 +00:00
//Get sync options
2022-05-17 18:00:37 +00:00
if ( isset ( $syncoptions )) {
$syncfrom = ( int ) $syncoptions ;
$remakeCatTable = true ;
2016-10-06 15:57:01 +00:00
}
2022-05-17 18:00:37 +00:00
if ( ! isset ( $syncfrom )) {
$syncfrom = - 1 ;
2016-10-06 15:57:01 +00:00
}
$syncoptions = $syncfrom ;
$oTpl -> set ( 's' , 'SYNC_LANG' , $syncfrom );
##########################################
# Delete a saved search
##########################################
$bShowArticleSearch = false ;
2022-05-17 18:00:37 +00:00
if ( isset ( $_GET [ 'delsavedsearch' ])) {
if ( isset ( $_GET [ 'itemtype' ]) && sizeof ( $_GET [ 'itemtype' ]) > 0 && isset ( $_GET [ 'itemid' ]) && sizeof ( $_GET [ 'itemid' ]) > 0 ) {
$propertyCollection = new PropertyCollection ;
$propertyCollection -> deleteProperties ( $_GET [ 'itemtype' ], $_GET [ 'itemid' ]);
$bShowArticleSearch = true ;
}
2016-10-06 15:57:01 +00:00
}
2022-05-17 18:00:37 +00:00
if ( isset ( $_GET [ 'save_search' ]) && $_GET [ 'save_search' ] == 'true' ) {
$bShowArticleSearch = true ;
2016-10-06 15:57:01 +00:00
}
##########################################
# ARTICLE SEARCH
##########################################
# modified 20/04/2007 by H. Librenz for backend search
$arrDays = array ();
2022-05-17 18:00:37 +00:00
for ( $i = 0 ; $i < 32 ; $i ++ ) {
if ( $i == 0 ) {
$arrDays [ $i ] = '--' ;
} else {
$arrDays [ $i ] = $i ;
}
2016-10-06 15:57:01 +00:00
}
$arrMonths = array ();
for ( $i = 0 ; $i < 13 ; $i ++ ) {
2022-05-17 18:00:37 +00:00
if ( $i == 0 ) {
$arrMonths [ $i ] = '--' ;
} else {
$arrMonths [ $i ] = $i ;
}
2016-10-06 15:57:01 +00:00
}
$arrYears = array ();
$arrYears [ 0 ] = '-----' ;
$sActualYear = ( int ) date ( " Y " );
2022-05-17 18:00:37 +00:00
for ( $i = $sActualYear - 10 ; $i < $sActualYear + 30 ; $i ++ ) {
$arrYears [ $i ] = $i ;
2016-10-06 15:57:01 +00:00
}
$arrUsers = array ();
2022-05-17 18:00:37 +00:00
$query = " SELECT * FROM " . $cfg [ 'tab' ][ 'phplib_auth_user_md5' ] . " ORDER BY realname " ;
2016-10-06 15:57:01 +00:00
$arrUsers [ 'n/a' ] = '-' ;
$db -> query ( $query );
while ( $db -> next_record ()) {
2022-05-17 18:00:37 +00:00
$arrUsers [ $db -> f ( 'username' )] = $db -> f ( 'realname' );
2016-10-06 15:57:01 +00:00
}
$arrDateTypes = array ();
$arrDateTypes [ 'n/a' ] = i18n ( 'Ignore' );
$arrDateTypes [ 'created' ] = i18n ( 'Date created' );
$arrDateTypes [ 'lastmodified' ] = i18n ( 'Date modified' );
$arrDateTypes [ 'published' ] = i18n ( 'Date published' );
2022-05-17 18:00:37 +00:00
$articleLink = " editarticle " ;
2016-10-06 15:57:01 +00:00
$oListOptionRow = new cFoldingRow ( " 3498dbba-ed4a-4618-8e49-3a3635396e22 " , i18n ( " Article Search " ), $articleLink , $bShowArticleSearch );
$oTpl -> set ( 's' , 'ARTICLELINK' , $articleLink );
#Textfeld
2022-05-17 18:00:37 +00:00
$oTextboxArtTitle = new cHTMLTextbox ( " bs_search_text " , ( isset ( $_REQUEST [ " bs_search_text " ]) ? $_REQUEST [ " bs_search_text " ] : '' ), 10 );
2016-10-06 15:57:01 +00:00
$oTextboxArtTitle -> setStyle ( 'width:135px;' );
#Artikel_ID-Feld
2022-05-17 18:00:37 +00:00
$oTextboxArtID = new cHTMLTextbox ( " bs_search_id " , ( isset ( $_REQUEST [ " bs_search_id " ]) ? $_REQUEST [ " bs_search_id " ] : '' ), 10 );
2016-10-06 15:57:01 +00:00
$oTextboxArtID -> setStyle ( 'width:135px;' );
#Date type
$oSelectArtDateType = new cHTMLSelectElement ( " bs_search_date_type " , " bs_search_date_type " );
$oSelectArtDateType -> autoFill ( $arrDateTypes );
$oSelectArtDateType -> setStyle ( 'width:135px;' );
$oSelectArtDateType -> setEvent ( " Change " , " toggle_tr_visibility('tr_date_from');toggle_tr_visibility('tr_date_to'); " );
2022-05-17 18:00:37 +00:00
if ( isset ( $_REQUEST [ " bs_search_date_type " ]) && $_REQUEST [ " bs_search_date_type " ] != '' ) {
$oSelectArtDateType -> setDefault ( $_REQUEST [ " bs_search_date_type " ]);
2016-10-06 15:57:01 +00:00
} else {
2022-05-17 18:00:37 +00:00
$oSelectArtDateType -> setDefault ( 'n/a' );
2016-10-06 15:57:01 +00:00
}
#DateFrom
$oSelectArtDateFromDay = new cHTMLSelectElement ( " bs_search_date_from_day " );
$oSelectArtDateFromDay -> setStyle ( 'width:40px;' );
$oSelectArtDateFromDay -> autoFill ( $arrDays );
$oSelectArtDateFromMonth = new cHTMLSelectElement ( " bs_search_date_from_month " );
$oSelectArtDateFromMonth -> setStyle ( 'width:40px;' );
$oSelectArtDateFromMonth -> autoFill ( $arrMonths );
$oSelectArtDateFromYear = new cHTMLSelectElement ( " bs_search_date_from_year " );
$oSelectArtDateFromYear -> setStyle ( 'width:55px;' );
$oSelectArtDateFromYear -> autoFill ( $arrYears );
if ( isset ( $_REQUEST [ " bs_search_date_from_day " ]) && $_REQUEST [ " bs_search_date_from_day " ] > 0 ) {
2022-05-17 18:00:37 +00:00
$oSelectArtDateFromDay -> setDefault ( $_REQUEST [ " bs_search_date_from_day " ]);
2016-10-06 15:57:01 +00:00
} else {
2022-05-17 18:00:37 +00:00
$oSelectArtDateFromDay -> setDefault ( 0 );
2016-10-06 15:57:01 +00:00
}
if ( isset ( $_REQUEST [ " bs_search_date_from_month " ]) && $_REQUEST [ " bs_search_date_from_month " ] > 0 ) {
2022-05-17 18:00:37 +00:00
$oSelectArtDateFromMonth -> setDefault ( $_REQUEST [ " bs_search_date_from_month " ]);
2016-10-06 15:57:01 +00:00
} else {
2022-05-17 18:00:37 +00:00
$oSelectArtDateFromMonth -> setDefault ( 0 );
2016-10-06 15:57:01 +00:00
}
if ( isset ( $_REQUEST [ " bs_search_date_from_year " ]) && $_REQUEST [ " bs_search_date_from_year " ] > 0 ) {
2022-05-17 18:00:37 +00:00
$oSelectArtDateFromYear -> setDefault ( $_REQUEST [ " bs_search_date_from_year " ]);
2016-10-06 15:57:01 +00:00
} else {
2022-05-17 18:00:37 +00:00
$oSelectArtDateFromYear -> setDefault ( 0 );
2016-10-06 15:57:01 +00:00
}
#DateTo
$oSelectArtDateToDay = new cHTMLSelectElement ( " bs_search_date_to_day " );
$oSelectArtDateToDay -> setStyle ( 'width:40px;' );
$oSelectArtDateToDay -> autoFill ( $arrDays );
$oSelectArtDateToMonth = new cHTMLSelectElement ( " bs_search_date_to_month " );
$oSelectArtDateToMonth -> setStyle ( 'width:40px;' );
$oSelectArtDateToMonth -> autoFill ( $arrMonths );
$oSelectArtDateToYear = new cHTMLSelectElement ( " bs_search_date_to_year " );
$oSelectArtDateToYear -> setStyle ( 'width:55px;' );
$oSelectArtDateToYear -> autoFill ( $arrYears );
if ( isset ( $_REQUEST [ " bs_search_date_to_day " ]) && $_REQUEST [ " bs_search_date_to_day " ] > 0 ) {
2022-05-17 18:00:37 +00:00
$oSelectArtDateToDay -> setDefault ( $_REQUEST [ " bs_search_date_to_day " ]);
2016-10-06 15:57:01 +00:00
} else {
2022-05-17 18:00:37 +00:00
$oSelectArtDateToDay -> setDefault ( 0 );
2016-10-06 15:57:01 +00:00
}
if ( isset ( $_REQUEST [ " bs_search_date_to_month " ]) && $_REQUEST [ " bs_search_date_to_month " ] > 0 ) {
2022-05-17 18:00:37 +00:00
$oSelectArtDateToMonth -> setDefault ( $_REQUEST [ " bs_search_date_to_month " ]);
2016-10-06 15:57:01 +00:00
} else {
2022-05-17 18:00:37 +00:00
$oSelectArtDateToMonth -> setDefault ( 0 );
2016-10-06 15:57:01 +00:00
}
if ( isset ( $_REQUEST [ " bs_search_date_to_year " ]) && $_REQUEST [ " bs_search_date_to_year " ] > 0 ) {
2022-05-17 18:00:37 +00:00
$oSelectArtDateToYear -> setDefault ( $_REQUEST [ " bs_search_date_to_year " ]);
2016-10-06 15:57:01 +00:00
} else {
2022-05-17 18:00:37 +00:00
$oSelectArtDateToYear -> setDefault ( 0 );
2016-10-06 15:57:01 +00:00
}
#Author
$oSelectArtAuthor = new cHTMLSelectElement ( " bs_search_author " );
$oSelectArtAuthor -> setStyle ( 'width:135px;' );
$oSelectArtAuthor -> autoFill ( $arrUsers );
2022-05-17 18:00:37 +00:00
if ( isset ( $_REQUEST [ " bs_search_author " ]) && $_REQUEST [ " bs_search_author " ] != '' ) {
$oSelectArtAuthor -> setDefault ( $_REQUEST [ " bs_search_author " ]);
2016-10-06 15:57:01 +00:00
} else {
2022-05-17 18:00:37 +00:00
$oSelectArtAuthor -> setDefault ( 'n/a' );
2016-10-06 15:57:01 +00:00
}
$oSubmit = new cHTMLButton ( " submit " , i18n ( " Search " ));
2022-05-17 18:00:37 +00:00
$content = '<div id="artsearch" style="border: 1px solid #B3B3B3; border-top: none; margin:0;padding:0; padding-bottom: 10px;background: ' . $cfg [ 'color' ][ 'table_dark' ] . ';">' ;
2016-10-06 15:57:01 +00:00
$content .= '<form action="backend_search.php" method="post" name="backend_search" target="right_bottom" id="backend_search">' ;
2022-05-17 18:00:37 +00:00
$content .= '<table dir="' . langGetTextDirection ( $lang ) . '">' ;
$content .= '<input type="hidden" name="area" value="' . $area . '">' ;
$content .= '<input type="hidden" name="frame" value="' . $frame . '">' ;
$content .= '<input type="hidden" name="contenido" value="' . $sess -> id . '">' ;
$content .= '<input type="hidden" name="speach" value="' . $lang . '">' ;
2016-10-06 15:57:01 +00:00
$content .= '<tr>' ;
2022-05-17 18:00:37 +00:00
$content .= '<td style="padding-left: 15px;">' . i18n ( " Title/Content " ) . '</td>' ;
$content .= '<td>' . $oTextboxArtTitle -> render () . '</td>' ;
2016-10-06 15:57:01 +00:00
$content .= '</tr>' ;
$content .= '<tr>' ;
2022-05-17 18:00:37 +00:00
$content .= '<td style="padding-left: 15px;">' . i18n ( " Article ID " ) . '</td>' ;
$content .= '<td>' . $oTextboxArtID -> render () . '</td>' ;
2016-10-06 15:57:01 +00:00
$content .= '</tr>' ;
$content .= '<tr>' ;
2022-05-17 18:00:37 +00:00
$content .= '<td style="padding-left: 15px;">' . i18n ( " Datum " ) . '</td>' ;
$content .= '<td><nobr>' . $oSelectArtDateType -> render () . '</nobr></td>' ;
2016-10-06 15:57:01 +00:00
$content .= '</tr>' ;
$content .= '<tr id="tr_date_from" style="display:none;">' ;
2022-05-17 18:00:37 +00:00
$content .= '<td>' . i18n ( " Date from " ) . '</td>' ;
$content .= '<td><nobr>' . $oSelectArtDateFromDay -> render () . $oSelectArtDateFromMonth -> render () . $oSelectArtDateFromYear -> render () . '</nobr></td>' ;
2016-10-06 15:57:01 +00:00
$content .= '</tr>' ;
$content .= '<tr id="tr_date_to" style="display:none;">' ;
2022-05-17 18:00:37 +00:00
$content .= '<td>' . i18n ( " Date to " ) . '</td>' ;
$content .= '<td><nobr>' . $oSelectArtDateToDay -> render () . $oSelectArtDateToMonth -> render () . $oSelectArtDateToYear -> render () . '</nobr></td>' ;
2016-10-06 15:57:01 +00:00
$content .= '</tr>' ;
$content .= '<tr>' ;
2022-05-17 18:00:37 +00:00
$content .= '<td style="padding-left: 15px;">' . i18n ( " Author " ) . '</td>' ;
$content .= '<td><nobr>' . $oSelectArtAuthor -> render () . '</nobr></td>' ;
2016-10-06 15:57:01 +00:00
$content .= '</tr>' ;
$content .= '<tr>' ;
$content .= '<td> </td>' ;
2022-05-17 18:00:37 +00:00
$content .= '<td>' . $oSubmit -> render () . '</td>' ;
2016-10-06 15:57:01 +00:00
$content .= '</tr>' ;
$content .= '</table>' ;
$content .= '</form>' ;
/**
* Saved searches
*/
$content .= '<div class="artikel_search">' ;
2022-05-17 18:00:37 +00:00
$content .= '<div style="font-weight:bold; margin-bottom: 10px;">' . i18n ( " Saved Searches " ) . ':</div>' ;
2016-10-06 15:57:01 +00:00
$proppy = new PropertyCollection ();
$savedSearchList = $proppy -> getAllValues ( 'type' , 'savedsearch' , $auth );
$init_itemid = '' ;
$init_itemtype = '' ;
$content .= '<ul class="artikel_search">' ;
// Recently edited articles search - predefined, not deleteable
2022-05-17 18:00:37 +00:00
$searchRecentlyEdited = " javascript:conMultiLink('right_bottom', 'backend_search.php?area= " . $area . " &frame=4&contenido= " . $sess -> id . " &recentedit=true'); resetSearchForm(); " ;
$content .= '<li style="margin-bottom: 3px;"><img style="vertical-align:middle; padding-left: 3px;" src="images/delete_inact.gif" /><a style="padding-left: 3px;" href="' . $searchRecentlyEdited . '">' . i18n ( " Recently edited articles " ) . '</a></li>' ;
2016-10-06 15:57:01 +00:00
// My articles search - predefined, not deleteable
2022-05-17 18:00:37 +00:00
$searchMyArticles = " javascript:conMultiLink('right_bottom', 'backend_search.php?area= " . $area . " &frame=4&contenido= " . $sess -> id . " &myarticles=true'); resetSearchForm(); " ;
$content .= '<li style="margin-bottom: 3px;"><img style="vertical-align:middle;padding-left: 3px;" src="images/delete_inact.gif" /><a style="padding-left: 3px;" href="' . $searchMyArticles . '">' . i18n ( " My articles " ) . '</a></li>' ;
2016-10-06 15:57:01 +00:00
// Workflow
$link = $sess -> url ( " main.php?area=con_workflow&frame=4 " );
2022-05-17 18:00:37 +00:00
$sWorflowLink = 'conMultiLink(\'right_bottom\', \'' . $link . '\'); resetSearchForm();' ;
$content .= '<li style="margin-bottom: 3px;"><img style="vertical-align:middle;padding-left: 3px;" src="images/delete_inact.gif" /><a style="padding-left: 3px;" href="javascript:' . $sWorflowLink . '">' . i18n ( " Workflow " ) . '</a></li>' ;
foreach ( $savedSearchList as $value ) {
if (( $init_itemid != $value [ 'itemid' ]) && ( $init_itemtype != $value [ 'itemtype' ])) {
$init_itemid = $value [ 'itemid' ];
$init_itemtype = $value [ 'itemtype' ];
// Create delete icon
$deleteSearch = " javascript:conMultiLink('left_top', 'main.php?area= " . $area . " &frame=1&delsavedsearch=true&contenido= " . $sess -> id . " &itemid= " . $value [ 'itemid' ] . " &itemtype= " . $value [ 'itemtype' ] . " ') " ;
$content .= '<li style="margin-bottom: 3px;">' ;
$content .= '<a href="' . $deleteSearch . '"><img style="padding-left: 3px; vertical-align:middle;" src="images/delete.gif" /></a>' ;
// create new link
$savedSearchLink = " javascript:conMultiLink('right_bottom', 'backend_search.php?area= " . $area . " &frame=4&contenido= " . $sess -> id . " &itemid= " . $value [ 'itemid' ] . " &itemtype= " . $value [ 'itemtype' ] . " ') " ;
$content .= '<a style="padding-left: 3px;" href="' . $savedSearchLink . '">' ;
}
// Name the link
if ( $value [ 'name' ] == 'save_name' ) {
$content .= $value [ 'value' ] . '</a>' ;
$content .= '</li>' ;
}
2016-10-06 15:57:01 +00:00
}
$content .= '</ul>' ;
$content .= '</div>' ;
$content .= '</div>' ;
$oListOptionRow -> setContentData ( $content );
$sSelfLink = 'main.php?area=' . $area . '&frame=2&' . $sess -> name . " = " . $sess -> id ;
$oTpl -> set ( 's' , 'SELFLINK' , $sSelfLink );
$oTpl -> set ( 's' , 'SEARCH' , $oListOptionRow -> render ());
##########################################
# Category
##########################################
$sql = " SELECT
idtpl ,
name
FROM
2022-05-17 18:00:37 +00:00
" . $cfg['tab'] ['tpl'] . "
2016-10-06 15:57:01 +00:00
WHERE
2022-05-17 18:00:37 +00:00
idclient = '" . Contenido_Security::toInteger($client) . "'
2016-10-06 15:57:01 +00:00
ORDER BY
name " ;
$db -> query ( $sql );
2022-05-17 18:00:37 +00:00
$oTpl -> set ( 's' , 'ID' , 'oTplSel' );
$oTpl -> set ( 's' , 'CLASS' , 'text_medium' );
$oTpl -> set ( 's' , 'OPTIONS' , '' );
$oTpl -> set ( 's' , 'SESSID' , $sess -> id );
2016-10-06 15:57:01 +00:00
$oTpl -> set ( 's' , 'BELANG' , $belang );
2022-05-17 18:00:37 +00:00
$oTpl -> set ( 'd' , 'VALUE' , '0' );
$oTpl -> set ( 'd' , 'CAPTION' , i18n ( " Choose template " ));
$oTpl -> set ( 'd' , 'SELECTED' , '' );
2016-10-06 15:57:01 +00:00
$oTpl -> next ();
2022-05-17 18:00:37 +00:00
$oTpl -> set ( 'd' , 'VALUE' , '0' );
$oTpl -> set ( 'd' , 'CAPTION' , '--- ' . i18n ( " none " ) . ' ---' );
$oTpl -> set ( 'd' , 'SELECTED' , '' );
2016-10-06 15:57:01 +00:00
$oTpl -> next ();
2022-05-17 18:00:37 +00:00
$categoryLink = " editcat " ;
2016-10-06 15:57:01 +00:00
$editCategory = new cFoldingRow ( " 3498dbbb-ed4a-4618-8e49-3a3635396e22 " , i18n ( " Edit Category " ), $categoryLink );
while ( $db -> next_record ()) {
$oTplname = $db -> f ( 'name' );
2022-05-17 18:00:37 +00:00
if ( strlen ( $oTplname ) > 18 ) {
2016-10-06 15:57:01 +00:00
$oTplname = substr ( $oTplname , 0 , 15 ) . " ... " ;
}
$oTpl -> set ( 'd' , 'VALUE' , $db -> f ( 'idtpl' ));
$oTpl -> set ( 'd' , 'CAPTION' , $oTplname );
$oTpl -> set ( 'd' , 'SELECTED' , '' );
$oTpl -> next ();
}
// Template Dropdown
2022-05-17 18:00:37 +00:00
$editCat = '<div style="height:110px;padding-top:5px; padding-left: 17px; margin-bottom:-1px; border-right:1px solid #B3B3B3">' ;
$editCat .= i18n ( " Template: " ) . " <br /> " ;
$editCat .= '<div style="">' ;
$editCat .= $oTpl -> generate ( $cfg [ 'path' ][ 'templates' ] . $cfg [ 'templates' ][ 'generic_select' ], true );
$editCat .= '<a id="changetpl" href="#"><img style="vertical-align: middle;" src="images/submit.gif" border="0"></a><br />' ;
$editCat .= '</div>' ;
2016-10-06 15:57:01 +00:00
// Category
2022-05-17 18:00:37 +00:00
$editCat .= '<div style="margin: 5px 0 5px 0;">' ;
$oTpl -> set ( 's' , 'CAT_HREF' , $sess -> url ( " main.php?area=con_tplcfg&action=tplcfg_edit&frame=4&mode=art " ) . '&idcat=' );
2016-10-06 15:57:01 +00:00
$oTpl -> set ( 's' , 'IDCAT' , $idcat );
2022-05-17 18:00:37 +00:00
$editCat .= '<div id="oTemplatecfg_label"><a href="javascript:configureCategory();"><img style="vertical-align: middle;" id="oTemplatecfg" vspace="3" hspace="2" src="' . $cfg [ " path " ][ " images " ] . 'but_cat_conf2.gif" border="0" title="' . i18n ( " Configure Category " ) . '" alt="' . i18n ( " Configure Category " ) . '"><a>' ;
$editCat .= '<a href="javascript:configureCategory();">' . i18n ( " Configure Category " ) . '</a></div>' ;
2016-10-06 15:57:01 +00:00
// Online / Offline
2022-05-17 18:00:37 +00:00
$editCat .= '<div id="oOnline_label"><a href="#"><img style="vertical-align: middle;" id="oOnline" src="images/offline.gif" vspace="2" hspace="2" border="0" title="' . i18n ( " Online / Offline " ) . '" alt="' . i18n ( " Online / Offline " ) . '"></a>' ;
$editCat .= '<a href="#">' . i18n ( " Online / Offline " ) . '</a></div>' ;
2016-10-06 15:57:01 +00:00
// Lock / Unlock
2022-05-17 18:00:37 +00:00
$editCat .= '<div id="oLock_label"><a href="#"><img style="vertical-align: middle;" id="oLock" src="images/folder_lock.gif" vspace="2" hspace="2" border="0" title="' . i18n ( " Lock / Unlock " ) . '" alt="' . i18n ( " Lock / Unlock " ) . '"></a>' ;
$editCat .= '<a href="#">' . i18n ( " Lock / Unlock " ) . '</a></div>' ;
$editCat .= '<br />' ;
2016-10-06 15:57:01 +00:00
$editCat .= '</div>' ;
$editCat .= '</div>' ;
$editCategory -> setContentData ( $editCat );
$oTpl -> set ( 's' , 'EDIT' , $editCategory -> render ());
$oTpl -> set ( 's' , 'CATEGORYLINK' , $categoryLink );
#####################################
# Collapse / Expand / Config Category
#####################################
$selflink = " main.php " ;
$expandlink = $sess -> url ( $selflink . " ?area= $area &frame=2&expand=all " );
$collapselink = $sess -> url ( $selflink . " ?area= $area &frame=2&collapse=all " );
2022-05-17 18:00:37 +00:00
$collapseimg = '<a target="left_bottom" class="black" id="collapser" href="' . $collapselink . '" alt="' . i18n ( " close all " ) . '" title="' . i18n ( " Close all categories " ) . '"><img src="images/close_all.gif" border="0"> ' . i18n ( " close all " ) . '</a>' ;
$expandimg = '<a target="left_bottom"class="black" id="expander" href="' . $expandlink . '" alt="' . i18n ( " open all " ) . '" title="' . i18n ( " Open all categories " ) . '"><img src="images/open_all.gif" border="0"> ' . i18n ( " open all " ) . '</a>' ;
2016-10-06 15:57:01 +00:00
$oTpl -> set ( 's' , 'MINUS' , $collapseimg );
$oTpl -> set ( 's' , 'PLUS' , $expandimg );
2022-05-17 18:00:37 +00:00
/* * *********** */
2016-10-06 15:57:01 +00:00
/* SYNCSTUFF */
2022-05-17 18:00:37 +00:00
/* * *********** */
2016-10-06 15:57:01 +00:00
$languages = getLanguageNamesByClient ( $client );
2022-05-17 18:00:37 +00:00
$sListId = '' ;
2016-10-06 15:57:01 +00:00
if ( count ( $languages ) > 1 && $perm -> have_perm_area_action ( $area , " con_synccat " )) {
2022-05-17 18:00:37 +00:00
$sListId = 'sync' ;
$oListOptionRow = new cFoldingRow ( " 4808dbba-ed4a-4618-8e49-3a3635396e22 " , i18n ( " Synchronize from " ), $sListId );
if (( $syncoptions > 0 ) && ( $syncoptions != $lang )) {
$oListOptionRow -> setExpanded ( true );
}
2016-10-06 15:57:01 +00:00
#'dir="' . langGetTextDirection($lang) . '"');
$selectbox = new cHTMLSelectElement ( " syncoptions " );
2022-05-17 18:00:37 +00:00
$option = new cHTMLOptionElement ( " --- " . i18n ( " None " ) . " --- " , - 1 );
2016-10-06 15:57:01 +00:00
$selectbox -> addOptionElement ( - 1 , $option );
2022-05-17 18:00:37 +00:00
foreach ( $languages as $languageid => $languagename ) {
if ( $lang != $languageid && $perm -> have_perm_client_lang ( $client , $languageid )) {
$option = new cHTMLOptionElement ( $languagename . " ( " . $languageid . " ) " , $languageid );
$selectbox -> addOptionElement ( $languageid , $option );
}
2016-10-06 15:57:01 +00:00
}
2022-05-17 18:00:37 +00:00
2016-10-06 15:57:01 +00:00
$selectbox -> setDefault ( $syncoptions );
$form = new UI_Form ( " syncfrom " );
2022-05-17 18:00:37 +00:00
$form -> setVar ( " area " , $area );
2016-10-06 15:57:01 +00:00
$form -> setVar ( " frame " , $frame );
$form -> add ( " sel " , $selectbox -> render ());
2022-05-17 18:00:37 +00:00
$link = $sess -> url ( " main.php?area= " . $area . " &frame=2 " ) . '&syncoptions=' ;
$sJsLink = 'conMultiLink(\'left_bottom\', \'' . $link . '\'+document.getElementsByName(\'syncoptions\')[0].value+\'&refresh_syncoptions=true\');' ;
$oTpl -> set ( 's' , 'UPDATE_SYNC_REFRESH_FRAMES' , $sJsLink );
$form -> add ( " submit " , '<img style="vertical-align:middle; margin-left:5px;" onMouseover="this.style.cursor=\'pointer\'" onclick="updateCurLanguageSync();" src="' . $cfg [ " path " ][ " contenido_fullhtml " ] . $cfg [ 'path' ][ 'images' ] . 'submit.gif">' );
$sSyncButton = '<div id="sync_cat_single" style="display:none;"><a href="javascript:generateSyncAction(0);"><img style="vertical-align: middle;" src="images/but_sync_cat.gif" vspace="2" hspace="2" border="0" title="' . i18n ( " Copy to current language " ) . '" alt="' . i18n ( " Copy to current language " ) . '"></a>' ;
$sSyncButton .= '<a href="javascript:generateSyncAction(0);">' . i18n ( " Copy to current language " ) . '</a></div>' ;
$sSyncButtonMultiple = '<div id="sync_cat_multiple" style="display:none;"><a href="javascript:generateSyncAction(1);"><img style="vertical-align: middle;" src="images/but_sync_cat.gif" vspace="2" hspace="2" border="0" title="' . i18n ( " Also copy subcategories " ) . '" alt="' . i18n ( " Also copy subcategories " ) . '"></a>' ;
$sSyncButtonMultiple .= '<a href="javascript:generateSyncAction(1);">' . i18n ( " Also copy subcategories " ) . '</a></div>' ;
$content = '<table style="padding:3px; margin-left:12px; border-right: 1px solid #B3B3B3;" width="100%" border="0" dir="' . langGetTextDirection ( $lang ) . ' " >
2016-10-06 15:57:01 +00:00
< tr >
2022-05-17 18:00:37 +00:00
< td > ' . $form->render() . ' </ td >
2016-10-06 15:57:01 +00:00
</ tr >
< tr >
2022-05-17 18:00:37 +00:00
< td > ' . $sSyncButton . $sSyncButtonMultiple . ' </ td >
2016-10-06 15:57:01 +00:00
</ tr >
2022-05-17 18:00:37 +00:00
</ table > ' ;
2016-10-06 15:57:01 +00:00
$oListOptionRow -> setContentData ( $content );
2022-05-17 18:00:37 +00:00
$oTpl -> set ( 's' , 'SYNCRONIZATION' , $oListOptionRow -> render ());
2016-10-06 15:57:01 +00:00
$oTpl -> set ( 's' , 'SYNCLINK' , $sListId );
2022-05-17 18:00:37 +00:00
$sSyncLink = $sess -> url ( $selflink . " ?area= $area &frame=2&action=con_synccat " );
$oTpl -> set ( 's' , 'SYNC_HREF' , $sSyncLink );
2016-10-06 15:57:01 +00:00
} else {
2022-05-17 18:00:37 +00:00
$oTpl -> set ( 's' , 'SYNCRONIZATION' , '' );
$oTpl -> set ( 's' , 'SYNCLINK' , $sListId );
$oTpl -> set ( 's' , 'SYNC_HREF' , '' );
2016-10-06 15:57:01 +00:00
}
/*
* necessary for expanding / collapsing of navigation tree per javascript / AJAX ( I . van Peeren )
2022-05-17 18:00:37 +00:00
*/
2016-10-06 15:57:01 +00:00
$oTpl -> set ( 's' , 'AREA' , $area );
$oTpl -> set ( 's' , 'SESSION' , $contenido );
2022-05-17 18:00:37 +00:00
$oTpl -> set ( 's' , 'AJAXURL' , $cfg [ 'path' ][ 'contenido_fullhtml' ] . 'ajaxmain.php' );
2016-10-06 15:57:01 +00:00
##########################################
# Help
##########################################
$oTpl -> set ( 's' , 'HELPSCRIPT' , setHelpContext ( " con " ));
2022-05-17 18:00:37 +00:00
$oTpl -> generate ( $cfg [ 'path' ][ 'templates' ] . $cfg [ 'templates' ][ 'con_left_top' ]);