Exemplo n.º 1
0
 public function executeUpdateHelpSettings()
 {
     $widgetHelpSettings = afWidgetHelpSettingsPeer::retrieveCurrent();
     $widgetHelpSettings->setHelpType($this->getRequestParameter("fieldhelp"));
     $formData = $this->getRequestParameter("edit");
     $formData = $formData[0];
     $widgetHelpSettings->setPopupHelpIsEnabled(@$formData['popup']);
     $widgetHelpSettings->setWidgetHelpIsEnabled(@$formData['widgethelp']);
     $widgetHelpSettings->save();
     $info = json_encode(array('success' => true, 'message' => 'Your changes have been successfuly saved!'));
     return $this->renderText($info);
 }
Exemplo n.º 2
0
$actions->addAction(array('iconCls' => 'icon-minus', 'tooltip' => 'Delete'));
/**
 * REMEMBER:
 * $grid->endRowActions($actions) is commented so you can see that if no actions are associated with the grid then the actions column doesn't appear
 */
//$grid->endRowActions($actions);
new afExtjsLinkButton($gridf, array('label' => 'www.immune.dk', 'url' => 'http://www.immune.dk'));
new afExtjsLinkButton($gridf, array('label' => 'www.immune.dk', 'url' => 'http://www.immune.dk', 'icon' => '/images/famfamfam/cancel.png'));
$gridf->end();
//$layout->addItem('center',$grid);
/**
 * ticket #1180
 */
