[ Index ] |
|
Code source de CMS made simple 1.0.5 |
1 <?php 2 #CMS - CMS Made Simple 3 #(c)2004 by Ted Kulp (wishy@users.sf.net) 4 #This project's homepage is: http://cmsmadesimple.sf.net 5 # 6 #This program is free software; you can redistribute it and/or modify 7 #it under the terms of the GNU General Public License as published by 8 #the Free Software Foundation; either version 2 of the License, or 9 #(at your option) any later version. 10 # 11 #This program is distributed in the hope that it will be useful, 12 #but WITHOUT ANY WARRANTY; without even the implied warranty of 13 #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 #GNU General Public License for more details. 15 #You should have received a copy of the GNU General Public License 16 #along with this program; if not, write to the Free Software 17 #Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 19 function smarty_cms_function_edit($params, &$smarty) 20 { 21 global $gCms; 22 23 if (!check_permission(get_userid(false), 'Modify Any Page')) return; 24 25 $text = isset($params['text']) ? $params['text']:'Edit This Page'; 26 if (isset($params["showbutton"])) 27 { 28 return '<a href="'.$gCms->config['root_url'].'/'.$gCms->config['admin_dir'].'/editcontent.php?content_id='.$gCms->variables['content_id'].'"><img src="'.$gCms->config['root_url'].'/images/cms/editbutton.png" alt="'.$text.'"/></a>'; 29 } 30 else 31 { 32 return '<a href="'.$gCms->config['root_url'].'/'.$gCms->config['admin_dir'].'/editcontent.php?content_id='.$gCms->variables['content_id'].'">'.$text.'</a>'; 33 } 34 /* 35 global $gCms; 36 37 $userid = get_userid(false); 38 if(!$userid) return; 39 40 $access = check_permission($userid, 'Modify Any Page'); 41 if (!$access) return; 42 43 $text = 'Edit This Page'; 44 45 if (!empty($params['text'])) 46 { 47 $text = $params['text']; 48 } 49 50 //will this work if using htaccess? (Yes! -Wishy) 51 if (isset($params["showbutton"])) 52 { 53 return '<a href="'.$gCms->config['root_url'].'/'.$gCms->config['admin_dir'].'/editcontent.php?content_id='.$gCms->variables['content_id'].'"><img src="'.$gCms->config['root_url'].'/images/cms/editbutton.png" alt="'.$text.'"/></a>'; 54 } 55 else 56 { 57 return '<a href="'.$gCms->config['root_url'].'/'.$gCms->config['admin_dir'].'/editcontent.php?content_id='.$gCms->variables['content_id'].'">'.$text.'</a>'; 58 } 59 */ 60 } 61 62 function smarty_cms_help_function_edit() { 63 ?> 64 <h3>What does this do?</h3> 65 <p>Creates a link to edit the page</p> 66 <h3>How do I use it?</h3> 67 <p>Just insert the tag into your template/page like: <code>{edit}</code><br></p> 68 <h3>What parameters does it take?</h3> 69 <ul> 70 <li><em>(optional)</em>showbutton - Set to "true" and will show a edit graphic instead of a text link.</li> 71 </ul> 72 <?php 73 } 74 75 function smarty_cms_about_function_edit() { 76 ?> 77 <p>Author: Sorin Sbârnea<sorin2000@intersol.ro> (remove 2000 from address)</p> 78 <p>Version: 1.0</p> 79 <p> 80 Change History:<br/> 81 None 82 </p> 83 <?php 84 } 85 86 ?>
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Tue Apr 3 18:50:37 2007 | par Balluche grâce à PHPXref 0.7 |