Du bist nicht angemeldet. Der Zugriff auf einige Boards wurde daher deaktiviert.
- Links zu: Aktiven | Unbeantworteten
- Übersicht
- »
- »
1
#1 01. Juli 2014 09:47
- faglork
- CMSMS-Profi
- Ort: Fränkische Schweiz
- Registriert: 15. Dezember 2010
- Beiträge: 1.157
- Webseite
Re:
Moin!
Ein Kunde möchte eine Aktion, die im Frontend nur sichtbar ist, wenn er im Backend eingeloggt ist.
Frontendusers wäre hier Overkill.
Alles was ich dazu gefunden habe bezieht sich auf FEU.
Gibts sowas? $loggedInBackend oder so?
Servus,
Alex
Offline
#2 01. Juli 2014 11:05
- nockenfell
- Moderator

- Ort: Lenzburg, Schweiz
- Registriert: 09. November 2010
- Beiträge: 2.807
- Webseite
Re:
if (!check_permission(get_userid(false), 'Manage All Content') && !quick_check_authorship(cms_utils::get_current_pageid(), author_pages(get_userid(false))))
return;--> Dieser Code habe ich aus dem function.edit.php Plugin kopiert, welches ich vor einiger Zeit angepasst habe:
<?php
#CMS - CMS Made Simple
#(c)2004 by Ted Kulp (wishy@users.sf.net)
#This project's homepage is: http://cmsmadesimple.sf.net
#
#This program is free software; you can redistribute it and/or modify
#it under the terms of the GNU General Public License as published by
#the Free Software Foundation; either version 2 of the License, or
#(at your option) any later version.
#
#This program is distributed in the hope that it will be useful,
#but WITHOUT ANY WARRANTY; without even the implied warranty of
#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
#GNU General Public License for more details.
#You should have received a copy of the GNU General Public License
#along with this program; if not, write to the Free Software
#Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
function smarty_cms_function_edit($params, &$smarty)
{
$config = cmsms()->GetConfig();
$text = isset($params['text']) ? $params['text'] : 'Edit This Page';
$css = isset($params['css']) ? ' class="'.$params['css'].'"' : ' class="cmsmseditbutton"';
$image = isset($params['image']) ? ' <img src="'.$params['image']. '" alt="'.$text.'" border="0" /> ' : "";
$smarty = cmsms()->GetSmarty();
if (isset($params["module"])) {
// cgblog
if (strtolower($params["module"]) == "cgblog" and check_permission(get_userid(false), 'Modify CGBlog'))
$retval = '<a href="'.$config['root_url'].'/'.$config['admin_dir'].'/moduleinterface.php' . get_secure_param() . '&mact=CGBlog,m1_,admin_editarticle,0&m1_articleid=' . $params['id'] . '" '.$css.'>'.$image.'<span>' . $text . '</span></a>';
// news
else if (strtolower($params["module"]) == "news" and check_permission(get_userid(false), 'Modify News'))
$retval = '<a href="'.$config['root_url'].'/'.$config['admin_dir'].'/moduleinterface.php' . get_secure_param() . '&mact=News,m1_,editarticle,0&m1_articleid=' . $params['id'] . '" '.$css.'>'.$image.'<span>' . $text . '</span></a>';
// cgcalendar
else if (strtolower($params["module"]) == "cgcalendar" and check_permission(get_userid(false), 'Modify Calendar'))
$retval = '<a href="'.$config['root_url'].'/'.$config['admin_dir'].'/moduleinterface.php' . get_secure_param() . '&mact=CGCalendar,m1_,admin_add_event,0&m1_event_id=' . $params['id'] . '" '.$css.'>'.$image.'<span>' . $text . '</span></a>';
// ListIt2
else if (strtolower($params["module"]) == "listit2" and check_permission(get_userid(false), 'listit2_modify_item'))
$retval = '<a href="'.$config['root_url'].'/'.$config['admin_dir'].'/moduleinterface.php' . get_secure_param() . '&mact=ListIt2,m1_,admin_edititem,0&m1_item_id=' . $params['id'] . '" '.$css.'>'.$image.'<span>' . $text . '</span></a>';
// EventsListing
else if (strtolower($params["module"]) == "eventslisting" and check_permission(get_userid(false), 'EventsListing: modify events'))
$retval = '<a href="'.$config['root_url'].'/'.$config['admin_dir'].'/moduleinterface.php' . get_secure_param() . '&mact=EventsListing,m1_,admin_editevent,0&m1_entry_id=' . $params['id'] . '" '.$css.'>'.$image.'<span>' . $text . '</span></a>';
// Polls
else if (strtolower($params["module"]) == "polls" and check_permission(get_userid(false), 'administratepolls'))
$retval = '<a href="'.$config['root_url'].'/'.$config['admin_dir'].'/moduleinterface.php' . get_secure_param() . '&mact=Polls,m1_,editpoll,0&m1_pollid=' . $params['id'] . '" '.$css.'>'.$image.'<span>' . $text . '</span></a>';
if (!$retval) return;
if (isset($params['assign'])) { $smarty->assign(trim($params['assign']),$retval); return; }
else return $retval;
}
if (!check_permission(get_userid(false), 'Manage All Content')
&& !quick_check_authorship(cms_utils::get_current_pageid(),
author_pages(get_userid(false))))
return;
$retval = '<a href="'.$config['root_url'].'/'.$config['admin_dir'].'/editcontent.php' . get_secure_param() . '&content_id=' . cms_utils::get_current_pageid() . '" '.$css.'>'.$image.'<span>' . $text . '</span></a>';
if (isset($params['assign'])) { $smarty->assign(trim($params['assign']),$retval); return; }
else return $retval;
}
function smarty_cms_help_function_edit() {
?>
<h3>Was macht dieser Tag?</h3>
<p>Erzeugt einen Link, um die Seite zu bearbeiten.</p>
<h3>Wie wird er eingesetzt?</h3>
<p>Fügen Sie den Tag folgendermaßen in Ihr Template bzw. Ihre Seite ein:</p> <code>{edit}</code>
<h3>Welche Parameter sind möglich?</h3>
<ul>
<li><em>(optional)</em> <tt>image</tt> - Pfad zu einem Bild das angezeigt werden soll</li>
<li><em>(optional)</em> <tt>text</tt> - Text der angezeigt werden soll</li>
<li><em>(optional)</em> <tt>css</tt> - CSS Klasse (Standard cmsmseditbutton)</li>
<li><em>(optional)</em> <tt>module</tt> - Geben Sie den Namen des Moduls an, welches bearbeitet werden soll (muss zusammen mit dem Parameter 'id' angegeben werden). Möglich: news, cgblog, cgcalendar, listit2, eventslisting, polls</li>
<li><em>(optional)</em> <tt>id</tt> - ID des Datensatzes (muss zusammen mit dem Parameter 'module' angegeben werden)</li>
</ul>
<?php
}
function smarty_cms_about_function_edit() {
?>
<p>Author: blattertech informatik - <a href="mailto:info@blattertech.ch">info@blattertech.ch</a></p>
<p>based on Plugin from Sorin Sbârnea and addition for 1.10.x by NaN</p>
<p>Version: 1.1</p>
<p>Change History:</p>
<p>Version 1.1<br />
Add support for modules news, cgblog, cgcalendar, listit2, eventslisting and polls<br />
Add param for image<br />
Add param assign<br />
</p>
<?php
}[dieser Beitrag wurde mit 100% recycled bits geschrieben]
Mein Blog / Diverse Links rund um CMS Made Simple
Module: btAdminer, ToolBox, Revisions
Offline
#3 01. Juli 2014 12:29
- cyberman
- Moderator

- Ort: Dohna / Sachsen
- Registriert: 13. September 2010
- Beiträge: 6.741
- Webseite
Re:
Warst wieder schneller, Lukas
.
Hatte an das gleiche gedacht, als ich die Frage im Feed gelesen habe.
1. Wie bekomme ich hier schnelle Hilfe?
2. HowTo: Fehlersuche bei CMSMS
---
„First they ignore you, then they laugh at you, then they fight you, then you win.“ Mahatma Ghandi
Offline
#5 01. Juli 2014 13:35
- cyberman
- Moderator

- Ort: Dohna / Sachsen
- Registriert: 13. September 2010
- Beiträge: 6.741
- Webseite
Re:
Na wenn das kein Grund zum Feiern ist
- Prost!
1. Wie bekomme ich hier schnelle Hilfe?
2. HowTo: Fehlersuche bei CMSMS
---
„First they ignore you, then they laugh at you, then they fight you, then you win.“ Mahatma Ghandi
Offline
1
- Übersicht
- »
- »
