CampURI::processImageOptions PHP Method

processImageOptions() private method

Process the image options given in the new format: where may be one of: number, ratio, width, height and an integer
private processImageOptions ( integer &$p_imageNo, array $p_params )
$p_imageNo integer
$p_params array
    private function processImageOptions(&$p_imageNo, array $p_params)
    {
        $p_imageNo = null;
        for ($parIndex = 0; isset($p_params[$parIndex]); $parIndex++) {
            $parameter = strtolower($p_params[$parIndex]);
            $parIndex++;
            if (!in_array($parameter, array('number', 'ratio', 'width', 'height', 'crop'))) {
                CampTemplate::singleton()->trigger_error("Invalid image parameter '{$parameter}' in URL statement");
                break;
            }
            if (!isset($p_params[$parIndex]) || !is_numeric($p_params[$parIndex])) {
                CampTemplate::singleton()->trigger_error("Invalid image {$parameter} in URL statement");
                break;
            }
            if ($parameter == 'number') {
                $p_imageNo = $p_params[$parIndex];
            } else {
                $this->m_buildQueryArray['Image' . ucfirst($parameter)] = $p_params[$parIndex];
            }
        }
    }