<?php
/**
  * Ahead WebSoft Technologies Pvt Ltd.
  * @copyright  Copyright 2006-2026 Ahead WebSoft Technologies Pvt Ltd.
  * @license    https://www.socialengine.com/policies
*/

class Twitterclone_Widget_DashboardLinksController extends Engine_Content_Widget_Abstract
{

  public function indexAction()
  {

    $this->view->viewer = $viewer = Engine_Api::_()->user()->getViewer();
    $this->view->viewer_id = $viewerId = $viewer->getIdentity();
    if (empty($viewerId))
      return $this->setNoRender();

    $this->view->homelinksnavigation = Engine_Api::_()->getApi('menus', 'core')->getNavigation('user_home');
		$twitterclone_widget = Zend_Registry::isRegistered('twitterclone_widget') ? Zend_Registry::get('twitterclone_widget') : null;
    $this->view->dashboardlinks = Engine_Api::_()->getDbTable('dashboardlinks', 'twitterclone')->getInfo(array('sublink' => 0, 'enabled' => 1));

    $setting = Engine_Api::_()->getApi('settings', 'core');
    if ($viewer->getIdentity()) {
      $this->view->options = unserialize($setting->getSetting("twitterclone.headerloggedinoptions", 'a:4:{i:0;s:6:"search";i:1;s:8:"miniMenu";i:2;s:8:"mainMenu";i:3;s:4:"logo";}'));
    } else {
      $this->view->options = unserialize($setting->getSetting("twitterclone.headernonloggedinoptions", 'a:4:{i:0;s:6:"search";i:1;s:8:"miniMenu";i:2;s:8:"mainMenu";i:3;s:4:"logo";}'));
    }
		if(empty($twitterclone_widget)) {
			return $this->setNoRender();
		}
  }
}
