Jump to content


Photo

CreateLinkActionElement

Create Link

  • Please log in to reply
3 replies to this topic

#1 k1000o

k1000o

    Advanced Member

  • Members
  • PipPipPip
  • 112 posts
  • LocationMadrid

Posted 16 February 2012 - 01:20 PM

Would it be possible to include this element action in the standard?

	class CreateLinkActionElement extends RelatedListLinkActionElement
	{
		protected function getDefaultLabel()
		{
			return Yii::t('Default', 'Create');
		}
		protected function getDefaultRoute()
		{
			return Yii::app()->createUrl($this->getRouteModuleId() . '/' .
						$this->controllerId . '/create/', $this->getRouteParameters());
		}
		protected function getRouteModuleId()
		{
			if (!isset($this->params['routeModuleId']))
			{
				return array();
			}
			return $this->params['routeModuleId'];
		}
		public function getActionType()
		{
			return 'Create';
		}
	}

The purpose is to add a createlink in the create and edit page

#2 Jason

Jason

    Administrator

  • Administrators
  • 864 posts
  • LocationChicago

Posted 16 February 2012 - 03:23 PM

Let me confirm: You are trying to make a create link for creating a related item? Why are you extending RelatedListLinkActionElement?

Jason Green
Zurmo Team
Need support? Upgrade now


#3 k1000o

k1000o

    Advanced Member

  • Members
  • PipPipPip
  • 112 posts
  • LocationMadrid

Posted 16 February 2012 - 06:29 PM

you're right we should directly inherit from LinkActionElement

......
class CreateLinkActionElement extends LinkActionElement
    {
	    protected function getDefaultLabel()
	    {
.......


#4 Jason

Jason

    Administrator

  • Administrators
  • 864 posts
  • LocationChicago

Posted 16 February 2012 - 06:58 PM

Camilo,
In the fork where we are working on merging the new user interface, i made this element already. So once that is merged back in it will be available. Good idea though!

Jason Green
Zurmo Team
Need support? Upgrade now






Also tagged with one or more of these keywords: Create, Link

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users