an action object, used to link to URLS initially

@param $id
@param $action
@param string $options
@return null|string
488318
protected function o_action($id, $action, $options = '')
    {
        if ($action !== 'new') {
            $o = &$this->objects[$id];
        }

        switch ($action) {
            case 'new':
                if (is_array($options)) {
                    $this->objects[$id] = array('t' => 'action', 'info' => $options, 'type' => $options['type']);
                } else {
                    // then assume a URI action
                    $this->objects[$id] = array('t' => 'action', 'info' => $options, 'type' => 'URI');
                }
                break;

            case 'out':
                if ($this->encrypted) {
                    $this->encryptInit($id);
                }

                $res = "\n$id 0 obj\n<< /Type /Action";
                switch ($o['type']) {
                    case 'ilink':
                        if (!isset($this->destinations[(string)$o['info']['label']])) {
                            break;
                        }

                        // there will be an 'label' setting, this is the name of the destination
                        $res .= "\n/S /GoTo\n/D " . $this->destinations[(string)$o['info']['label']] . " 0 R";
                        break;

                    case 'URI':
                        $res .= "\n/S /URI\n/URI (";
                        if ($this->encrypted) {
                            $res .= $this->filterText($this->ARC4($o['info']), false, false);
                        } else {
                            $res .= $this->filterText($o['info'], false, false);
                        }

                        $res .= ")";
                        break;
                }

                $res .= "\n>>\nendobj";

                return $res;
        }

        return null;
    }
946495
public function Link($action = null)
    {
        return Controller::join_links(
            Director::BaseURL(),
            $this->config()->url_segment,
            $action
        );
    }
357049
public function formPage($action = NULL, $id = NULL) {
    $plugin = $this->customerPagesManager->createInstance($this->customerPagesPlugin, ['action' => $action, 'id' => $id]);
    $form_state = new FormState();
    $form = $this->formBuilder->buildForm($plugin, $form_state);
    $form['#attached']['library'][] = 'core/jquery.form';
    $form['#attached']['library'][] = 'core/drupal.ajax';
    $form['#attached']['library'][] = 'acm_customer/single_page_app';
    $form['#attached']['drupalSettings']['acm_customer'] = [
      'customerPagesPath' => Url::fromRoute('acm_customer.view_page')->toString(),
      'ajaxCustomerPagesPath' => Url::fromRoute('acm_customer.ajax_view_page')->toString(),
    ];
    return $form;
  }
391042
public function moveNode(string $id = null, string $action = ''): void
    {
        $moveActions = ['up', 'down'];
        if (!in_array($action, $moveActions)) {
            $this->Flash->error((string)__('Unknown move action.'));
            $this->redirect(['action' => 'index']);

            return;
        }
        $menuItem = $this->MenuItems->get($id);
        $moveFunction = 'move' . $action;
        if ($this->MenuItems->{$moveFunction}($menuItem)) {
            $this->Flash->success((string)__('{0} has been moved {1} successfully.', $menuItem->get('label'), $action));
        } else {
            $this->Flash->error((string)__('Fail to move {0} {1}.', $menuItem->get('label'), $action));
        }

        $this->redirect($this->referer());
    }
340598
protected static function getAction(array $options)
    {
        //check if action is URL
        if (array_has($options, 'url')) {
            return 'http://'.array_get($options, 'url');
        }

        //check if action is secure for HTTPS
        if (array_has($options, 'secure')) {
            return 'https://'.array_get($options, 'secure');
        }

        //check if action is route
        if (array_has($options, 'route')) {
            return path().array_get($options, 'route');
        }
    }
53368
public function actionUrl($action = null, $path = null)
    {
        if ($action === null) {
            $action = $this->action;
        }

        $class = get_called_class();
        $uriPath = dirname(dirname(strtolower(str_replace('\\', '/', $class))));
        $controllerName = strtolower(class_basename($class));

        $url = $uriPath.'/'.$controllerName.'/'.$action;
        if ($path) {
            $url .= '/'.$path;
        }

        return Backend::url($url);
    }
70327
public function make(Table $table, $action, array $ids = [], array $options = [])
    {
        $count       = count($ids);
        $options     = $this->_getOptions($options, $count);
        $redirectUrl = $options['redirect'];
        $messages    = new JSON($options['messages']);

        $event = EventManager::trigger($this->_getEventName($action), $this->_controller, ['ids' => $ids]);
        $ids   = (array) $event->getData('ids');
        $count = count($ids);

        if (!$action) {
            $this->Flash->error($messages->get('no_action'));
            return $this->_controller->redirect($redirectUrl);
        }

        if ($count <= 0) {
            $this->Flash->error($messages->get('no_choose'));
            return $this->_controller->redirect($redirectUrl);
        }

        $this->_loadBehavior($table);
        if ($table->process($action, $ids)) {
            return $this->_process($action, $messages, $redirectUrl, $ids);
        }

        $this->Flash->error(__d('core', 'An error has occurred. Please try again.'));
        return $this->_controller->redirect($redirectUrl);
    }
