<?php
function x_50($x_1r) { 
$x_51 = '/[\/:\*\?"<>\|]/'; 
if (preg_match( $x_51, $x_1r, $x_52)) { 
return false; 
} else { 
return true; 
} 
} 
function x_2d($x_21, $x_2b) { 
global $x_d; 
$x_n = $x_d->getUserBookmarks(&$x_27); 
$x_53 = 1; 
$x_54 = 0; 
if (!x_50($x_2b['path'])) 
return 'badChar'; 
else 
foreach ($x_27 as $x_55 => $x_56) 
if (count(array_diff_assoc($x_21, $x_56))!=0 && 
($x_2b['path'] == $x_56['path'] || 
($x_2b['description'] == $x_56['description'] && strlen(trim($x_2b['description']))!=0) 
) ) 
$x_54 = 1; 
elseif (count(array_diff_assoc($x_56, $x_21))==0) { 
$x_53 = 0; 
$x_27[$x_55] = $x_2b; 
} 
if ($x_54 == 1) 
return 'dupKey'; 
elseif ($x_53 == 1) 
return 'noKey'; 
if ($x_53 == 1) 
return 'noKey'; 
else { 
$x_57 = $x_d->setUserBookmarks($x_27); 
$x_d->commitUserData(); 
return 'ok'; 
} 
} 
function x_29($x_21) { 
global $x_d; 
$x_n = $x_d->getUserBookmarks(&$x_27); 
$x_53 = 1; 
while (list($x_55, $x_56) = each ($x_27)) 
if (count(array_diff_assoc($x_56, $x_21))==0) { 
$x_53 = 0; 
unset($x_27[$x_55]); 
} 
if ($x_53 == 1) 
return 'noKey'; 
else { 
$x_57 = $x_d->setUserBookmarks($x_27); 
$x_d->commitUserData(); 
return 'ok'; 
} 
} 
function x_25($x_21) { 
global $x_d; 
$x_n = $x_d->getUserBookmarks(&$x_27); 
$x_54 = 0; 
if (!x_50($x_21['path'])) 
return 'badChar'; 
else 
foreach ($x_27 as $x_55 => $x_56) 
if ($x_21['path'] == $x_56['path'] || ($x_21['description'] == $x_56['description'] && strlen(trim($x_21['description']))!=0)) 
$x_54 = 1; 
if ($x_54 == 1) 
return 'dupKey'; 
else { 
$x_27[] = $x_21; 
$x_57 = $x_d->setUserBookmarks($x_27); 
$x_d->commitUserData(); 
return 'ok'; 
} 
} 
function x_2g($x_2h) { 
global $x_d; 
$x_n = $x_d->getUserBookmarks(&$x_27); 
foreach ($x_27 as $x_1w => $x_58) 
if (strlen(trim($x_58['description'])) != 0 ) 
$x_59[$x_1w] = $x_58['description']; 
else 
$x_59[$x_1w] = $x_58['path']; 
if (count($x_59) != 0) { 
kerio_sort($x_2h, $x_59); 
foreach ($x_59 as $x_1w => $x_58) 
$x_5a[] = $x_27[$x_1w]; 
$x_57 = $x_d->setUserBookmarks($x_5a); 
} 
} 
function x_5b($x_27, $x_1r) { 
settype ($x_5c, 'array'); 
if (count($x_27)!=0) 
foreach ($x_27 as $x_21) 
if ($x_21['path'] == $x_1r) 
$x_5c = $x_21; 
return $x_5c; 
} 
function x_2n($x_2i, $x_5d=0) { 
global $x_d; 
$x_4n = '<form id="browserForm" action="" target="KerioSSLVPNActionWindow" method="POST">' 
.'<table id="browserTable" cellpadding="0" cellspacing="0" style="width:100%;">' 
.'<tr class="browserHeader">


					<td class="upGrey browseHead checkCol">


						<input id="mainBox" name="entryAll" type="checkbox" value="1" title="'.'<kerio:text id="browse_seldesel_all"/>'.'" onClick="x_5e(\'all\', \'mainBox\')">


					</td>


					<td colspan="3" class="upGrey browseHead">'."<kerio:text id='bookmarks_user_def'/>".'</td>


			</tr>'; 
if (count($x_2i) == 0) 
$x_4n .= '<tr><td colspan="4" width="320" style="text-align:center;">'."<kerio:text id='bookmarks_no_book'/>".'</td></tr>'; 
else { 
$x_5f=1; 
foreach ($x_2i as $x_5g => $x_21) { 
$x_d -> getUrlForPath($x_21['path'], &$x_f); 
$x_5h = 'onClick=" x_5i(\'' 
. addslashes('/browse' . $x_f) 
. '\');" onDblClick="x_5i(\'' 
. addslashes('/browse' . $x_f) 
. '\');"'; 
$x_4n .= '<tr class="browserRow'.($x_5f%2==0 ? ' oddrow' : '') 
. ' "title="' . (strlen($x_21['description']) != 0 ? 
$x_21['description'] . ' - ' . $x_21['path'] : $x_21['path']) . '">' 
. '<td class="checkCol">' 
.'<input id="' 
. $x_5g 
. '" name="bookmarks[]" type="checkbox" value="' 
. $x_21['path'] 
. '" onClick="x_5e(\'\',\'' 
. $x_5g 
. '\')">' 
.'</td>' 
.'<td class="bookmarkPath"' . $x_5h . '>' 
. x_5j('', $x_21['path']) 
. '</td>' 
.'<td  class="bookmarkDesc"' . $x_5h . '>' 
. x_5j($x_21['description'], '') 
. '</td>' 
. '</tr>'; 
$x_5f++; 
} 
} 
$x_4n .= '</table></form>'; 
return $x_4n; 
} 
function x_5j($x_1r, $x_5k) { 
$x_4n = ''; 
if ($x_5k != '') { 
$x_4n = str_replace('&amp;', '&', $x_5k); 
} else { 
$x_4n = $x_1r; 
} 
return htmlspecialchars($x_4n); 
} 
function x_2p() { 
global $x_d; 
$x_d -> getUserVariable('toolBar', &$x_5l); 
if (!$x_5l || $x_5l=='none') { 
$x_5m = 'none'; 
$x_5n = 'close'; 
} else { 
$x_5m = 'block'; 
$x_5n = 'open'; 
} 
$x_5o = Array(); 
$x_5p = 'TBitemRenameActive'; 
$x_5o['renameTableActive'] = '<div id="renameTableActiveDiv" style="display: none;">'; 
$x_5o['renameTableActive'] .= '<table id="renameTableActive" cellpadding="1" cellspacing="0">


				<tr id="'.$x_5p.'" title="<kerio:text id="title_edit_bookmark"/>" onClick="x_39(\'bookmarkEdit\')" class="toolBarItem" '.x_5q($x_5p).'>


					<td class="renameActive"><kerio:text id="edit"/></td>


				</tr>


			</table>'; 
$x_5o['renameTableActive'] .= '</div>'; 
$x_5p = 'TBitemDeleteActive'; 
$x_5o['actionsTableActive'] = '<div id="actionsTableActiveDiv" style="display: none;">'; 
$x_5o['actionsTableActive'] .= '<table id="actionsTableActive" cellpadding="1" cellspacing="0">


				<tr id="'.$x_5p.'" title="<kerio:text id="title_delete_bookmarks"/>" onClick="x_39(\'bookmarkDelete\')" class="toolBarItem" '.x_5q($x_5p).'>


					<td class="deleteActive"><kerio:text id="delete"/></td>


				</tr>


			</table>'; 
$x_5o['actionsTableActive'] .= '</div>'; 
$x_5p = 'TBitemInsertActive'; 
$x_5o['creationTableActive'] = '<div id="creationTableActiveDiv" style="display: block;">'; 
$x_5o['creationTableActive'] .= '<table id="creationTableActive" cellpadding="1" cellspacing="0">


				<tr id="'.$x_5p.'" title="<kerio:text id="title_insert_bookmark"/>" onClick="x_39(\'bookmarkInsert\')" class="toolBarItem" '.x_5q($x_5p).'>


					<td class="bookmarkAddActive"><kerio:text id="bookmarks_insert"/></td>


				</tr>


			</table>'; 
$x_5o['creationTableActive'] .= '</div>'; 
$x_5p = 'TBitemRenameDisabled'; 
$x_5o['renameTableDisabled'] = '<div id="renameTableDisabledDiv" style="display: block;">'; 
$x_5o['renameTableDisabled'] .= '<table id="renameTableDisabled" cellpadding="1" cellspacing="0">


				<tr id="'.$x_5p.'" title="<kerio:text id="title_edit_bookmark"/>" '.x_5q($x_5p).'>


					<td class="renameDisabled itemDisabled"><kerio:text id="edit"/></td>


				</tr>


			</table>'; 
$x_5o['renameTableDisabled'] .= '</div>'; 
$x_5p = 'TBitemDeleteDisabled'; 
$x_5o['actionsTableDisabled'] = '<div id="actionsTableDisabledDiv" style="display: block;">'; 
$x_5o['actionsTableDisabled'] .= '<table id="actionsTableDisabled" cellpadding="1" cellspacing="0">


				<tr id="'.$x_5p.'" title="<kerio:text id="title_delete_bookmarks"/>" '.x_5q($x_5p).'>


					<td class="deleteDisabled itemDisabled"><kerio:text id="delete"/></td>


				</tr>


			</table>'; 
$x_5o['actionsTableDisabled'] .= '</div>'; 
$x_4n = '<div id="tasksMenu" style="padding-left: 10px;">' 
.$x_5o['renameTableDisabled'] 
.$x_5o['renameTableActive'] 
.$x_5o['actionsTableDisabled'] 
.$x_5o['actionsTableActive'] 
.$x_5o['creationTableActive'] 
.'</div>'; 
return Array('content' => $x_4n,'display' => $x_5m, 'imgStatus' => $x_5n); 
} 
?>
