Skip to content

Commit

Permalink
Fixes editing of existing tags by replacing "$node" with "$record" Al…
Browse files Browse the repository at this point in the history
…so "retrofits" template to use 'record=' instead of 'id=' for {icon} Still unable to create new tags, but not sure how this is intended to work.
  • Loading branch information
dleffler committed Jun 11, 2011
1 parent 7829280 commit bdf07cf
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 19 deletions.
64 changes: 55 additions & 9 deletions framework/core/controllers/expTagController.php
Expand Up @@ -8,7 +8,7 @@
* Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* The file thats holds the expTagController class.
* The file that holds the expTagController class.
*
* @link http://www.gnu.org/licenses/gpl.txt GPL http://www.gnu.org/licenses/gpl.txt
* @package Exponent-CMS
Expand All @@ -26,18 +26,64 @@
class expTagController extends expController {
//public $useractions = array('browse'=>'Browse content by tags');
public $useractions = array();


/**
* name of module for backwards compat with old modules
* @return string
*/
function name() { return $this->displayname(); } //for backwards compat with old modules
function displayname() { return "Tag Manager"; }
function description() { return "This module is for manageing your tags"; }
function author() { return "Adam Kessler @ OIC Group, Inc"; }
function hasSources() { return false; }
function hasViews() { return true; }
/**
* name of module
* @return string
*/
function displayname() { return "Tag Manager"; }

/**
* description of module
* @return string
*/
function description() { return "This module is for manageing your tags"; }

/**
* author of module
* @return string
*/
function author() { return "Adam Kessler @ OIC Group, Inc"; }

/**
* does module have sources available?
* @return bool
*/
function hasSources() { return false; }

/**
* does module have views available?
* @return bool
*/
function hasViews() { return true; }

/**
* does module have content available?
* @return bool
*/
function hasContent() { return true; }

/**
* does module support workflow?
* @return bool
*/
function supportsWorkflow() { return false; }

/**
* is module content searchable?
* @return bool
*/
function isSearchable() { return false; }

function manage() {

/**
* manage tags
*/
function manage() {
global $db;
expHistory::set('manageable', $this->params);
$modelname = $this->basemodel_name;
Expand Down
2 changes: 1 addition & 1 deletion framework/core/datatypes/expTag.php
Expand Up @@ -7,7 +7,7 @@
* Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* The file thats holds the expTag class
* The file that holds the expTag class
*
* @link http://www.gnu.org/licenses/gpl.txt GPL http://www.gnu.org/licenses/gpl.txt
* @package Exponent-CMS
Expand Down
14 changes: 7 additions & 7 deletions framework/modules/core/views/expTag/edit.tpl
Expand Up @@ -19,19 +19,19 @@
<h1>Edit Tags</h1>
<p>Add new tags to this tag collection</p>
</div>
{if $node->id == ""}
{if $record->id == ""}
{assign var=action value=create}
{else}
{assign var=action value=update}
{/if}

{form controller=expTag action=$action}
{control type=hidden name=id value=$node->id}
{control type=hidden name=tag_collections_id value=$node->tag_collections_id}
{control type=hidden name=parent_id value=$node->parent_id}
{control type=hidden name=rgt value=$node->rgt}
{control type=hidden name=lft value=$node->lft}
{control type=text name=title label="Tag" value=$node->title}
{control type=hidden name=id value=$record->id}
{control type=hidden name=tag_collections_id value=$record->tag_collections_id}
{control type=hidden name=parent_id value=$record->parent_id}
{control type=hidden name=rgt value=$record->rgt}
{control type=hidden name=lft value=$record->lft}
{control type=text name=title label="Tag" value=$record->title}
{control type=buttongroup submit=Save cancel=Cancel}
{/form}
</div>
Expand Down
4 changes: 2 additions & 2 deletions framework/modules/core/views/expTag/manage.tpl
Expand Up @@ -63,10 +63,10 @@
<td>
{permissions}
{if $permissions.edit == 1}
{icon controller=$controller action=edit id=$listing->id title="Edit this `$modelname`"}
{icon controller=$controller action=edit record=$listing title="Edit this `$modelname`"}
{/if}
{if $permissions.delete == 1}
{icon controller=$controller action=delete id=$listing->id title="Delete this `$modelname`" onclick="return confirm('Are you sure you want to delete this `$modelname`?');"}
{icon controller=$controller action=delete record=$listing title="Delete this `$modelname`" onclick="return confirm('Are you sure you want to delete this `$modelname`?');"}
{/if}
{/permissions}
</td>
Expand Down

0 comments on commit bdf07cf

Please sign in to comment.