2017-05-30 139 views
0

我想添加新的设置页面和电子邮件页面。当您点击电子邮件菜单时,它在银河系管理员cms下,但在重新加载电子邮件页面后,它不在银条管理员cms下。SilverStripe管理员更改

那么是什么原因,它不是在管理员的CMS下?

这里是控制器代码:

public function index() { 
    $getmem=Member::currentUser(); 
    if($getmem->RainloopEmail !='' && $getmem->Pass !='') 
    { 
     $com=$getmem->RainloopEmail.":".$getmem->Pass; 
     $encrypted = base64_encode($getmem->RainloopEmail) ; 
     $rainloopemail=$encrypted; 
     $encrypted =base64_encode($getmem->Pass); 
     $pss=$encrypted; 

     $hash=base64_encode($com); 

    } 
    else 
    { 
     $rainloopemail=''; 
     $pss=''; 
     $com=$getmem->RainloopEmail.":".$getmem->Pass; 
     $hash=base64_encode($com); 

    } 
    $url='http://op.mctitsolutions.com/rainloop/rainloop.php?hash='.$hash; 
    $arrayData = new ArrayData(array(
'Width' => '100%', 
'Height' => '100%', 
'Location'=>$url)); 

return $arrayData->renderWith(Array('EmailsAdminController_Content','Coach_message','Page')); 

} 

这里是模板文件代码:

<div style="padding:55px 20px"> 
$EditForm 
<iframe id="MainPopupIframe" width="$Width" height="605px" src="$Location"></iframe> 

那么,什么是它不是在管理CMS的原因是什么?

+2

你的问题是? – 3dgoo

+0

@ 3dgoo为什么减去投票?问题补充? –

+0

我没有投下你的问题。 我只能猜测你为什么被拒绝投票。 以下是我认为你的问题的一些问题是。希望你觉得这有助于改善你的问题。 – 3dgoo

回答

2

这是我的答案。

在控制器中增加新功能。和用于在模板文件中显示的循环。这解决了我的问题。

public function getViewEmails() { 
    $hash=''; 
      $getmem=Member::currentUser(); 
    if($getmem->RainloopEmail !='' && $getmem->Pass !='') 
    { 
     $com=$getmem->RainloopEmail.":".$getmem->Pass; 
     $encrypted = base64_encode($getmem->RainloopEmail) ; 
     $rainloopemail=$encrypted; 
     $encrypted =base64_encode($getmem->Pass); 
     $pss=$encrypted; 

     $hash=base64_encode($com); 

    } 
    else 
    { 
     $rainloopemail=''; 
     $pss=''; 
     $com=$getmem->RainloopEmail.":".$getmem->Pass; 
     $hash=base64_encode($com); 

    } 
    $url='http://op.mctitsolutions.com/rainloop/rainloop.php?hash='.$hash; 
     return new ArrayList(array(
       new ArrayData(array(
         'Url'=>$url, 
         'Width' => '100%', 
       )) 
     )); 
} 

这是我的模板文件。

<div style="padding:55px 20px"> 

<% loop ViewEmails %> 
<iframe id="MainPopupIframe" width="$Width" height="605px" src="$Url"> 
</iframe> 
    <% end_loop %> 
</div>