$layout->setSouthTitleAndStyle('south title test', 'font-weight:bold;color:#cc0000;border:1px solid #cc0000;background-color:#cccc00;');
$html = '<b>Lorem ipsum dolor sit amet</b>, consectetur adipiscing elit. Ut est neque, feugiat venenatis elementum a, tincidunt non massa. Cras sagittis, augue nec porttitor scelerisque, elit lorem ornare massa, eu euismod odio massa vitae justo. Mauris erat nunc, luctus tincidunt lacinia ac, sagittis id risus. Mauris ut quam nisl. Mauris tortor eros, tincidunt sit amet fringilla lacinia, faucibus vel augue. Sed dolor felis, faucibus nec elementum at, cursus in magna. Nam erat nibh, auctor fermentum convallis id, ornare vitae urna. Ut placerat elementum felis. Donec quis libero mauris, vitae vehicula mauris. Donec sit amet urna id justo tempus aliquam. Duis aliquam gravida dictum. Nullam ac nibh eros. Donec lacinia risus id velit congue sed placerat nibh fringilla. Vivamus condimentum varius lacus et facilisis. Curabitur sed tellus sit amet diam dictum ornare. Donec dui lacus, vehicula sit amet semper a, auctor sed sem. Nam pulvinar iaculis libero sed varius. Quisque volutpat posuere sapien quis condimentum.';
if (afWidgetHelpSettingsPeer::retrieveCurrent()->getWidgetHelpIsEnabled()) {
    $layout->addHelp($html);
}
/**
* WEST PANEL TREE WITH FILTERS
*/
$filters = new afExtjsTree(array('title' => 'Filters', 'iconCls' => 'server'));
$root_node = $filters->startRoot(array('text' => 'Filters'));
$child = $root_node->addChild(array('text' => 'Incident Reports'));
$child1 = $child->addChild(array('text' => 'Active', 'href' => 'https://192.168.80.128/incidents/list/filter/filter/report/active'));
$child1->end();
$child->end();
$child = $root_node->addChild(array('text' => 'My Incidents'));
$child1 = $child->addChild(array('text' => 'Assigned', 'href' => 'https://192.168.80.128/incidents/list?filters%5Bowner_id%5D=2&filter=filter&report=active'));
$child1->end();
$child->end();
Exemplo n.º 3
0
 function __construct($type = self::PANEL, $dry_run = false, $step = false, $manual = false, $internal = false, $build = false)
 {
     if ($build) {
         $build = strtok(substr($build, 1), "?");
         $build_params = ArrayUtil::queryStringToArray(strtok("?"));
         $this->build = $build;
     } else {
         if (self::$instance) {
             return true;
         }
     }
     self::$started = true;
     if (!defined("NODES")) {
         define("NODES", 1);
     }
     if (!defined("VALUES")) {
         define("VALUES", 2);
     }
     if (!defined("ATTRIBUTES")) {
         define("ATTRIBUTES", 3);
     }
     if (!defined("PAIRS")) {
         define("PAIRS", 4);
     }
     $this->root = sfConfig::get("sf_root_dir");
     $this->schemaLocation = $this->root . "/plugins/appFlowerPlugin/schema/appflower.xsd";
     // Reading parser YML config
     //$tmp = sfYaml::load($this->root."/plugins/appFlowerPlugin/config/app.yml");
     $this->remove_fields = sfConfig::get("app_parser_remove_fields");
     // Context info
     $this->context = sfContext::getInstance();
     // Set Application..
     $this->application = $this->context->getConfiguration()->getApplication();
     // Set user
     $this->user = $this->context->getUser();
     // Add JS file list
     //$this->loadJSFilesList();
     // Action attributes..
     $actionInstance = $this->context->getActionStack()->getLastEntry()->getActionInstance();
     $this->attribute_holder = $actionInstance->getVarHolder()->getAll();
     // Request
     $this->request = $actionInstance->getRequest()->getParameterHolder()->getAll();
     foreach ($this->request as $param => $value) {
         if (!array_key_exists($param, $this->attribute_holder)) {
             $this->attribute_holder[$param] = $value;
         }
     }
     $this->currentUri = $actionInstance->getModuleName() . "/" . $actionInstance->getActionName();
     if ($build) {
         $uri = $build;
         $module = strtok($build, "/");
         $action = strtok("/");
         $this->currentUri = $module . "/" . $action;
     } else {
         $uri = $actionInstance->getModuleName() . "/" . $actionInstance->getActionName();
         $module = $actionInstance->getModuleName();
         $action = $actionInstance->getActionName();
     }
     $this->vars[$uri] = $this->attribute_holder;
     if ($build) {
         $config_vars = afConfigUtils::getConfigVars(strtok($build, "/"), strtok("/"), $this->context->getRequest());
         if ($build_params) {
             foreach ($build_params as $n => $p) {
                 $config_vars[$n] = $p;
             }
         }
         $this->vars[$uri] = $config_vars;
         $actionInstance->getVarHolder()->add($config_vars);
     }
     // Assign DOM Document..
     if (!$build) {
         $this->readXmlDocument();
     } else {
         $this->readXmlDocument(null, false, $build);
     }
     if (sfContext::getInstance()->has('profiler')) {
         $timer = sfTimerManager::getTimer('afRead');
         $timer->addTime();
         $timer = sfTimerManager::getTimer('afRender');
     }
     parent::__construct($this->document);
     $root = $this->document->getElementsByTagName("view")->item(0);
     $view_type = $root->getAttribute("type");
     $dynamic = $root->getAttribute("dynamic");
     $actionInstance->view = $view_type;
     if ($view_type == "layout") {
         $this->layoutModule = $actionInstance->layoutModule = $root->getAttribute("module");
     }
     $view_type = XmlBaseElementParser::parseValue($view_type, $root, true);
     $this->set("type", $view_type, $root);
     // Is this a Dynamic widget? If so, let's create update XML DOM.
     $this->namespace = $this->document->lookupNamespaceUri("i");
     if ($dynamic === "true") {
         $this->buildXmlDocument($module, $view_type);
     }
     // Parser type
     if ($view_type == "layout") {
         $this->type = self::PAGE;
     } else {
         if ($view_type == "wizard") {
             $this->type = self::WIZARD;
         } else {
             $this->type = self::PANEL;
         }
     }
     // Is this a layout?
     $this->page = $view_type;
     try {
         if (!file_exists($this->schemaLocation) || !is_readable($this->schemaLocation)) {
             throw new XmlParserException("Was unable to read main schema document. Please check " . $this->schemaLocation . "!");
         } else {
             if ($this->type === self::WIZARD && !isset($this->attribute_holder["current"])) {
                 throw new XmlParserException("The step parameter must be defined in case of wizard layout!");
             }
         }
         if (isset($this->attribute_holder["current"])) {
             $this->current = $this->attribute_holder["current"];
         }
         if ($this->type === self::WIZARD && !$this->current) {
             throw new XmlParserException("The value of step parameter must be either false or a positive number!");
         }
         $this->step = $step;
         if ($this->type === self::WIZARD && !isset($this->attribute_holder["step"])) {
             throw new XmlParserException("Required variable step cannot be found in attribute holder!");
         }
     } catch (Exception $e) {
         throw $e;
     }
     if ($dry_run) {
         return true;
     }
     // Reading default footer and sidebar data
     if (!$build) {
         $this->parseDefaultPanels();
     }
     // Reading Main XML Schema..
     $this->schema = new DOMDocument();
     $this->schema->load($this->schemaLocation);
     // Reading enum values..
     $this->fetchEnums();
     // Check widget access rights
     if ($this->type === self::PANEL || $this->type === self::WIZARD) {
         $this->checkWidgetCredentials();
     }
     $this->enumCheck("i:viewType", $view_type);
     if ($this->type === self::WIZARD && isset($this->attribute_holder["init"])) {
         if (!$this->fetch("//i:datastore")->length) {
             $this->datastore = false;
         } else {
             $this->datastore = true;
         }
     }
     if ($build) {
         $this->runParser($build, "object");
     } else {
         // Create layout
         if ($this->type === self::PANEL) {
             $this->panelIdXml = $this->context->getModuleName() . "/" . $this->context->getActionName();
             self::$masterLayout = null;
             $this->layout = new afExtjsPanelLayout();
         } else {
             if (self::$instance === null) {
                 self::$instance = true;
             }
             if ($this->type === self::WIZARD) {
                 $this->isTabbed();
                 if (!$this->tabbedWizard) {
                     $wizattrs = array('id' => 'center_panel', 'title' => "");
                 } else {
                     $wizattrs = array('id' => 'center_panel', 'title' => "", 'centerType' => 'group');
                 }
                 $this->layout = new afExtjsWizardLayout($wizattrs);
             } else {
                 $this->portalIdXml = $this->context->getModuleName() . "/" . $this->context->getActionName();
                 $this->portalStateObj = afPortalStatePeer::retrieveByIdXml($this->portalIdXml);
                 if (!$this->portalStateObj) {
                     //default values for layout & columns
                     $this->portalConfig = new stdClass();
                     $this->portalConfig->layoutType = $this->fetch("//i:tab")->length ? afPortalStatePeer::TYPE_TABBED : afPortalStatePeer::TYPE_NORMAL;
                     $this->portalConfig->content = array();
                     $this->portalConfig->content[0]["portalLayoutType"] = sfConfig::get("app_parser_default_layout", "[100]");
                     $this->portalConfig->idXml = $this->portalIdXml;
                 }
             }
             if ($this->layout) {
                 self::$masterLayout = $this->layout;
             }
         }
         $this->manualMode = $manual;
         /**
          * widget help settings
          * 
          * ticket #300 - radu
          */
         $this->widgetHelpSettings = afWidgetHelpSettingsPeer::retrieveCurrent();
         // Application menu..
         if ($this->context->getRequest()->getAttribute("af_first_page_request")) {
             /*$this->parseMenu(null,$this->layout->toolbar);
             		
             		print_r($this->buttons);
             		exit();
             		
             		foreach($this->buttons as $button) {
             			if(isset($button["menus"])) {
             				for($i = sizeof($button["menus"])-1; $i >= 0; $i--) {
             					$button["menus"][$i]->end();
             				}
             			}
             			$button["button"]->end();
             		}
             		
             		sfProjectConfiguration::getActive()->loadHelpers(array('afExtjsToolbar'));
             		*/
         }
         if (!$manual) {
             $this->runParser(1, "content");
         }
     }
 }