|
|
@ -40,9 +40,7 @@ function home_tabs($file_logged_in) |
|
|
|
fputs($fp, implode("\n", $data_logged_in)); |
|
|
|
fputs($fp, implode("\n", $data_logged_in)); |
|
|
|
fclose($fp); |
|
|
|
fclose($fp); |
|
|
|
} |
|
|
|
} |
|
|
|
/** |
|
|
|
|
|
|
|
* Code |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
$language_file = array('index','admin', 'accessibility'); |
|
|
|
$language_file = array('index','admin', 'accessibility'); |
|
|
|
$cidReset = true; |
|
|
|
$cidReset = true; |
|
|
|
require_once '../inc/global.inc.php'; |
|
|
|
require_once '../inc/global.inc.php'; |
|
|
@ -229,18 +227,18 @@ if (!empty($action)) { |
|
|
|
fputs($fp, $home_top); |
|
|
|
fputs($fp, $home_top); |
|
|
|
fclose($fp); |
|
|
|
fclose($fp); |
|
|
|
|
|
|
|
|
|
|
|
foreach ($_languages['name'] as $key => $value) { |
|
|
|
foreach ($_languages['name'] as $key => $value) { |
|
|
|
$lang_name = $_languages['folder'][$key]; |
|
|
|
$lang_name = $_languages['folder'][$key]; |
|
|
|
if (isset($_POST[$lang_name])) { |
|
|
|
if (isset($_POST[$lang_name])) { |
|
|
|
if (file_exists($homep.$topf.'_'.$lang_name.$ext)) { |
|
|
|
if (file_exists($homep.$topf.'_'.$lang_name.$ext)) { |
|
|
|
if (is_writable($homep.$topf.'_'.$lang_name.$ext)) { |
|
|
|
if (is_writable($homep.$topf.'_'.$lang_name.$ext)) { |
|
|
|
$fp = fopen($homep.$topf.'_'.$lang_name.$ext, 'w'); |
|
|
|
$fp = fopen($homep.$topf.'_'.$lang_name.$ext, 'w'); |
|
|
|
fputs($fp, $home_top); |
|
|
|
fputs($fp, $home_top); |
|
|
|
fclose($fp); |
|
|
|
fclose($fp); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
} else { |
|
|
|
$errorMsg = get_lang('HomePageFilesNotWritable'); |
|
|
|
$errorMsg = get_lang('HomePageFilesNotWritable'); |
|
|
@ -251,18 +249,17 @@ if (!empty($action)) { |
|
|
|
fputs($fp, $home_top); |
|
|
|
fputs($fp, $home_top); |
|
|
|
fclose($fp); |
|
|
|
fclose($fp); |
|
|
|
|
|
|
|
|
|
|
|
foreach ($_languages['name'] as $key => $value) { |
|
|
|
foreach ($_languages['name'] as $key => $value) { |
|
|
|
$lang_name = $_languages['folder'][$key]; |
|
|
|
$lang_name = $_languages['folder'][$key]; |
|
|
|
if (isset($_POST[$lang_name])) { |
|
|
|
if (isset($_POST[$lang_name])) { |
|
|
|
if (file_exists($homep.$topf.'_'.$lang_name.$ext)) { |
|
|
|
if (file_exists($homep.$topf.'_'.$lang_name.$ext)) { |
|
|
|
$fp = fopen($homep.$topf.'_'.$lang_name.$ext, 'w'); |
|
|
|
$fp = fopen($homep.$topf.'_'.$lang_name.$ext, 'w'); |
|
|
|
fputs($fp, $home_top); |
|
|
|
fputs($fp, $home_top); |
|
|
|
fclose($fp); |
|
|
|
fclose($fp); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (EventsMail::check_if_using_class('portal_homepage_edited')) { |
|
|
|
if (EventsMail::check_if_using_class('portal_homepage_edited')) { |
|
|
|
EventsDispatcher::events('portal_homepage_edited',array('about_user' => api_get_user_id())); |
|
|
|
EventsDispatcher::events('portal_homepage_edited',array('about_user' => api_get_user_id())); |
|
|
@ -283,34 +280,32 @@ if (!empty($action)) { |
|
|
|
if ($errorMsg == '') { |
|
|
|
if ($errorMsg == '') { |
|
|
|
fputs($fp, "<b>$notice_title</b><br />\n$notice_text"); |
|
|
|
fputs($fp, "<b>$notice_title</b><br />\n$notice_text"); |
|
|
|
|
|
|
|
|
|
|
|
foreach ($_languages['name'] as $key => $value) { |
|
|
|
foreach ($_languages['name'] as $key => $value) { |
|
|
|
$lang_name = $_languages['folder'][$key]; |
|
|
|
$lang_name = $_languages['folder'][$key]; |
|
|
|
if (isset($_POST[$lang_name])) { |
|
|
|
if (isset($_POST[$lang_name])) { |
|
|
|
if (file_exists($homep.$noticef.'_'.$lang_name.$ext)) { |
|
|
|
if (file_exists($homep.$noticef.'_'.$lang_name.$ext)) { |
|
|
|
if (is_writable($homep.$noticef.'_'.$lang_name.$ext)) { |
|
|
|
if (is_writable($homep.$noticef.'_'.$lang_name.$ext)) { |
|
|
|
$fp = fopen($homep.$noticef.'_'.$lang_name.$ext, 'w'); |
|
|
|
$fp = fopen($homep.$noticef.'_'.$lang_name.$ext, 'w'); |
|
|
|
fputs($fp, "<b>$notice_title</b><br />\n$notice_text"); |
|
|
|
fputs($fp, "<b>$notice_title</b><br />\n$notice_text"); |
|
|
|
fclose($fp); |
|
|
|
fclose($fp); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} else { |
|
|
|
} else { |
|
|
|
|
|
|
|
fputs($fp, ''); |
|
|
|
fputs($fp, ''); |
|
|
|
|
|
|
|
|
|
|
|
foreach ($_languages['name'] as $key => $value) { |
|
|
|
foreach ($_languages['name'] as $key => $value) { |
|
|
|
$lang_name = $_languages['folder'][$key]; |
|
|
|
$lang_name = $_languages['folder'][$key]; |
|
|
|
if (isset($_POST[$lang_name])) { |
|
|
|
if (isset($_POST[$lang_name])) { |
|
|
|
if (file_exists($homep.$noticef.'_'.$lang_name.$ext)) { |
|
|
|
if (file_exists($homep.$noticef.'_'.$lang_name.$ext)) { |
|
|
|
$fp1 = fopen($homep.$noticef.'_'.$lang_name.$ext, 'w'); |
|
|
|
$fp1 = fopen($homep.$noticef.'_'.$lang_name.$ext, 'w'); |
|
|
|
fputs($fp1, ''); |
|
|
|
fputs($fp1, ''); |
|
|
|
fclose($fp1); |
|
|
|
fclose($fp1); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
fclose($fp); |
|
|
|
fclose($fp); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
$errorMsg .= "<br/>\n".get_lang('HomePageFilesNotWritable'); |
|
|
|
$errorMsg .= "<br/>\n".get_lang('HomePageFilesNotWritable'); |
|
|
@ -478,8 +473,6 @@ if (!empty($action)) { |
|
|
|
break; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$home_menu[$insert_where + 1] = '<li '.$class_add_in_tab.'><a href="'.$link_url.'" target="'.($target_blank ? '_blank' : '_self').'"><span>'.$link_name.'</span></a></li>'; |
|
|
|
$home_menu[$insert_where + 1] = '<li '.$class_add_in_tab.'><a href="'.$link_url.'" target="'.($target_blank ? '_blank' : '_self').'"><span>'.$link_name.'</span></a></li>'; |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
// If the request is about a link edition, change the link |
|
|
|
// If the request is about a link edition, change the link |
|
|
@ -495,15 +488,15 @@ if (!empty($action)) { |
|
|
|
home_tabs($homep.$menuf.'_'.$lang.$ext); |
|
|
|
home_tabs($homep.$menuf.'_'.$lang.$ext); |
|
|
|
fclose($fp); |
|
|
|
fclose($fp); |
|
|
|
|
|
|
|
|
|
|
|
foreach ($_languages['name'] as $key => $value) { |
|
|
|
foreach ($_languages['name'] as $key => $value) { |
|
|
|
$lang_name = $_languages['folder'][$key]; |
|
|
|
$lang_name = $_languages['folder'][$key]; |
|
|
|
if (isset($_POST[$lang_name])) { |
|
|
|
if (isset($_POST[$lang_name])) { |
|
|
|
$fp = fopen($homep.$menuf.'_'.$lang_name.$ext, 'w'); |
|
|
|
$fp = fopen($homep.$menuf.'_'.$lang_name.$ext, 'w'); |
|
|
|
fputs($fp, $home_menu); |
|
|
|
fputs($fp, $home_menu); |
|
|
|
home_tabs($homep.$menuf.'_'.$lang_name.$ext); |
|
|
|
home_tabs($homep.$menuf.'_'.$lang_name.$ext); |
|
|
|
fclose($fp); |
|
|
|
fclose($fp); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (file_exists($homep.$menuf.$ext)) { |
|
|
|
if (file_exists($homep.$menuf.$ext)) { |
|
|
|
if (is_writable($homep.$menuf.$ext)) { |
|
|
|
if (is_writable($homep.$menuf.$ext)) { |
|
|
@ -523,16 +516,16 @@ if (!empty($action)) { |
|
|
|
home_tabs($homep.$menuf.'_'.$lang.$ext); |
|
|
|
home_tabs($homep.$menuf.'_'.$lang.$ext); |
|
|
|
fclose($fp); |
|
|
|
fclose($fp); |
|
|
|
|
|
|
|
|
|
|
|
foreach ($_languages['name'] as $key => $value) { |
|
|
|
foreach ($_languages['name'] as $key => $value) { |
|
|
|
$lang_name = $_languages['folder'][$key]; |
|
|
|
$lang_name = $_languages['folder'][$key]; |
|
|
|
if (isset($_POST[$lang_name])) { |
|
|
|
if (isset($_POST[$lang_name])) { |
|
|
|
$fp = fopen($homep.$menuf.'_'.$lang_name.$ext, 'w'); |
|
|
|
$fp = fopen($homep.$menuf.'_'.$lang_name.$ext, 'w'); |
|
|
|
fputs($fp, $home_menu); |
|
|
|
fputs($fp, $home_menu); |
|
|
|
home_tabs($homep.$menuf.'_'.$lang_name.$ext); |
|
|
|
home_tabs($homep.$menuf.'_'.$lang_name.$ext); |
|
|
|
fclose($fp); |
|
|
|
fclose($fp); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
event_system(LOG_HOMEPAGE_CHANGED, $action, cut($link_name.':'.$link_url, 254), api_get_utc_datetime(), api_get_user_id()); |
|
|
|
event_system(LOG_HOMEPAGE_CHANGED, $action, cut($link_name.':'.$link_url, 254), api_get_utc_datetime(), api_get_user_id()); |
|
|
|
break; |
|
|
|
break; |
|
|
@ -885,21 +878,21 @@ switch ($action) { |
|
|
|
$form->add_html_editor('link_html', get_lang('Content'), false, false, array('ToolbarSet' => 'PortalHomePage', 'Width' => '100%', 'Height' => '400')); |
|
|
|
$form->add_html_editor('link_html', get_lang('Content'), false, false, array('ToolbarSet' => 'PortalHomePage', 'Width' => '100%', 'Height' => '400')); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
$form->addElement('checkbox', 'all_langs', null, get_lang('ApplyAllLanguages'), array('id' => 'all_langs')); |
|
|
|
$form->addElement('checkbox', 'all_langs', null, get_lang('ApplyAllLanguages'), array('id' => 'all_langs')); |
|
|
|
$form->addElement('html','<table id="table_langs" style="margin-left:159px;"><tr>'); |
|
|
|
$form->addElement('html','<table id="table_langs" style="margin-left:159px;"><tr>'); |
|
|
|
$i = 0; |
|
|
|
$i = 0; |
|
|
|
foreach ($_languages['name'] as $key => $value) { |
|
|
|
foreach ($_languages['name'] as $key => $value) { |
|
|
|
$i++; |
|
|
|
$i++; |
|
|
|
$lang_name = $_languages['folder'][$key]; |
|
|
|
$lang_name = $_languages['folder'][$key]; |
|
|
|
$html_langs = '<td width="300">'; |
|
|
|
$html_langs = '<td width="300">'; |
|
|
|
$html_langs .= '<label><input type="checkbox" id="lang" name="'.$lang_name.'" /> '.$lang_name.'<label/>'; |
|
|
|
$html_langs .= '<label><input type="checkbox" id="lang" name="'.$lang_name.'" /> '.$lang_name.'<label/>'; |
|
|
|
$html_langs .= '</td>'; |
|
|
|
$html_langs .= '</td>'; |
|
|
|
if ($i%5 == 0) { |
|
|
|
if ($i%5 == 0) { |
|
|
|
$html_langs .= '</tr><tr>'; |
|
|
|
$html_langs .= '</tr><tr>'; |
|
|
|
} |
|
|
|
} |
|
|
|
$form->addElement('html', $html_langs); |
|
|
|
$form->addElement('html', $html_langs); |
|
|
|
} |
|
|
|
} |
|
|
|
$form->addElement('html','</tr></table><br/>'); |
|
|
|
$form->addElement('html','</tr></table><br/>'); |
|
|
|
$form->addElement('style_submit_button', null, get_lang('Save'), 'class="save"'); |
|
|
|
$form->addElement('style_submit_button', null, get_lang('Save'), 'class="save"'); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -931,7 +924,7 @@ switch ($action) { |
|
|
|
$renderer->setRequiredNoteTemplate(''); |
|
|
|
$renderer->setRequiredNoteTemplate(''); |
|
|
|
$form->addElement('hidden', 'formSent', '1'); |
|
|
|
$form->addElement('hidden', 'formSent', '1'); |
|
|
|
|
|
|
|
|
|
|
|
if ($action == 'edit_news'){ |
|
|
|
if ($action == 'edit_news') { |
|
|
|
$_languages = api_get_languages(); |
|
|
|
$_languages = api_get_languages(); |
|
|
|
$html = '<tr><td>'.get_lang('ChooseNewsLanguage').' : '; |
|
|
|
$html = '<tr><td>'.get_lang('ChooseNewsLanguage').' : '; |
|
|
|
$html .= '<select name="news_languages">'; |
|
|
|
$html .= '<select name="news_languages">'; |
|
|
@ -958,24 +951,23 @@ switch ($action) { |
|
|
|
$default[$name] = str_replace('{rel_path}', api_get_path(REL_PATH), $open); |
|
|
|
$default[$name] = str_replace('{rel_path}', api_get_path(REL_PATH), $open); |
|
|
|
$form->add_html_editor($name, '', true, false, array('ToolbarSet' => 'PortalHomePage', 'Width' => '100%', 'Height' => '400')); |
|
|
|
$form->add_html_editor($name, '', true, false, array('ToolbarSet' => 'PortalHomePage', 'Width' => '100%', 'Height' => '400')); |
|
|
|
} |
|
|
|
} |
|
|
|
$form->addElement('checkbox', 'all_langs', null, get_lang('ApplyAllLanguages'),array('id' => 'all_langs')); |
|
|
|
$form->addElement('checkbox', 'all_langs', null, get_lang('ApplyAllLanguages'),array('id' => 'all_langs')); |
|
|
|
$form->addElement('html','<table id="table_langs" style="margin-left:5px;"><tr>'); |
|
|
|
$form->addElement('html','<table id="table_langs" style="margin-left:5px;"><tr>'); |
|
|
|
$i = 0; |
|
|
|
$i = 0; |
|
|
|
foreach ($_languages['name'] as $key => $value) { |
|
|
|
foreach ($_languages['name'] as $key => $value) { |
|
|
|
$i++; |
|
|
|
$i++; |
|
|
|
$lang_name = $_languages['folder'][$key]; |
|
|
|
$lang_name = $_languages['folder'][$key]; |
|
|
|
if (file_exists($homep.$topf.'_'.$lang_name.$ext)) { |
|
|
|
if (file_exists($homep.$topf.'_'.$lang_name.$ext)) { |
|
|
|
$html_langs = '<td width="300">'; |
|
|
|
$html_langs = '<td width="300">'; |
|
|
|
$html_langs .= '<label><input type="checkbox" id="lang" name="'.$lang_name.'" /> '.$lang_name.'<label/>'; |
|
|
|
$html_langs .= '<label><input type="checkbox" id="lang" name="'.$lang_name.'" /> '.$lang_name.'<label/>'; |
|
|
|
$html_langs .= '</td>'; |
|
|
|
$html_langs .= '</td>'; |
|
|
|
if($i%5 == 0) { |
|
|
|
if($i%5 == 0) { |
|
|
|
$html_langs .= '</tr><tr>'; |
|
|
|
$html_langs .= '</tr><tr>'; |
|
|
|
} |
|
|
|
} |
|
|
|
$form->addElement('html', $html_langs); |
|
|
|
$form->addElement('html', $html_langs); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
$form->addElement('html','</tr></table><br/>'); |
|
|
|
$form->addElement('html','</tr></table><br/>'); |
|
|
|
|
|
|
|
$form->addElement('style_submit_button', null, get_lang('Save'), 'class="save"'); |
|
|
|
$form->addElement('style_submit_button', null, get_lang('Save'), 'class="save"'); |
|
|
|
$form->setDefaults($default); |
|
|
|
$form->setDefaults($default); |
|
|
|
$form->display(); |
|
|
|
$form->display(); |
|
|
@ -1151,12 +1143,9 @@ switch ($action) { |
|
|
|
echo '</div>'; |
|
|
|
echo '</div>'; |
|
|
|
?> |
|
|
|
?> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="well sidebar-nav"> |
|
|
|
<div class="well sidebar-nav"> |
|
|
|
<a href="<?php echo api_get_self(); ?>?action=insert_link"><?php Display::display_icon('addd.gif', get_lang('InsertLink')); ?></a>
|
|
|
|
<a href="<?php echo api_get_self(); ?>?action=insert_link"><?php Display::display_icon('addd.gif', get_lang('InsertLink')); ?></a>
|
|
|
|
<a href="<?php echo api_get_self(); ?>?action=insert_link"><?php echo get_lang('InsertLink'); ?></a>
|
|
|
|
<a href="<?php echo api_get_self(); ?>?action=insert_link"><?php echo get_lang('InsertLink'); ?></a>
|
|
|
|
|
|
|
|
|
|
|
|
<h4><?php echo api_ucfirst(get_lang('General')); ?></h4>
|
|
|
|
<h4><?php echo api_ucfirst(get_lang('General')); ?></h4>
|
|
|
|
<ul class="menulist"> |
|
|
|
<ul class="menulist"> |
|
|
|
<?php |
|
|
|
<?php |
|
|
@ -1187,7 +1176,6 @@ switch ($action) { |
|
|
|
?> |
|
|
|
?> |
|
|
|
</ul> |
|
|
|
</ul> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
</td> |
|
|
|
</td> |
|
|
|
</tr> |
|
|
|
</tr> |
|
|
|
</table> |
|
|
|
</table> |
|
|
|