1019247
protected function  o_annotation($id, $action, $options = '') {
    if  ($action !== 'new') {
      $o = & $this->objects[$id];
    }

    switch  ($action) {
    case  'new':
      // add the annotation to the current page
      $pageId =  $this->currentPage;
      $this->o_page($pageId, 'annot', $id);

      // and add the action object which is going to be required
      switch ($options['type']) {
      case  'link':
        $this->objects[$id] = array('t'=>'annotation', 'info'=>$options);
        $this->numObj++;
        $this->o_action($this->numObj, 'new', $options['url']);
        $this->objects[$id]['info']['actionId'] = $this->numObj;
        break;

      case  'ilink':
        // this is to a named internal link
        $label =  $options['label'];
        $this->objects[$id] = array('t'=>'annotation', 'info'=>$options);
        $this->numObj++;
        $this->o_action($this->numObj, 'new', array('type'=>'ilink', 'label'=>$label));
        $this->objects[$id]['info']['actionId'] = $this->numObj;
        break;
      }
      break;

    case  'out':
      $res = "\n$id 0 obj\n<< /Type /Annot";
      switch ($o['info']['type']) {
      case  'link':
      case  'ilink':
        $res.=  "\n/Subtype /Link";
        break;
      }
      $res.= "\n/A ".$o['info']['actionId']." 0 R";
      $res.= "\n/Border [0 0 0]";
      $res.= "\n/H /I";
      $res.= "\n/Rect [ ";

      foreach($o['info']['rect'] as  $v) {
        $res.=  sprintf("%.4F ", $v);
      }

      $res.= "]";
      $res.= "\n>>\nendobj";
      return  $res;
    }
  }
514296
protected function actionLink($action, $member = null)
    {
        if (!$member) {
            $member = Member::currentUser();
        }
        if (!$member) {
            return false;
        }

        /**
         * @todo: How do we handle "DataObject" instances that don't have a Link to reject/spam/delete?? This may
         * we have to make CMS a hard dependency instead.
         */
        // if (!$this->Parent()->hasMethod('Link')) {
        //     return false;
        // }

        $url = Controller::join_links(
            Director::baseURL(),
            'comments',
            $action,
            $this->ID
        );

        // Limit access for this user
        $token = $this->getSecurityToken();
        return $token->addToUrl($url, $member);
    }
239043
public function amOnAction($action, $params = [])
    {
        $route = $this->getRouteByAction($action);
        $absolute = !is_null($route->domain());
        $url = $this->app['url']->action($action, $params, $absolute);

        $this->amOnPage($url);
    }
784745
protected function detectActionIsOutlinkOnAliasHost(Action $action, $idSite)
    {
        $decodedActionUrl = $action->getActionUrl();
        $actionUrlParsed  = @parse_url($decodedActionUrl);

        if (!isset($actionUrlParsed['host'])) {
            return false;
        }

        return Visit::isHostKnownAliasHost($actionUrlParsed['host'], $idSite);
    }
549375
public function addAction($action, $actionParams)
    {
        // check if valid rule usage for object_type_id
        $this->validateRule("Actions", $action);
        // get required parameters for specific rule
        $requiredParams = Actions::GetRequiredParams($action);
        // checking for missing and invalid parameters
        $exception = false;
        if ($action == Actions::PING_URL)
        {
            $exception = true;
        }
        $check_params = $this->_checkParams($requiredParams, $actionParams, $exception);
        // if no missing or invalid rule parameters
        if ($check_params)
        {
            $rule = $action;
            // special formatting for ping_url
            if ($action == Actions::PING_URL)
            {
                $formatted = $this->_formatParams($actionParams, "::");
                $this->_actions[] = $action . "(" . $formatted . ")";

                return $this->_actions;
            }
            // general formatting for actions
            $value = $this->_formatParams($actionParams);
            $formatted = "(" . $value . ")";
            $this->_actions[] = $rule . $formatted;

            return $this->_actions;
        }
        return false;
    }
308978
public function getAction($id, $actionId)
    {
        $action = $this->adapter->get(sprintf('%s/images/%d/actions/%d', $this->endpoint, $id, $actionId));

        $action = json_decode($action);

        return new ActionEntity($action->action);
    }
