Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dolibarr
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Software_Artifact_Infrastructure_Repository
dolibarr
Commits
58345211
Commit
58345211
authored
7 years ago
by
Laurent Destailleur
Browse files
Options
Downloads
Patches
Plain Diff
Split editor in 2 (html source and wysiwyg)
parent
2a133f4a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
htdocs/langs/en_US/website.lang
+2
-1
2 additions, 1 deletion
htdocs/langs/en_US/website.lang
htdocs/websites/index.php
+27
-2
27 additions, 2 deletions
htdocs/websites/index.php
with
29 additions
and
3 deletions
htdocs/langs/en_US/website.lang
+
2
−
1
View file @
58345211
...
...
@@ -12,7 +12,8 @@ MediaFiles=Media library
EditCss=Edit Style/CSS
EditMenu=Edit menu
EditPageMeta=Edit Meta
EditPageContent=Edit Content
EditPageSource=Edit HTML Source
EditPageContent=Edit with CKEditor
Website=Web site
Webpage=Web page
AddPage=Add page
...
...
This diff is collapsed.
Click to expand it.
htdocs/websites/index.php
+
27
−
2
View file @
58345211
...
...
@@ -98,6 +98,7 @@ if (GETPOST('editcss')) { $action='editcss'; }
if
(
GETPOST
(
'editmenu'
))
{
$action
=
'editmenu'
;
}
if
(
GETPOST
(
'setashome'
))
{
$action
=
'setashome'
;
}
if
(
GETPOST
(
'editmeta'
))
{
$action
=
'editmeta'
;
}
if
(
GETPOST
(
'editsource'
))
{
$action
=
'editsource'
;
}
if
(
GETPOST
(
'editcontent'
))
{
$action
=
'editcontent'
;
}
if
(
empty
(
$action
))
$action
=
'preview'
;
...
...
@@ -665,6 +666,10 @@ if ($action == 'editmeta')
{
print
'<input type="hidden" name="action" value="updatemeta">'
;
}
if
(
$action
==
'editsource'
)
{
print
'<input type="hidden" name="action" value="updatesource">'
;
}
if
(
$action
==
'editcontent'
)
{
print
'<input type="hidden" name="action" value="updatecontent">'
;
...
...
@@ -677,7 +682,7 @@ if ($action == 'edit')
// Add a margin under toolbar ?
$style
=
''
;
if
(
$action
!=
'preview'
&&
$action
!=
'editcontent'
)
$style
=
' margin-bottom: 5px;'
;
if
(
$action
!=
'preview'
&&
$action
!=
'editcontent'
&&
$action
!=
'editsource'
)
$style
=
' margin-bottom: 5px;'
;
//var_dump($objectpage);exit;
print
'<div class="centpercent websitebar">'
;
...
...
@@ -835,6 +840,7 @@ if (count($object->records) > 0)
if
(
$object
->
fk_default_home
>
0
&&
$pageid
==
$object
->
fk_default_home
)
print
'<input type="submit" class="button" disabled="disabled" value="'
.
dol_escape_htmltag
(
$langs
->
trans
(
"SetAsHomePage"
))
.
'" name="setashome">'
;
else
print
'<input type="submit" class="button"'
.
$disabled
.
' value="'
.
dol_escape_htmltag
(
$langs
->
trans
(
"SetAsHomePage"
))
.
'" name="setashome">'
;
print
'<input type="submit" class="button"'
.
$disabled
.
' value="'
.
dol_escape_htmltag
(
$langs
->
trans
(
"EditPageMeta"
))
.
'" name="editmeta">'
;
print
'<input type="submit" class="button"'
.
$disabled
.
' value="'
.
dol_escape_htmltag
(
$langs
->
trans
(
"EditPageSource"
))
.
'" name="editsource">'
;
print
'<input type="submit" class="button"'
.
$disabled
.
' value="'
.
dol_escape_htmltag
(
$langs
->
trans
(
"EditPageContent"
))
.
'" name="editcontent">'
;
//print '<a href="'.$_SERVER["PHP_SELF"].'?action=editmeta&website='.urlencode($website).'&pageid='.urlencode($pageid).'" class="button">'.dol_escape_htmltag($langs->trans("EditPageMeta")).'</a>';
//print '<a href="'.$_SERVER["PHP_SELF"].'?action=editcontent&website='.urlencode($website).'&pageid='.urlencode($pageid).'" class="button">'.dol_escape_htmltag($langs->trans("EditPageContent")).'</a>';
...
...
@@ -891,7 +897,7 @@ if (count($object->records) > 0)
print
'</div>'
;
print
'<div class="websitehelp">'
;
if
(
GETPOST
(
'editcontent'
,
'alpha'
))
if
(
GETPOST
(
'editsource'
,
'alpha'
)
||
GETPOST
(
'editcontent'
,
'alpha'
))
{
$htmltext
=
$langs
->
transnoentitiesnoconv
(
"YouCanEditHtmlSource"
);
print
$form
->
textwithpicto
(
$langs
->
trans
(
"SyntaxHelp"
),
$htmltext
,
1
,
'help'
,
'inline-block'
,
0
,
2
,
'tooltipsubstitution'
);
...
...
@@ -1083,6 +1089,25 @@ if ($action == 'editmenu')
print
'<div class="center">'
.
$langs
->
trans
(
"FeatureNotYetAvailable"
)
.
'</center>'
;
}
if
(
$action
==
'editsource'
)
{
/*
* Editing global variables not related to a specific theme
*/
$csscontent
=
@
file_get_contents
(
$filecss
);
$contentforedit
=
''
;
/*$contentforedit.='<style scoped>'."\n"; // "scoped" means "apply to parent element only". Not yet supported by browsers
$contentforedit.=$csscontent;
$contentforedit.='</style>'."\n";*/
$contentforedit
.
=
$objectpage
->
content
;
require_once
DOL_DOCUMENT_ROOT
.
'/core/class/doleditor.class.php'
;
$doleditor
=
new
DolEditor
(
'PAGE_CONTENT'
,
$contentforedit
,
''
,
500
,
'Full'
,
''
,
true
,
true
,
true
,
ROWS_5
,
'90%'
);
$doleditor
->
Create
(
0
,
''
,
false
);
}
if
(
$action
==
'editcontent'
)
{
/*
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment