Skip to content
This repository was archived by the owner on Sep 10, 2021. It is now read-only.

Commit ebaf8bf

Browse files
author
Charles Marion
committed
0009696: Remove echo and put REAL html
1 parent ce57f3d commit ebaf8bf

File tree

1 file changed

+60
-50
lines changed

1 file changed

+60
-50
lines changed

core/views/share/dialog.phtml

Lines changed: 60 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -13,37 +13,40 @@ echo '<script type="text/javascript" src="' . $this->coreWebroot . '/public/js/s
1313
?>
1414
<link href="<?php echo $this->coreWebroot?>/public/css/share/share.dialog.css?<?php echo time();?> " rel="stylesheet" type="text/css" />
1515

16-
<?php
17-
echo "<div id='elementDirectLink' ".(($this->private)?'style="display:none;"':'').">";
18-
echo $this->t('You can use the following direct link to share the').' '.$this->t($this->type).':<br/>';
19-
echo "<input type='text' id='urlInput' readonly='readonly' value='{$this->shareUrl}' />";
20-
echo "</div>";
21-
echo "<br/>";
2216

23-
echo "<div id='permissionsContent'>";
24-
echo " <div id='permissionPublic' ".(($this->private)?'style="display:none;"':'').">";
25-
echo " <b>{$this->t('Public')}</b> {$this->t('Anyone can find and access. No sign-in required.')}";
26-
echo " <a id='setElementPrivateLink'>{$this->t('You can set the permission as private.')}</a>";
27-
echo " </div>";
17+
<div id='elementDirectLink' <?php echo (($this->private)?'style="display:none;"':'');?>>";
18+
<?php echo $this->t('You can use the following direct link to share the').' '.$this->t($this->type)?>:<br/>';
19+
<input type='text' id='urlInput' readonly='readonly' value='{$this->shareUrl}' />
20+
</div>
21+
<br/>
22+
23+
<div id='permissionsContent'>
24+
<div id='permissionPublic' <?php echo (($this->private)?'style="display:none;"':'')?>>
25+
<b><?php echo $this->t('Public')?></b> <?php echo $this->t('Anyone can find and access. No sign-in required.')?>
26+
<a id='setElementPrivateLink'><?php echo $this->t('You can set the permission as private.')?></a>
27+
</div>
2828

29-
echo " <div id='permissionPrivate' ".((!$this->private)?'style="display:none;"':'').">";
30-
echo " <b>{$this->t('Private')}</b> {$this->t('Only people explicitly granted permission can access. Sign-in required.')}";
31-
echo " <a id='setElementPublicLink'>{$this->t('You can set the permission as public.')}</a>";
32-
echo " </div>";
29+
<div id='permissionPrivate' <?php echo ((!$this->private)?'style="display:none;"':'')?>>
30+
<b><?php echo $this->t('Private')?></b> <?php echo $this->t('Only people explicitly granted permission can access. Sign-in required.')?>
31+
<a id='setElementPublicLink'><?php echo $this->t('You can set the permission as public.')?></a>
32+
</div>
3333