999837
protected function  o_image($id, $action, $options = '') {
    if  ($action !== 'new') {
      $o = & $this->objects[$id];
    }

    switch ($action) {
    case  'new':
      // make the new object
      $this->objects[$id] = array('t'=>'image', 'data'=>&$options['data'], 'info'=>array());
      
      $info =& $this->objects[$id]['info'];
      
      $info['Type'] = '/XObject';
      $info['Subtype'] = '/Image';
      $info['Width'] = $options['iw'];
      $info['Height'] = $options['ih'];
      
      if (isset($options['masked']) && $options['masked']) {
        $info['SMask'] = ($this->numObj-1).' 0 R';
      }
      
      if  (!isset($options['type']) || $options['type'] === 'jpg') {
        if  (!isset($options['channels'])) {
          $options['channels'] = 3;
        }

        switch ($options['channels']) {
          case  1: $info['ColorSpace'] = '/DeviceGray'; break;
          case  4: $info['ColorSpace'] = '/DeviceCMYK'; break;
          default: $info['ColorSpace'] = '/DeviceRGB'; break;
        }
        
        if ($info['ColorSpace'] === '/DeviceCMYK') {
          $info['Decode'] = '[1 0 1 0 1 0 1 0]';
        }

        $info['Filter'] = '/DCTDecode';
        $info['BitsPerComponent'] = 8;
      } 
      
      else if  ($options['type'] === 'png') {
        $info['Filter'] = '/FlateDecode';
        $info['DecodeParms'] = '<< /Predictor 15 /Colors '.$options['ncolor'].' /Columns '.$options['iw'].' /BitsPerComponent '.$options['bitsPerComponent'].'>>';
      
        if ($options['isMask']) {
          $info['ColorSpace'] = '/DeviceGray';
        }
        else {
          if  (mb_strlen($options['pdata'], '8bit')) {
            $tmp =  ' [ /Indexed /DeviceRGB '.(mb_strlen($options['pdata'], '8bit') /3-1) .' ';
            $this->numObj++;
            $this->o_contents($this->numObj, 'new');
            $this->objects[$this->numObj]['c'] = $options['pdata'];
            $tmp.= $this->numObj.' 0 R';
            $tmp.= ' ]';
            $info['ColorSpace'] =  $tmp;
            
            if  (isset($options['transparency'])) {
              $transparency = $options['transparency'];
              switch ($transparency['type']) {
              case  'indexed':
                $tmp = ' [ '.$transparency['data'].' '.$transparency['data'].'] ';
                $info['Mask'] =  $tmp;
                break;
  
              case 'color-key':
                $tmp = ' [ '.
                  $transparency['r'] . ' ' . $transparency['r'] .
                  $transparency['g'] . ' ' . $transparency['g'] .
                  $transparency['b'] . ' ' . $transparency['b'] .
                  ' ] ';
                $info['Mask'] = $tmp;
                break;
              }
            }
          } else {
            if  (isset($options['transparency'])) {
              $transparency = $options['transparency'];
              
              switch ($transparency['type']) {
              case  'indexed':
                $tmp = ' [ '.$transparency['data'].' '.$transparency['data'].'] ';
                $info['Mask'] =  $tmp;
                break;
  
              case 'color-key':
                $tmp = ' [ '.
                  $transparency['r'] . ' ' . $transparency['r'] . ' ' .
                  $transparency['g'] . ' ' . $transparency['g'] . ' ' .
                  $transparency['b'] . ' ' . $transparency['b'] .
                  ' ] ';
                $info['Mask'] = $tmp;
                break;
              }
            }
            $info['ColorSpace'] = '/'.$options['color'];
          }
        }
        
        $info['BitsPerComponent'] = $options['bitsPerComponent'];
      }

      // assign it a place in the named resource dictionary as an external object, according to
      // the label passed in with it.
      $this->o_pages($this->currentNode, 'xObject', array('label'=>$options['label'], 'objNum'=>$id));

      // also make sure that we have the right procset object for it.
      $this->o_procset($this->procsetObjectId, 'add', 'ImageC');
      break;

    case  'out':
      $tmp = &$o['data'];
      $res =  "\n$id 0 obj\n<<";

      foreach($o['info'] as  $k=>$v) {
        $res.= "\n/$k $v";
      }

      if  ($this->encrypted) {
        $this->encryptInit($id);
        $tmp =  $this->ARC4($tmp);
      }

      $res.= "\n/Length ".mb_strlen($tmp, '8bit') .">>\nstream\n$tmp\nendstream\nendobj";

      return  $res;
    }
  }
457731
protected function createCommand($url,$action,$options = [])
    {
        $command = compact('url', 'action', 'options');
        $command['options']['viewport'] = [
            'width' => $this->windowWidth,
            'height' => $this->windowHeight,
        ];
        if ($this->userAgent) {
            $command['options']['userAgent'] = $this->userAgent;
        }
        if ($this->deviceScaleFactor > 1) {
            $command['options']['viewport']['deviceScaleFactor'] = $this->deviceScaleFactor;
        }
        if ($this->networkIdleTimeout > 0) {
            $command['options']['networkIdleTimeout'] = $this->networkIdleTimeout;
        }
        if ($this->noSandbox) {
            //$command['options']['args'] = ['--no-sandbox','--window-size=1920,1080','--force-device-scale-factor=2'];
            $command['options']['args'] = ['--no-sandbox'];
        }
        return $command;
    }
253705
public CamelControlBusActionBuilder route(String id, String action) {
        super.action.setRouteId(id);
        super.action.setAction(action);
        return this;
    }
1314048
public function make($module, $action = "", $id = null, $params = []) {
        $url = URL_ABSOLUTE . $module;
        if ($action !== "") {
            $url .= '-' . $action;
            if ($id !== null) {
                $url .= '-' . $id;
            }
        }

        $first = true;
        foreach ($params as $i => $param)
        {
            if ($first) {$url .= "?"; $first=false;}
            else {$url .= "&";}
            $url .= $i . "=" . $param;
        }
        return $url;
    }