protected function renderTitleContent()
 {
     $starLink = StarredUtil::getToggleStarStatusLink($this->model, null);
     $content = StringUtil::renderFluidContent($this->getTitle());
     $content .= $starLink;
     return ZurmoHtml::tag('h1', array(), $content);
 }
 protected function resolveNameContent()
 {
     $starLink = null;
     $spanContent = null;
     if (StarredUtil::modelHasStarredInterface($this->model)) {
         $starLink = StarredUtil::getToggleStarStatusLink($this->model, null);
     }
     return ZurmoHtml::tag('h2', array(), $spanContent . strval($this->model) . $starLink . $this->renderGoToDetailsLink());
 }
 protected function resolveNameContent()
 {
     $element = new DropDownElement($this->model, 'title', null);
     $element->nonEditableTemplate = '{content}';
     $starLink = null;
     $spanContent = null;
     if (StarredUtil::modelHasStarredInterface($this->model)) {
         $starLink = StarredUtil::getToggleStarStatusLink($this->model, null);
     }
     $salutation = $element->render();
     if ($salutation != null) {
         $spanContent = ZurmoHtml::tag('span', array('class' => 'salutation'), $element->render());
     }
     return ZurmoHtml::tag('h2', array(), $spanContent . strval($this->model) . $starLink . $this->renderGoToDetailsLink());
 }
示例#4
0
 public function testGetToggleStarStatusLink()
 {
     $super = User::getByUsername('super');
     Yii::app()->user->userModel = $super;
     $account = new Account();
     $account->owner = $super;
     $account->name = 'Test Account';
     $account->officePhone = '1234567890';
     $this->assertTrue($account->save());
     $dataProvider = new RedBeanModelDataProvider('Account');
     $data = $dataProvider->getData();
     $link = StarredUtil::getToggleStarStatusLink($data[0], null);
     $this->assertContains('unstarred', $link);
     $this->assertContains('star-Account-' . $account->id, $link);
 }
 public function getPostTruncatedTitleContent()
 {
     return StarredUtil::getToggleStarStatusLink($this->savedReport, null);
 }
 /**
  * Override to add a starring link to the title
  * @return string
  */
 public function getTitle()
 {
     $starLink = StarredUtil::getToggleStarStatusLink($this->model, null);
     return parent::getTitle() . $starLink;
 }