34-
echo " <h4>".$this->t('Permissions')."</h4>";
35-
echo " <div id='permissionEntity'>";
36-
echo " <table>";
34+
<h4><?php echo $this->t('Permissions')?></h4>
35+
<div id='permissionEntity'>
36+
<table>
37+
<?php
3738
foreach($this->groupPolicies as $policy)
3839
{
39-
echo " <tr type='group' element='{$policy->group->getKey()}'>";
40-
echo " <td>";
41-
echo " <img src='{$this->coreWebroot}/public/images/icons/community.png'";
42-
echo " </td>";
43-
echo " <td class='changePermissionSelect'>";
44-
echo " ".(($policy->communityMemberGroup)?$policy->group->getCommunity()->getName():$policy->group->getName());
45-
echo " </td>";
46-
echo " <td>";
40+
?>
41+
<tr type='group' element='<?php echo $policy->group->getKey()?>'>
42+
<td>
43+
<img src='<?php echo $this->coreWebroot?>/public/images/icons/community.png'/>
44+
</td>
45+
<td class='changePermissionSelect'>
46+
<?php echo (($policy->communityMemberGroup)?$policy->group->getCommunity()->getName():$policy->group->getName())?>
47+
</td>
48+
<td>
49+
<?php
4750
if((!$this->isAdmin&&$policy->getPolicy()==MIDAS_POLICY_ADMIN))
4851
{
4952
switch ($policy->getPolicy())
@@ -60,7 +63,9 @@ foreach($this->groupPolicies as $policy)
6063
}
6164
else
6265
{
63-
echo " <select class='changePermissionSelect'>";
66+
?>
67+
<select class='changePermissionSelect'>
68+
<?php
6469
if($this->isAdmin)
6570
{
6671
echo " <option value='".MIDAS_POLICY_ADMIN."' ".(($policy->getPolicy()==MIDAS_POLICY_ADMIN)?'selected':'').">{$this->t('is owner')}</option>";
@@ -69,23 +74,27 @@ foreach($this->groupPolicies as $policy)
6974
echo " <option value='".MIDAS_POLICY_READ."' ".(($policy->getPolicy()==MIDAS_POLICY_READ)?'selected':'').">{$this->t('can read')}</option>";
7075
echo " </select>";
7176
}
72-
echo " </td>";
73-
echo " <td>";
74-
echo " <a class='removeShareLink'><img src='{$this->coreWebroot}/public/images/icons/close.png' alt=''/></a>";
75-
echo " </td>";
76-
echo " </tr>";
77+
?>
78+
</td>
79+
<td>
80+
<a class='removeShareLink'><img src='<?php echo $this->coreWebroot?>/public/images/icons/close.png' alt=''/></a>
81+
</td>
82+
</tr>
83+
<?php
7784
}
7885

7986
foreach($this->userPolicies as $policy)
8087
{
81-
echo " <tr type='user' element='{$policy->user->getKey()}'>";
82-
echo " <td>";
83-
echo " <img src='{$this->coreWebroot}/public/images/icons/unknownUser-small.png'";
84-
echo " </td>";
85-
echo " <td>";
86-
echo " ".$policy->user->getFullName();
87-
echo " </td>";
88-
echo " <td>";
88+
?>
89+
<tr type='user' element='<?php echo $policy->user->getKey()?>'>
90+
<td>
91+
<img src='<?php echo $this->coreWebroot?>/public/images/icons/unknownUser-small.png'/>
92+
</td>
93+
<td>
94+
<?php echo $policy->user->getFullName()?>
95+
</td>
96+
<td>
97+
<?php
8998
if((!$this->isAdmin&&$policy->getPolicy()==MIDAS_POLICY_ADMIN)||$policy->user->getKey()==$this->userDao->getKey())
9099
{
91100
switch ($policy->getPolicy())
@@ -120,18 +129,19 @@ foreach($this->userPolicies as $policy)
120129
}
121130
echo " </tr>";
122131
}
123-
echo " </table>";
124-
echo " <br/>";
125-
echo " <div class='shareSearch'>";
126-
echo " <input type='text' id='live_share_search' value='{$this->t('Add a permission to ...')}' autocomplete='off' autocorrect='off' autocapitalize='off' />";
127-
echo " <input type='hidden' id='live_share_search_value' value='init' />";
128-
echo " <div id='searchShareLoading' style='display:none'></div>";
129-
echo " </div>";
130-
echo " </div>";
132+
?>
133+
</table>
134+
<br/>
135+
<div class='shareSearch'>
136+
<input type='text' id='live_share_search' value='<?php echo $this->t('Add a permission to ...')?>' autocomplete='off' autocorrect='off' autocapitalize='off' />
137+
<input type='hidden' id='live_share_search_value' value='init' />
138+
<div id='searchShareLoading' style='display:none'></div>
139+
</div>
140+
</div>
141+
142+
</div>
131143

132-
echo "</div>";
133144

134-
?>
135145
<div style="display: none;" class="jsonShareContent">
136146
<?php echo $this->jsonShare?>
137147
</div>

0 commit comments

Comments
 (0)