guest) { $redirectUrl = JRoute::_('index.php?option=com_user&view=login&return='.base64_encode(JRoute::_('index.php?option='.JRequest::getVar('option').'&view=claim1&Itemid='.JRequest::getVar('Itemid')))); JFactory::getApplication()->redirect($redirectUrl); } $document =& JFactory::getDocument(); $claimModel = $this->getModel('claim'); $model = $this->getModel('deposition'); $tipModel = $this->getModel('tooltip'); $document->addCustomTag(''); $document->addCustomTag(''); $document->addCustomTag(''); $document->addStyleSheet(JRoute :: _(JURI :: base() . 'plugins/content/yoo_tooltip/yoo_tooltip.css.php')); $scriptText = 'window.addEvent(\'domready\', function() {new Meio.Autocomplete.Select(\'projectName\', \'' . JRoute :: _('index.php?option=' . JRequest :: getVar('option') . '&view=json&format=raw&data=projects') . '\', {maxVisibleItems: 20, valueField: $(\'projectId\'), valueFilter: function(data) {return data.projectId;}, filter: {type: \'contains\', path: \'projectName\'}, urlOptions: {queryVarName: \'term\', max: 25}});});'; $document->addScriptDeclaration($scriptText); $action = JRequest::getVar('action'); $projectId = JRequest::getVar('projectId'); switch ($action) { case 'addProject': $projectInfo = $model->getShortProjectInfo($projectId); if ($projectInfo->projectId != null) $claimModel->addSelectedProject($projectInfo); break; case 'removeProject': $claimModel->removeSelectedProject($projectId); break; } $selectedProjects = $claimModel->getSelectedProjects(); $this->assignRef('selectedProjects', $selectedProjects); foreach($selectedProjects as $id=>$info) { $scriptText = "window.addEvent('domready', function() {"; $scriptText .= $tipModel->createProjectInfoTooltip($info, $id); $scriptText .= "});"; $document->addScriptDeclaration($scriptText); } parent::display($tpl); } } ?>