Exemplo n.º 1
0
            if ($social_reward->icon == 'other') {
                $social_rewards["social_reward-{$social_reward->id}"]['children']["social_reward-{$social_reward->id}-other-orig"] = array('type' => 'html', 'title' => Text::get('rewards-field-social_reward-other'), 'html' => $original->other);
                $social_rewards["social_reward-{$social_reward->id}"]['children']["social_reward-{$social_reward->id}-other"] = array('title' => '', 'type' => 'textbox', 'size' => 100, 'class' => 'inline other', 'value' => $social_reward->other, 'errors' => array(), 'ok' => array(), 'hint' => Text::get('tooltip-project-social_reward-icon-other'));
            }
            // el boton al final
            $social_rewards["social_reward-{$social_reward->id}"]['children']["social_reward-{$social_reward->id}-buttons"] = array('type' => 'group', 'class' => 'buttons', 'children' => array("social_reward-{$social_reward->id}-ok" => array('type' => 'submit', 'label' => Text::get('form-accept-button'), 'class' => 'inline ok')));
        } else {
            $social_rewards["social_reward-{$social_reward->id}"] = array('class' => 'reward social_reward', 'view' => 'view/dashboard/translates/rewards/reward.html.php', 'data' => array('reward' => $social_reward, 'licenses' => $this['licenses']));
        }
    }
}
if (!empty($project->individual_rewards)) {
    foreach ($project->individual_rewards as $individual_reward) {
        // a ver si es el que estamos editando o no
        if (!empty($this["individual_reward-{$individual_reward->id}-edit"])) {
            $original = \Goteo\Model\Project\Reward::get($individual_reward->id);
            // a este grupo le ponemos estilo de edicion
            $individual_rewards["individual_reward-{$individual_reward->id}"] = array('type' => 'group', 'class' => 'reward individual_reward editindividual_reward', 'children' => array("individual_reward-{$individual_reward->id}-reward-orig" => array('title' => Text::get('rewards-field-individual_reward-reward'), 'type' => 'html', 'html' => $original->reward), "individual_reward-{$individual_reward->id}-reward" => array('title' => '', 'type' => 'textbox', 'size' => 100, 'class' => 'inline', 'value' => $individual_reward->reward, 'errors' => array(), 'ok' => array(), 'hint' => Text::get('tooltip-project-individual_reward-reward')), "individual_reward-{$individual_reward->id}-description-orig" => array('type' => 'html', 'title' => Text::get('rewards-field-individual_reward-description'), 'html' => $original->description), "individual_reward-{$individual_reward->id}-description" => array('type' => 'textarea', 'title' => '', 'cols' => 100, 'rows' => 4, 'class' => 'inline reward-description', 'value' => $individual_reward->description, 'errors' => array(), 'ok' => array(), 'hint' => Text::get('tooltip-project-individual_reward-description'))));
            // añadir el campo otros
            if ($individual_reward->icon == 'other') {
                $individual_rewards["individual_reward-{$individual_reward->id}"]['children']["individual_reward-{$individual_reward->id}-other-orig"] = array('type' => 'html', 'title' => Text::get('rewards-field-individual_reward-other'), 'html' => $original->other);
                $individual_rewards["individual_reward-{$individual_reward->id}"]['children']["individual_reward-{$individual_reward->id}-other"] = array('title' => '', 'type' => 'textbox', 'size' => 100, 'class' => 'inline', 'value' => $individual_reward->other, 'errors' => array(), 'ok' => array(), 'hint' => Text::get('tooltip-project-individual_reward-icon-other'));
            }
            // el boton al final
            $individual_rewards["individual_reward-{$individual_reward->id}"]['children']["individual_reward-{$individual_reward->id}-buttons"] = array('type' => 'group', 'class' => 'buttons', 'children' => array("individual_reward-{$individual_reward->id}-ok" => array('type' => 'submit', 'label' => Text::get('form-accept-button'), 'class' => 'inline ok')));
        } else {
            $individual_rewards["individual_reward-{$individual_reward->id}"] = array('class' => 'reward individual_reward', 'view' => 'view/dashboard/translates/rewards/reward.html.php', 'data' => array('reward' => $individual_reward));
        }
    }
}
$sfid = 'sf-project-rewards';